Skip to main content

Access kubernetes cluster directly

Generating access tokens

  1. Make sure you’re using a recent version of the CLI. Setup instructions are here.
  2. Run art configure generate-aws-credentials
  3. Run aws eks update-kubeconfig --name <clustername> --region <region>

The generated access tokens are valid for 12 hours. These inherit the same privileges granted to the argonaut account for accessing the aws account and infra.

Setting up Mirantis Lens

Lens is an amazing kubernetes dashboard. It can be downloaded here.

Lens uses the kubeconfig file to get the access details. The kubeconfig file will need to be updated with these credentials manually. To do so, edit the file at ~/.kube/config and fill in the values in {}. The values are obtained by running art configure generate-aws-credentials above.

This set of tokens will be valid for 12 hours.

- name: arn:aws:eks:<region>:<awsaccount:cluster/<clustername>
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args: - --region - <region> - eks - get-token - --cluster-name - <clustername>
command: aws
env:
- name: AWS_ACCESS_KEY_ID
value: {static_value}
- name: AWS_SECRET_ACCESS_KEY
value: {static_value}
- name: AWS_SESSION_TOKEN
value: {static_value}

Setting up k9s

k9s is a CLI tool for the keyboard ninjas. Installing k9s is simple.

Running k9s is as simple as:

art configure generate-aws-credentials | jq -r ‘“export ACCESS_KEY_ID=\(.accessKeyId|@sh) ACCOUNT_ID=\(.accountId|@sh) SESSION_TOKEN=\(.sessionToken|@sh)“'
k9s