Developers want to deploy to Kubernetes from Jenkins, but security does not want cluster-admin kubeconfigs in Jenkins. What do you propose?
AdvancedScenarioIntegrations & delivery
Answer
Situation read → Reduce or remove cluster credentials in CI.
What I'd do →
- Preferred: GitOps. Jenkins builds, scans, pushes and then commits the new tag to a config repo (or opens a PR for prod); Argo CD in the cluster pulls and applies.
- If push-based is required: per-namespace service accounts with
editRoleBindings only in target namespaces, used by deploy pod templates (in-cluster) or short-lived tokens (kubectl create token deployer --duration=15missued by an automation). - No cluster-admin anywhere in Jenkins.
Why → GitOps keeps cluster credentials inside the cluster and adds drift correction.
Interview tip → Explain the Jenkins role becomes "CI and promotion", Argo CD does "CD".
More on Integrations & delivery
The SonarQube quality gate step waits until timeout on every build, even though analysis completes. Design the correct integration.IntermediateYou need to publish Java artifacts: snapshots on every `main` build, releases on tags. Design with Nexus.IntermediateTrivy blocks a release because of a HIGH CVE in a base image package with no fix available. Business wants to ship. What do you do?IntermediateImage builds take 9 minutes in Kubernetes pods because nothing is cached. How do you add caching with Kaniko?IntermediateA pipeline should promote the exact image that passed staging to production, not a rebuild. How do you guarantee it?IntermediateYour SonarQube analysis must decorate PRs with comments and fail PR builds on new issues only. How do you configure the pipeline?Advanced