Interview Prep/CI/CD/Deployment, Kubernetes and GitOps Failures

`kubectl apply` in the pipeline fails: `error: You must be logged in to the server (Unauthorized)`.

BeginnerTroubleshootingDeployment, Kubernetes and GitOps Failures
Answer

Likely causes → Expired token or kubeconfig, EKS token not refreshed, wrong context.

Diagnose → kubectl config current-context, aws eks get-token --cluster-name X, aws sts get-caller-identity.

Fix → Refresh credentials (aws eks update-kubeconfig), check the identity mapping (access entries or aws-auth).

Prevent → Use short-lived OIDC credentials created per job.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Deployment, Kubernetes and GitOps Failures