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