A Cheatsheet to interact with your EKS Cluster using Terminal
After you’ve set up your EKS cluster using Argonaut, you may want to interact with your cluster using your terminal. This cheat sheet lists the commands that you can quickly run to do the same.
💡 This cheat sheet assumes the cluster name to be is
demoCluster and the environment name to be is
Login to your AWS console using your username-password.
Setup access to the kubernetes cluster using the
Alternately, setup access to the kubernetes cluster using AWS credentials
Ensure the user is part of the cluster's authorized users. This can only be done by a user who already has access to the cluster by following this step.
Create an access key and a secret key on AWS.
Once you’ve generated the keys, export the following environment variables:
Create a config file for
kubectlby running the following command:
aws eks update-kubeconfig --name demoEnvironment
To list pods/services running in your environment
kubectl get pods -n demoEnvironment
To view logs for a specific pod/service
kubectl -n demoEnvironment logs podName stateful --tail=100 -f
To log into a pod
kubectl exec -i -t -n demoEnvironment podName -c stateful -- /bin/bash
To view the state of your cluster
Use a Kubernetes dashboard such as k9s to easily view the state of your clusters in your terminal.
To add an AWS user to your cluster
kubectl -n kube-system edit configmap/aws-auth
Then add the below:
- userarn: arn:aws:iam::<<<accountid>>>:user/<your-username>
Note: This will get reset if a change is made to the cluster infrastructure (like modifying node pools etc.)
To view old application log
Set up Grafana (using LogQL) to view older (before Argonaut) application logs and metrics.
When using the terminal to interact with your cluster managed by Argonaut, we recommend the following:
- Do not modify secrets directly on the cluster. Argonaut will not know about the changes and it’ll be out of sync.
- When using a tool like
kubectlor others directly on your cluster, do only read operations. Avoid writing configurations directly to your cluster.