Bobcares

Generate a kubeconfig file for Amazon EKS cluster | How-to Guide

by | Feb 3, 2022

Generate a kubeconfig file for Amazon EKS cluster like an expert with help from the experts at Bobcares. 

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team is ready to help customers with generating a kubeconfig file for the Amazon EKS cluster.

How to generate a kubeconfig file for Amazon EKS cluster

Many of our customers have been facing an AccessDeniedException error when they attempt to generate a kubeconfig file for an Amazon Elastic Kubernetes Service cluster. Fortunately, our Support Engineers have an easy solution for this issue.

generate a kubeconfig file for Amazon EKS cluster

It involves getting permission to use the eks:DescribeCluster API action. In other words, we have to attach an IAM policy to an IAM user.

How to attach an IAM policy to an IAM user

  1. First, open the IAM console.
  2. Then, choose Users or Roles in the navigation pane.
  3. Next, we have to choose the name of the user or role we plan to embed the policy in.
  4. After that, select the Add inline policy on the Permissions tab.
  5. Then, we will select the JSON tab.
  6. Next, we will replace the code with the IAM policy below with a text editor:
    {
       "Version": "2012-10-17",
       "Statement": [
           {
                "Effect": "Allow",
                "Action": [
                    "eks:DescribeCluster"
                ],
                "Resource": "*"
           }
        ]
    }
  7. After that, we select Review policy and enter a name for the policy in the Name field.
  8. Then, we will select Create policy. Our Support Team would like to point out that an explicit deny message indicates that if the MFA is false, it is likely there is an IAM policy that is denying the actions.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "BlockMostAccessUnlessSignedInWithMFA",
          "Effect": "Deny",
          "NotAction": [
            "iam:CreateVirtualMFADevice",
            "iam:EnableMFADevice",
            "iam:ListMFADevices",
            "iam:ListUsers",
            "iam:ListVirtualMFADevices",
            "iam:ResyncMFADevice",
            "sts:GetSessionToken"
          ],
          "Resource": "*",
          "Condition": {
            "BoolIfExists": {
              "aws:MultiFactorAuthPresent": "false"
            }
          }
        }
      ]
    }

[Looking for a solution to another query? We are just a click away.]

Conclusion

To sum up, our skilled Support Engineers at Bobcares demonstrated how to generate a kubeconfig file for Amazon EKS cluster.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.