Kustomize patch doesn’t patch base values – GKE Managed Certs

I’m trying to “templatize” the K8s manifests I currently use to generate my Google managed certificates on GKE. When I run kustomize build it runs successfully, but regardless of what patching type I use, the returned yaml only shows the base configuration, none of the patched values are reflected in the build output. I’ve tried both strategic merge patching and JSON6902 patching. I’ve tried including the path to a patch file as well as doing it directly in the kustomization.yaml using both patches: and patchesJson6902: as well as applying kustomize edit fix and results are all the same. The files below are my most recent attempt using patchesJson6902: and a kustomization.yaml in-line patch.

Kustomize v5.5.0 & v5.0.4-0.20230601165947-6ce0bf390ce3
(same results with kubectl included kustomize version)

I have the following file layout:

base
|--managed-cert.yaml
|--kustomization.yaml
overlays
|--newenv
   |--kustomization.yaml

File Contents:

managed-cert.yaml

apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: some-managed-cert
  namespace: ""
spec:
  domains:
    - ""

kustomization.yaml (base)

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- managed-cert.yaml

kustomization.yaml (overlay)
(Edit – changed target version to reflect suggestion below, no change in behavior)

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: new-env

patchesJson6902:
  - target:
      group: networking.gke.io/v1
      version: v1
      kind: ManagedCertificate
      name: managed-cert
    patch: |-
     - op: replace
       path: /metadata/name
       value: new-cert-name
     - op: replace
       path: /spec/domains/-
       value: new.domain.name  

kustomize build output:

# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: some-managed-cert
  namespace: new-env
spec:
  domains:
  - ""

As you can see the namspace transformation is happening but nothing else is.

New contributor

Joephus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Your patch does not match since you specify a version v1beta1 while the ManagedCertificate is defined using version v1.
Also the name does not match, the object has ‘some-managed-cert’ and the patch targets ‘managed-cert’

2

Take off the /v1 from the group as it is matched in the version, like thomas said make sure the name is the same, and remove the /- from the path for the domain name. See if my example below works

patchesJson6902:
  - target:
      group: networking.gke.io
      version: v1
      kind: ManagedCertificate
      name: some-managed-cert
    patch: |-
      - op: replace
        path: /metadata/name
        value: new-cert-name
      - op: replace
        path: /spec/domains
        value: new.domain.name 

New contributor

Cody Flynn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Kustomize patch doesn’t patch base values – GKE Managed Certs

I’m trying to “templatize” the K8s manifests I currently use to generate my Google managed certificates on GKE. When I run kustomize build it runs successfully, but regardless of what patching type I use, the returned yaml only shows the base configuration, none of the patched values are reflected in the build output. I’ve tried both strategic merge patching and JSON6902 patching. I’ve tried including the path to a patch file as well as doing it directly in the kustomization.yaml using both patches: and patchesJson6902: as well as applying kustomize edit fix and results are all the same. The files below are my most recent attempt using patchesJson6902: and a kustomization.yaml in-line patch.

Kustomize v5.5.0 & v5.0.4-0.20230601165947-6ce0bf390ce3
(same results with kubectl included kustomize version)

I have the following file layout:

base
|--managed-cert.yaml
|--kustomization.yaml
overlays
|--newenv
   |--kustomization.yaml

File Contents:

managed-cert.yaml

apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: some-managed-cert
  namespace: ""
spec:
  domains:
    - ""

kustomization.yaml (base)

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- managed-cert.yaml

kustomization.yaml (overlay)
(Edit – changed target version to reflect suggestion below, no change in behavior)

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: new-env

patchesJson6902:
  - target:
      group: networking.gke.io/v1
      version: v1
      kind: ManagedCertificate
      name: managed-cert
    patch: |-
     - op: replace
       path: /metadata/name
       value: new-cert-name
     - op: replace
       path: /spec/domains/-
       value: new.domain.name  

kustomize build output:

# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: some-managed-cert
  namespace: new-env
spec:
  domains:
  - ""

As you can see the namspace transformation is happening but nothing else is.

New contributor

Joephus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Your patch does not match since you specify a version v1beta1 while the ManagedCertificate is defined using version v1.
Also the name does not match, the object has ‘some-managed-cert’ and the patch targets ‘managed-cert’

2

Take off the /v1 from the group as it is matched in the version, like thomas said make sure the name is the same, and remove the /- from the path for the domain name. See if my example below works

patchesJson6902:
  - target:
      group: networking.gke.io
      version: v1
      kind: ManagedCertificate
      name: some-managed-cert
    patch: |-
      - op: replace
        path: /metadata/name
        value: new-cert-name
      - op: replace
        path: /spec/domains
        value: new.domain.name 

New contributor

Cody Flynn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Kustomize patch doesn’t patch base values – GKE Managed Certs

I’m trying to “templatize” the K8s manifests I currently use to generate my Google managed certificates on GKE. When I run kustomize build it runs successfully, but regardless of what patching type I use, the returned yaml only shows the base configuration, none of the patched values are reflected in the build output. I’ve tried both strategic merge patching and JSON6902 patching. I’ve tried including the path to a patch file as well as doing it directly in the kustomization.yaml using both patches: and patchesJson6902: as well as applying kustomize edit fix and results are all the same. The files below are my most recent attempt using patchesJson6902: and a kustomization.yaml in-line patch.

Kustomize v5.5.0 & v5.0.4-0.20230601165947-6ce0bf390ce3
(same results with kubectl included kustomize version)

I have the following file layout:

base
|--managed-cert.yaml
|--kustomization.yaml
overlays
|--newenv
   |--kustomization.yaml

File Contents:

managed-cert.yaml

apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: some-managed-cert
  namespace: ""
spec:
  domains:
    - ""

kustomization.yaml (base)

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- managed-cert.yaml

kustomization.yaml (overlay)
(Edit – changed target version to reflect suggestion below, no change in behavior)

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: new-env

patchesJson6902:
  - target:
      group: networking.gke.io/v1
      version: v1
      kind: ManagedCertificate
      name: managed-cert
    patch: |-
     - op: replace
       path: /metadata/name
       value: new-cert-name
     - op: replace
       path: /spec/domains/-
       value: new.domain.name  

kustomize build output:

# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: some-managed-cert
  namespace: new-env
spec:
  domains:
  - ""

As you can see the namspace transformation is happening but nothing else is.

New contributor

Joephus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Your patch does not match since you specify a version v1beta1 while the ManagedCertificate is defined using version v1.
Also the name does not match, the object has ‘some-managed-cert’ and the patch targets ‘managed-cert’

2

Take off the /v1 from the group as it is matched in the version, like thomas said make sure the name is the same, and remove the /- from the path for the domain name. See if my example below works

patchesJson6902:
  - target:
      group: networking.gke.io
      version: v1
      kind: ManagedCertificate
      name: some-managed-cert
    patch: |-
      - op: replace
        path: /metadata/name
        value: new-cert-name
      - op: replace
        path: /spec/domains
        value: new.domain.name 

New contributor

Cody Flynn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật