Interview Prep/Jenkins/Integration failures: SonarQube, Nexus, Docker, Trivy, kubectl

Deploy stage: `error: You must be logged in to the server (Unauthorized)` from `kubectl`

BeginnerTroubleshootingIntegration failures: SonarQube, Nexus, Docker, Trivy, kubectl
Answer

Likely causes → Expired token in the kubeconfig credential, wrong kubeconfig, or (on EKS) the IAM identity is not mapped in access entries/aws-auth.

Diagnose → kubectl config view --minify, kubectl auth whoami (1.28+), aws sts get-caller-identity for EKS.

Fix → Refresh the credential; for EKS add an access entry for the role; prefer in-cluster service accounts for deploy pods.

Prevent → Avoid static kubeconfigs; use service accounts or workload identity.

All Jenkins questions Roadmap: Jenkins

More on Integration failures: SonarQube, Nexus, Docker, Trivy, kubectl