0

Despite having explicitly set apiVersion: client.authentication.k8s.io/v1beta1, why the following error when running any kubectl command (f.e. kubectl version)?

Unable to connect to the server: getting credentials: 
  decoding stdout: no kind "ExecCredential" is registered for version
    "client.authentication.k8s.io/v1alpha1" in scheme "pkg/client/auth/exec/exec.go:62"

Here's the gist of $HOME/.kube/config:

apiVersion: v1
clusters:
  - cluster:
      certificate-authority-data: CLUSTER_CERT
      server: https://CLUSTER_GID.eu-west-1.eks.amazonaws.com
    name: arn:aws:eks:eu-west-1:ACCOUNT_ID:cluster/NAME
contexts:
  - context:
      cluster: arn:aws:eks:eu-west-1:ACCOUNT_ID:cluster/NAME
      user: arn:aws:eks:eu-west-1:ACCOUNT_ID:cluster/NAME
    name:
users:
  - name: arn:aws:eks:eu-west-1:ACCOUNT_ID:cluster/NAME
    user:
      exec:
        apiVersion: client.authentication.k8s.io/v1beta1
        args:
        - --backend
        - pass
        - exec
        - PROFILE
        - --
        - aws-iam-authenticator
        - token
        - -i
        - CLUSTER_ID
        - --role
        - arn:aws:iam::ACCOUNT_ID:role/ROLE
        command: aws-vault
        env: null
        interactiveMode: IfAvailable
        provideClusterInfo: false

aws-vault itself is working. F.e. this returns the expected: aws-vault --backend=pass exec PROFILE -- aws s3 ls

Tool versions:

  • AWS CLI 2.15.33 (Python/3.11.8 Linux/5.15.0-1053-aws exe/aarch64.ubuntu.20)
  • kubectl 1.26.3
  • aws-iam-authenticator 0.5.0
  • aws-vault 7.2.0

Some of the resources I tried to get help from:

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.