CDP CDP Containerization & Orchestration 1 — Questions and Answers
Question 1: Which Kubernetes object is used to ensure a specified number of pod replicas are running at any given time?
- ReplicaSet (Correct answer)
- DaemonSet
- StatefulSet
- Job
Correct answer: ReplicaSet
A ReplicaSet maintains a stable set of replica pods running at any given time to guarantee pod availability.
Question 2: In Docker, what is the primary purpose of a multi-stage build?
- To reduce the final image size by separating build and runtime environments (Correct answer)
- To run multiple containers simultaneously in one image
- To share volumes between containers
- To create multiple tags for a single image
Correct answer: To reduce the final image size by separating build and runtime environments
Multi-stage builds allow you to use multiple FROM instructions, copying only necessary artifacts to the final image, resulting in smaller, leaner production images.
Question 3: Which Kubernetes resource allows you to expose a set of pods as a network service with a stable DNS name?
- Service (Correct answer)
- Ingress
- Endpoint
- NetworkPolicy
Correct answer: Service
A Kubernetes Service provides a stable IP address and DNS name that abstracts access to a dynamic set of pods.
Question 4: What does a Kubernetes Namespace primarily provide?
- A mechanism to isolate resources within a single cluster (Correct answer)
- A method to schedule pods on specific nodes
- A way to persist data across pod restarts
- A tool for rolling back deployments
Correct answer: A mechanism to isolate resources within a single cluster
Namespaces provide a scope for names and isolate resources within a cluster, enabling multi-team or multi-environment separation.
Question 5: Which container orchestration strategy gradually replaces old pod instances with new ones to minimize downtime?
- Rolling update (Correct answer)
- Blue-green deployment
- Canary deployment
- Recreate deployment
Correct answer: Rolling update
A rolling update incrementally replaces old pod instances with new ones, maintaining service availability throughout the update process.
Question 6: What is the function of a Kubernetes ConfigMap?
- To store non-confidential configuration data as key-value pairs (Correct answer)
- To persist encrypted secrets for pods
- To define resource limits for containers
- To map cluster nodes to availability zones
Correct answer: To store non-confidential configuration data as key-value pairs
A ConfigMap stores non-sensitive configuration data separately from container images, allowing configuration to be changed without rebuilding images.
Which Kubernetes object is used to ensure a specified number of pod replicas are running at any given time?