
Ultimate access to all questions.
Your application is deployed in a Google Kubernetes Engine (GKE) cluster. When releasing a new version, your CI/CD pipeline updates the spec.template.spec.containers[0].image field to point to the new Docker image. You want to ensure that at least one replica of the new version is deployed while keeping the old replicas running until the new replica becomes healthy.
What modification should you apply to the following GKE Deployment configuration?
apiVersion: apps/v1
kind: Deployment
metadata:
name: ecommerce-frontend-deployment
spec:
replicas: 3
selector:
matchLabels:
app: ecommerce-frontend
template:
metadata:
labels:
app: ecommerce-frontend
spec:
containers:
- name: ecommerce-frontend-webapp
image: ecommerce-frontend-webapp:1.7.9
ports:
- containerPort: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: ecommerce-frontend-deployment
spec:
replicas: 3
selector:
matchLabels:
app: ecommerce-frontend
template:
metadata:
labels:
app: ecommerce-frontend
spec:
containers:
- name: ecommerce-frontend-webapp
image: ecommerce-frontend-webapp:1.7.9
ports:
- containerPort: 80
A
Set the Deployment strategy to RollingUpdate with maxSurge set to 0, maxUnavailable set to 1.
B
Set the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0.
C
Set the Deployment strategy to Recreate with maxSurge set to 0, maxUnavailable set to 1.
D
Set the Deployment strategy to Recreate with maxSurge set to 1, maxUnavailable set to 0.