cmattoon / aws-ssm

Populates Kubernetes Secrets from AWS Parameter Store
https://hub.docker.com/r/cmattoon/aws-ssm/
Apache License 2.0
168 stars 32 forks source link

Error with kubernetes client: stat /home/ec2-user/.kube/config: no such file or directory #16

Closed hydeenoble closed 5 years ago

hydeenoble commented 5 years ago

I am trying to run the aws-ssm with docker:

sudo docker run --env KUBE_CONFIG=~/.kube/config --env MASTER_URL=<API server endpoint from EKS> cmattoon/aws-ssm

and I keep getting

level=fatal msg="Error with kubernetes client: stat /home/ec2-user/.kube/config: no such file or directory

even when I am sure ~/.kube/config exist.

am i missing something?

cmattoon commented 5 years ago

KUBE_CONFIG should be the path inside the container (which you'll have to mount/provide as a secret/configmap)

Can you try:

sudo docker run \
    -v "/home/ec2-user/.kube/config:/mnt/.kube/config" \
    --env KUBE_CONFIG=/mnt/.kube/config \
    --env MASTER_URL=<API server endpoint from EKS> \
    cmattoon/aws-ssm
hydeenoble commented 5 years ago

Thank you very much @cmattoon, It worked. But, I now have a new error message:

Error retrieving secrets: Get <API server endpoint from EKS>/api/v1/secrets: getting credentials: exec: exec: \"heptio-authenticator-aws\": executable file not found in $PATH"

Can you help??

hydeenoble commented 5 years ago

@cmattoon, Please, can I get help here?

cmattoon commented 5 years ago

The error thrown is exec: exec: \"heptio-authenticator-aws\": executable file not found in $PATH, so I'm assuming you'll need to either: a) fork and build a container with heptio-authenticator-aws; or b) Update the .kube/config for this container to authenticate some other way

I'll look into supporting https://github.com/kubernetes-sigs/aws-iam-authenticator

dawidmalina commented 5 years ago

For EKS support :+1:

cmattoon commented 5 years ago

It should work now (after re-pulling latest)