-1

I have certain resources where I only want to manage specific fields inside my code repository, and let the others remain unchanged.

I have the following kustomization.yaml:

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

namespace: ingress-nginx

commonLabels:
  app: ingress-nginx-controller

patches:
  - path: metrics.yaml
    target:
      kind: Service
      name: ingress-nginx-metrics
  - path: config.yaml
    target:
      kind: ConfigMap
      name: ingress-nginx-controller

generatorOptions:
  disableNameSuffixHash: true

When I attempt to apply this with kubectl apply -k, I get error: no objects passed to apply. I'm assuming this is because I didn't define any resources? However I still feel like this should be allowed.

All I'm trying to accomplish is managing specific fields of a resource, without taking complete control over it. I just want to have code that sets/ensures specific fields while allowing the unset fields to remain the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.