Aws-iam-authenticator: Unable to connect to the server: getting credentials: exec: exec: "heptio-authenticator-aws": executable file not found in $PATH

Created on 10 Aug 2018  路  4Comments  路  Source: kubernetes-sigs/aws-iam-authenticator

What could I be possibly doing wrong?

$ aws-iam-authenticator help
A tool to authenticate to Kubernetes using AWS IAM credentials

Usage:
  heptio-authenticator-aws [command]

Available Commands:
  help        Help about any command
  init        Pre-generate certificate, private key, and kubeconfig files for the server.
  server      Run a webhook validation server suitable that validates tokens using AWS IAM
  token       Authenticate using AWS IAM and get token for Kubernetes
  verify      Verify a token for debugging purpose

Flags:
  -i, --cluster-id ID     Specify the cluster ID, a unique-per-cluster identifier for your heptio-authenticator-aws installation.
  -c, --config filename   Load configuration from filename
  -h, --help              help for heptio-authenticator-aws
 $  aws eks list-clusters
{
    "clusters": [
        "terraform-eks-demo"
    ]
}

$ grep -C 4 heptio ~/.kube/config
- name: aws
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      command: heptio-authenticator-aws
      args:
        - "token"
        - "-i"
        - "terraform-eks-demo"

$ more config-map-aws-auth.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: aws-auth
  namespace: kube-system
data:
  mapRoles: |
    - rolearn: arn:aws:iam::511491727777:role/terraform-eks-demo
      username: system:node:{{EC2PrivateDNSName}}
      groups:
        - system:bootstrappers
        - system:nodes](url)
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: aws
  name: aws
current-context: aws
kind: Config
preferences: {}
users:
- name: aws
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      command: heptio-authenticator-aws
      args:
        - "token"
        - "-i"
        - "terraform-eks-demo"

Most helpful comment

Your first line calls the command

$ aws-iam-authenticator help

But your kubeconfig references the command as heptio-authenticator-aws

Change your kubeconfig line to match what you are actually naming the binary. You should replace heptio-authenticator-aws with aws-iam-authenticator in your kubeconfig file.

All 4 comments

Your first line calls the command

$ aws-iam-authenticator help

But your kubeconfig references the command as heptio-authenticator-aws

Change your kubeconfig line to match what you are actually naming the binary. You should replace heptio-authenticator-aws with aws-iam-authenticator in your kubeconfig file.

Thanks a lot! @Hareet

The usage output is confusing here:

$ aws-iam-authenticator help
A tool to authenticate to Kubernetes using AWS IAM credentials

Usage:
  heptio-authenticator-aws [command]

Even the binary name is aws-iam-authenticator, it still mentions heptio-authenticator in usage. And seem this commit fixes the issue.

As you mentioned the code here has been updated to address the discrepancy.

I've cut an issue with the EKS team internally to update the binary they are distributing to remove the confusion in the help usage and documentation.

Was this page helpful?
0 / 5 - 0 ratings