Hi All, So I was trying to change *maxSurge* in my deployment via kubectl appy I . . .

pikachunetes:
Hi All,
So I was trying to change maxSurge in my deployment via kubectl appy
I had changed my yaml file to the new value but kubect get deploy deployment_name -o yaml still shows the old maxSurge value
I am able to achieve this via kubectl edit deploy but not via kubectl apply
Pls help

Rahul:
Share your yaml where you are not able to achieve via apply

Mohamed Ayman:
Try to delete the deployment then create it using
$ kubectl apply -f deploymentfilename.yaml

pikachunetes:
@Rahul
This my yaml,
I want my maxSurge to be 1 which is what I have written in cofiguration
I had created my deployment using this same configuration via kubectl create -f

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: nginx
  name: nginx-deployment
spec:
  minReadySeconds: 100
  replicas: 3
  strategy:
    RollingUpdate:
      maxSurge: 1
  selector:
    matchLabels:
      app: nginx
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx:1.14.2
        name: nginx
        ports:
        - containerPort: 80
        resources: {}
status: {}

and @Mohamed Ayman, I don’t want to delete my deployment, I just want to change the maxSurge

Rahul:
Remove this strategy: {} and try again

Rahul:
you do not need that

pikachunetes:
@Rahul, thanks :slightly_smiling_face:
It’s works now

Tanumoy Ghosh:
Wouldn’t it be:

strategy:
    RollingUpdate:    >>>>>>>>>>>>> rollingUpdate:
      maxSurge: 1

Tanumoy Ghosh:

$ kubectl explain deploy --recursive | grep strategy -A3
      strategy  <Object>
         rollingUpdate  <Object>  >>>>>>>>> "r" is expected to be in small
            maxSurge    <string>
            maxUnavailable      <string>

pikachunetes:
yes @Tanumoy Ghosh, I had to change that also
thanks for pointing out