/
Useful Commands

Useful Commands

Access and management to your cluster is done through the kubectl (Kubernetes Controller CLI) and eksctl (AWS EKS Controller CLI) tools.

 

The self-managed automation repository has an easy script that can be used to execute your scripts at the appropriate cluster, even if you have multiple saved locally.

 

Instead of: kubectl --context "<full AWS ARN>" <command> <args> (<opts>)

You can instead run: ./bin/kubectl <command> <args> (<opts>)

For example: ./bin/kubectl get pods

 

How do I ___?

Deploy a new version?

./bin/deploy

 

SSH into pods?

./bin/kubectl exec -it deploy/userwise-app-worker -- /bin/sh

./bin/kubectl exec -it deploy/userwise-app-frontend -- /bin/sh

 

Allow another IAM User to SSH into pods?

eksctl create iamidentitymapping --arn <insert_iam_arn> --group system:masters --no-duplicate-arns --cluster <cluster_name>

 

See all pods (and their status) in the K8S cluster?

./bin/kubectl get pods

 

Access logs from pods in the K8S cluster?

./bin/kubectl logs (<pod_name>|deploy/<deployment_name>|<full_resource_name>)

Pod Name (these won’t work if copied, use get pods to get the generated name)

./bin/kubectl logs userwise-app-frontend-6b5d56db6b-mbnh6

./bin/kubectl logs userwise-app-worker-76c58bbb68-5sfwl

Deployment Name (will work if copied)

./bin/kubectl logs deploy/userwise-app-worker

./bin/kubectl logs deploy/userwise-app-frontend

 

Related content

Powered by UserWise