[TIL] K8s AWS: How to check Pod logs
TIL how to check Pod logs on a K8s cluster running on AWS EKS.
Requirements:
- K8s cluster on AWS EKS
- AWS CLI
kubectl
First, connect to the AWS account. Here, I’m doing it using Named Profiles:
export AWS_PROFILE=ramigs-devUpdate the context on your local .kube/config file:
aws eks --region eu-north-1 update-kubeconfig --name k8s-clusterConfirm that your connection is working, by requesting the list of namespaces:
kubectl get nsTake note of the namespace tho which the pod you want to check belongs to.
Get the list of pods:
kubectl get pods -n namespaceCheck logs:
kubectl logs -f pod-name -n namespace container-name