You need to update a production Deployment that currently runs 4 replicas of an API service in your Kubernetes cluster. The Deployment manifest (simplified) is shown below:
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
spec:
replicas: 4
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 2
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: registry.example.com/api:2.0
Immediately after you change the container image tag from api:1.0 to api:2.0, what is the greatest number of Pods (old + new) that Kubernetes might have running for this Deployment at any single point in time during the rolling update?
The Deployment's desired replica count is 4. A RollingUpdate strategy with maxSurge: 2 allows Kubernetes to temporarily create up to two additional Pods above the desired replica count while new Pods are coming up. Therefore, during the rollout the controller may run at most 4 (desired) + 2 (surge) = 6 Pods simultaneously. The maxUnavailable: 1 setting only limits how many Pods may be taken out of service; it does not raise the total further, so the upper bound remains six. The other answer choices either ignore the surge allowance (4 or 5) or exceed the permitted surge (7).
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the maxSurge parameter in a Kubernetes Deployment?
Open an interactive chat with Bash
How does the maxUnavailable parameter affect the rolling update process?
Open an interactive chat with Bash
What happens if maxSurge and maxUnavailable are set incorrectly?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access