What is the main goal of using a canary deployment in a Jenkins pipeline?
Think about minimizing risk when releasing new software.
Canary deployment gradually exposes new code to a small group of users to catch issues early before full deployment.
Given this Jenkins pipeline snippet for canary deployment, what will be the output of the Deploy Canary stage if the deployment succeeds?
stage('Deploy Canary') { steps { echo 'Deploying to 10% of users' sh 'kubectl apply -f canary-deployment.yaml' echo 'Canary deployment successful' } }
Look at the echo statements and the deployment percentage.
The stage prints messages before and after applying the canary deployment manifest, indicating success for 10% users.
Which Jenkinsfile snippet correctly implements a rollback step if the canary deployment test fails?
Check how the shell command status is checked and when rollback should happen.
The rollback should trigger if the test script returns a non-zero status. Option B correctly checks for non-zero and triggers rollback.
Arrange the following steps in the correct order for a Jenkins pipeline implementing a canary deployment:
- Run canary tests
- Deploy to full production
- Deploy to canary subset
- Monitor canary metrics
Think about deploying first, then testing and monitoring before full rollout.
The correct order is deploy to canary, run tests, monitor metrics, then deploy fully if all is good.
In a Jenkins pipeline, the canary deployment stage runs but the new version is not serving traffic. Which of the following is the most likely cause?
Consider why new pods might not receive traffic despite successful deployment.
If the deployment selector labels do not match the service selectors, traffic won't reach the new pods even if deployment succeeds.