Image builds take 9 minutes in Kubernetes pods because nothing is cached. How do you add caching with Kaniko?
IntermediateScenarioIntegrations & delivery
Answer
Situation read → Ephemeral pods lose the layer cache.
What I'd do →
- Enable Kaniko's registry cache:
/kaniko/executor --context dir://$WORKSPACE --dockerfile Dockerfile \ --destination $IMAGE:$TAG --cache=true --cache-repo=$REGISTRY/cache/shack-app - Order the Dockerfile so dependency install layers come before source copy.
- Use a base image mirror in the internal registry.
- For BuildKit, use
--export-cache type=registryand--import-cache.
Why → A registry-backed cache survives pod deletion.
Interview tip → Mention cache repos need their own retention policy.
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.IntermediateDevelopers want to deploy to Kubernetes from Jenkins, but security does not want cluster-admin kubeconfigs in Jenkins. What do you propose?AdvancedTrivy 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?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