Kustomize: Patch Strategy from RollingUpdate to Recreate

Created on 16 Oct 2018  路  3Comments  路  Source: kubernetes-sigs/kustomize

Hi,
I'm trying to move from RollingUpdate to Recrete.

base-deployment:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: example
spec:
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
...

patch-deployment:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: example
spec:
  strategy:
    type: Recreate

Kustomize-ouput:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: example
spec:
  strategy:
    type: Recreate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0

I tried with $patch: delete but without luck, any idea how to accomplish it?

Most helpful comment

We're going to add a documentation of using strategic merge patch. both replace and delete will be covered.

All 3 comments

@bugbuilder You can try $patch: replace

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: example
spec:
  strategy:
    $patch: replace
    type: Recreate

@Liujingfang1 Thanks for your feedback and sorry for the noise.

We're going to add a documentation of using strategic merge patch. both replace and delete will be covered.

Was this page helpful?
0 / 5 - 0 ratings