Questions tagged [kustomize]

Questions about using kustomize to create and modify Kubernetes manifests in an immutable way.

Kustomize traverses a Kubernetes manifest to add, remove or update configuration options without forking. It is available both as a standalone binary and as a native feature of kubectl. Kustomize supports taking a base set of Kubernetes manifest and applying overlays that apply patches to generate an environment-specific version of the base manifest. It also included generators for configuration maps and secrets.

362 questions
3
votes
1 answer

Kubernetes StorageClassName: quantities must match the regular expression

I have the following pv.yaml Kubernetes/Kustomization file: apiVersion: v1 kind: PersistentVolume metadata: name: myapp-common-pv namespace: myapp labels: app.kubernetes.io/name: myapp-common-pv app.kubernetes.io/component: common-pv …
3
votes
1 answer

Change ONLY the Image Name/Registry in Kustomize Overlay with Image Transformer

For a Kubernetes deployment, given a Kustomize Base like: apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization ... images: - name: developmentregistry.com/myimage:v1.0 Is there a way to change only the image registry and retain the…
superNES64
  • 628
  • 5
  • 14
3
votes
2 answers

Is there a way to have kustomize merge the content of a file into a yaml file?

I am curious to know if there is a way to do a Kustomize replacement or other operation to inject the contents of a non-yaml file into a yaml file using Kustomize. I know Kustomize is not a template engine and that this could be accomplished with…
3
votes
1 answer

kustomize how to target replacement in every array

As per the examples https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/replacements/ one can target specific array items like such spec.template.spec.containers.[name=hello].env.[name=SECRET_TOKEN].value But how do we target every…
bhantol
  • 9,368
  • 7
  • 44
  • 81
3
votes
2 answers

Disable the order/sorting in Kubernetes kustomize build

Trying to use the kustomize to patch a Kubernetes resource. However, the order/sequence of the initContainers list is different in the output. For example, the input is apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: app:…
ChinKang
  • 4,212
  • 2
  • 17
  • 29
3
votes
0 answers

How do you add a custom kustomize transformer?

I'd like to add a transformer to my kustomize setup, one that includes a dynamic value for the case where the local tag needs to override the production tag. If there's a simpler and better way to do this that would be great. I've looked through…
lucidquiet
  • 6,124
  • 7
  • 51
  • 88
3
votes
2 answers

How do I actually get the output of kubectl kustomize into my cluster?

I have a very simple kustomization.yaml: configMapGenerator: - name: icecast-conifg files: - icecast.xml When I run kubectl kustomize . it spits out a generated configMap properly, but how do I actually load it into my cluster? I'm…
user3056541
  • 75
  • 1
  • 5
3
votes
1 answer

Is it possible to have a dynamic namePrefix/nameSuffix in kustomize?

In Helm, it is possible to specify a release name using helm install my-release-name chart-path This means, I can specify the release name and its components (using fullname) using the CLI. In kustomize (I am new to kustomize), there is a similar…
user140547
  • 7,750
  • 3
  • 28
  • 80
3
votes
2 answers

How to pass Git credentials in a Kustomize build command?

I have a kustomization.yaml file that uses a private repository as a resource: apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - https://gitlab.com/my-user/k8s-base-cfg.git patchesStrategicMerge: - app-patch.yaml I…
Fernando Lozano
  • 352
  • 2
  • 11
3
votes
0 answers

Helmfile + Kustomize - cannot unmarshal !!seq into state.HelmState

I am trying to use the Kustomize with Helmfile by following the instructions given in Readme, but I am getting below error when I try to run the sync command. helmfile --environment dev --file=helmfile.yaml sync in ./helmfile.yaml: failed to read…
Devesh mehta
  • 1,505
  • 8
  • 22
3
votes
1 answer

Kustomize fails to process secretGenerator, with kubectl it works though

I have an overlay kustomization.yaml as following: apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization bases: - ../../base/ patches: - patch.yaml secretGenerator: - name: my-secrets env: password.env When applying…
Andrey
  • 20,487
  • 26
  • 108
  • 176
3
votes
1 answer

How to make Kustomize overlay ignore secretGenerator in base?

I'm writing Kustomize configs for several apps and using overlays to overwrite a base configuration for staging and production environments. The base config creates a secret from a file called dev.json and names that secret -dev-config. The staging…
Kyle Baran
  • 37
  • 5
3
votes
2 answers

Look up secrets from gcloud secrets manager directly as secretGenerator with kustomize

I am setting up my Kubernetes cluster using kubectl -k (kustomize). Like any other such arrangement, I depend on some secrets during deployment. The route I want go is to use the secretGenerator feature of kustomize to fetch my secrets from files or…
3
votes
1 answer

Environment variables not available within pod/container when using "envFrom" and "configMapRef" (kustomize/kubernetes/laravel)

I use kustomize as a standalone binary (installed with Homebrew) and have the following base/kustomization.yaml file: apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization commonLabels: app: myservice app.kubernetes.io/name: myservice …
3
votes
1 answer

Kustomize configMapGenerator

In kubernetes kustomize.yml, when I use configMapGenerator to pass in some values as env, can I access those variables in deployed springboot application, application.properties file? kustomize.yml ... configMapGenerator: - name: test-app-config …
Sarav
  • 245
  • 3
  • 12