Hi All, CKAD lightning lab 1 "Create a new deployment called `nginx-deploy`, wit . . .

karthik:
Hi All, CKAD lightning lab 1 “Create a new deployment called nginx-deploy, with one signle container called nginx, image nginx:1.16 and 4 replicas. The deployment should use RollingUpdate strategy with maxSurge=1, and maxUnavailable=2.”. All the steps are successful except the first step “Deployment created correctly”

This is the rollingupdate config spec that I used:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 2
Even though I set these values, it keeps setting the default values of 25% for both maxSurge and maxUnavailable due to which first step in the tests “Deployment created correctly?” fails

Please help. I have attached the yaml file

Hello @karthik,

try this yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx-deploy
  name: nginx-deploy
  namespace: default
spec:
  replicas: 4
  selector:
    matchLabels:
      app: nginx-deploy
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 2
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: nginx-deploy
    spec:
      containers:
      - image: nginx:1.16
        imagePullPolicy: IfNotPresent
        name: nginx

kubectl set image deployment/nginx-deploy nginx=nginx:1.17 --record

kubectl rollout undo deployment nginx-deploy

Thanks,
KodeKloud Support