You need to run end-to-end tests against an ephemeral environment per PR and clean it up reliably. Design it.
AdvancedScenarioIntegrations & delivery
Answer
Situation read → Preview environments tied to PR lifecycle.
What I'd do →
- On PR build: create namespace
pr-${CHANGE_ID}, deploy with Helm using the PR image tag, run E2E tests. - In
post { cleanup { } }: optional teardown; better to keep the environment while the PR is open. - A scheduled cleanup job deletes namespaces whose PR is closed (query GitHub API) or older than N days; label namespaces with
pr,created-at. - ResourceQuota per preview namespace.
Why → post cleanup is not enough (aborted builds, controller restarts), so a reaper job is essential.
Interview tip → Mention cost controls on preview environments.
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?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?Intermediate