Skip to content

A convenient docker image for working with Amazon ECS / aws-iam-authenticator / kubectl

License

Notifications You must be signed in to change notification settings

ipfaffy/amazon-eks-kubectl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Amazon EKS kubectl

This is a convenient docker image that contains:

  • kubectl (v1.11.0)
  • aws-iam-authenticator (v0.3.0)
  • AWS CLI (v1.15.69)

The default entrypoint for this container, is a small wrapper script for kubectl that automatically populates a ~/.kube/config with the correct EKS cluster details (endpoint, certificate authority).

Usage

$ docker run -e CLUSTER=demo maddox/kubectl get services
NAME            TYPE           CLUSTER-IP     EXTERNAL-IP        PORT(S)          AGE
kubernetes      ClusterIP      10.100.0.1     <none>             443/TCP          57d

AWS Credentials

The kubectl wrapper script used by this container uses the AWS CLI to fetch the necessary cluster details for the kube config file (api endpoint, certificate authority etc).

The AWS CLI will automatically pick up AWS credentials from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN), the AWS credentials file (~/.aws/credentials), container credentials (ECS role) or EC2 instance role (in that order).

If you already have AWS credentials configured in ~/.aws/credentials you can pass these through by running:

$ docker run -v ~/.aws:/home/kubectl/.aws -e CLUSTER=demo maddox/kubectl get services

About

A convenient docker image for working with Amazon ECS / aws-iam-authenticator / kubectl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 53.3%
  • Dockerfile 46.7%