Failed to get /version for clusterId= Unauthorized

Hi Team,
When I try to connect the kubernetes cluster i got into below issue:
Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized
I can connect to my cluster using kubectl from Mac terminal.

Here is my kube config.
➜ ~ k config view --minify
apiVersion: v1
clusters:

  • cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://XXXXXXXX.sk1.us-west-1.eks.amazonaws.com
    name: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    contexts:
  • context:
    cluster: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    user: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    name: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    current-context: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    kind: Config
    preferences: {}
    users:
  • name: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    user:
    exec:
    apiVersion: client.authentication.k8s.io/v1beta1
    args:
    - --region
    - us-west-1
    - eks
    - get-token
    - --cluster-name
    - kkrwest-eks0
    command: aws
    env:
    - name: AWS_PROFILE
    value: AWSAdministratorAccess-XXXXXX
    interactiveMode: IfAvailable
    provideClusterInfo: false
    ➜ ~

ailed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

were you able to solve this? I have the exact same issue

For those stucked here, make sure to update your awscli to latest and update your apiVersion URL to latest.

Currently is apiVersion: client.authentication.k8s.io/v1beta1

1 Like

I solved this by configuring config map aws-auth:

kubectl edit configmap aws-auth --namespace kube-system
mapUsers: |
  - userarn: arn:aws:iam::XXXXXXXXXXXX:user/testuser
    username: testuser
    groups:
      - system:masters
1 Like