Kubernetes Container Orchestration CI/CD Integration 2 — Questions and Answers
Question 1: Which Kubernetes resource is most commonly used to perform a rolling update in a CI/CD pipeline without downtime?
- StatefulSet
- DaemonSet
- Deployment (Correct answer)
- Job
Correct answer: Deployment
Deployments support rolling updates by gradually replacing old Pods with new ones, enabling zero-downtime releases in CI/CD pipelines.
Question 2: In a GitOps workflow using ArgoCD, what triggers a sync to the cluster?
- A webhook from the container registry
- A change committed to the Git repository (Correct answer)
- A manual kubectl apply command
- A cron job running inside the cluster
Correct answer: A change committed to the Git repository
ArgoCD monitors a Git repository and syncs the cluster state when it detects a change in the desired state stored in Git.
Question 3: What is the purpose of a Kubernetes ImagePullPolicy set to 'Always' in a CI/CD pipeline?
- To cache images locally on every node
- To force the kubelet to pull the image from the registry on every Pod start (Correct answer)
- To skip image validation checks
- To pull images only when the tag changes
Correct answer: To force the kubelet to pull the image from the registry on every Pod start
ImagePullPolicy: Always ensures the latest version of a mutable image tag (like 'latest') is always pulled, which is useful in fast-moving CI/CD environments.
Question 4: Which kubectl command performs a declarative rollout of a new container image version in a Deployment?
- kubectl scale deployment my-app --replicas=0
- kubectl set image deployment/my-app container=image:v2 (Correct answer)
- kubectl replace -f deployment.yaml
- kubectl annotate deployment my-app image=v2
Correct answer: kubectl set image deployment/my-app container=image:v2
kubectl set image updates the container image in a Deployment, triggering a rolling update automatically.
Question 5: A CI pipeline needs to run integration tests against a freshly deployed app in Kubernetes. Which approach best isolates each test run?
- Run all tests against the production namespace
- Deploy to a dedicated ephemeral namespace per pipeline run and delete it after (Correct answer)
- Share a single staging namespace across all pipeline runs
- Use a ConfigMap to toggle test mode on the production Deployment
Correct answer: Deploy to a dedicated ephemeral namespace per pipeline run and delete it after
Ephemeral namespaces provide complete isolation per pipeline run, preventing test interference and enabling parallel pipelines safely.
Question 6: What does a Kubernetes readinessProbe ensure in the context of a CI/CD rolling update?
- Old Pods are terminated before new ones start
- New Pods only receive traffic after they pass health checks (Correct answer)
- The image is signed before deployment
- The Deployment pauses until a manual approval is given
Correct answer: New Pods only receive traffic after they pass health checks
ReadinessProbes prevent traffic from routing to new Pods until they are fully initialized, ensuring zero-downtime during rolling updates.
Question 7: Which Helm command is used in a CI/CD pipeline to upgrade a release if it exists, or install it if it doesn't?
- helm install --force
- helm upgrade --install (Correct answer)
- helm apply --upsert
- helm push --deploy
Correct answer: helm upgrade --install
helm upgrade --install is idempotent: it installs the chart on first run and upgrades on subsequent runs, making it safe for automated pipelines.
Which Kubernetes resource is most commonly used to perform a rolling update in a CI/CD pipeline without downtime?