[TIL] K8s AWS: How to check Pod logs

TIL how to check Pod logs on a K8s cluster running on AWS EKS.

Requirements:

First, connect to the AWS account. Here, I'm doing it using Named Profiles:

export AWS_PROFILE=ramigs-dev

Update the context on your local .kube/config file:

aws eks --region eu-north-1 update-kubeconfig --name k8s-cluster

Confirm that your connection is working, by requesting the list of namespaces:

kubectl get ns

Take note of the namespace tho which the pod you want to check belongs to.

Get the list of pods:

kubectl get pods -n namespace

Check logs:

kubectl logs -f pod-name -n namespace container-name