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
1
vote
1 answer

How to avoid not empty namespace deletion with Kubernetes Kustomize

I have a Kubernetes project managed by Kustomized (Kubernetes). This project deploys two deployments in the same namespace. Basically, I have the following directory structure: kustomize -> app1 -> kustomization.yaml kustomize -> app1 ->…
Salvatore D'angelo
  • 1,019
  • 3
  • 14
  • 39
1
vote
1 answer

Is there a good way to set dynamic labels for k8s resources?

I'm attempting to add some recommended labels to several k8s resources, and I can't see a good way to add labels for things that would change frequently, in this case "app.kubernetes.io/instance" and "app.kubernetes.io/version". Instance seems like…
EMC
  • 1,560
  • 2
  • 17
  • 31
1
vote
1 answer

Mounting External NFS share on Pod and permission denied to access files

I have tried to read all the questions and answers in Stack Overflow, and doing a lot of googling, ask some of my Kubernetes Guru around me, but to not available... I am becoming crazy with that problem... Here is my problem, we have several…
1
vote
1 answer

Kubernetes Cross secrets variables

I have a weird issue with envFrom:  - name: template-api envFrom:    - secretRef: name: common-secrets    - secretRef: name: template-api in common-secrets I have variables like this: MAILHOST=smtp.gmail.com MAILPORT=587 And…
1
vote
1 answer

kustomize: how to pass `newTag` from command line

I am using https://kustomize.io/ have below is my kustomization.yaml file, I have multiple docker images and during deployment all having same tag. I can manually change all the tag value and I can run it kubectl apply -k . through command…
user584018
  • 10,186
  • 15
  • 74
  • 160
1
vote
2 answers

Kustomize: Can I managed using single overlay per environment (dev/test/qa) where environment variables for each microservice are different

I have different sets of environment variables per deployment/microservice and vaule for each environment (dev/test/qa) are different. Do I need overlay file for each deployment/microservice against each environment (dev/test/qa) or I can managed…
user584018
  • 10,186
  • 15
  • 74
  • 160
1
vote
2 answers

how to set image name/tag for container images specified in CRDs in kustomization.yaml

how to set image name/tag for container images specified in CRDs through the kustomization.yaml using the images field? The images field works well when the container images are specified in either Deployment or StatefulSet, but not transform a CRD…
shawnzhu
  • 7,233
  • 4
  • 35
  • 51
1
vote
1 answer

How to replace helm values.yaml by using the kustomize configMapGenerator generated name?

I use kustomize to generate various configMap as the following example: - # kustomization.yaml configMapGenerator: - name: my-config-path # <-- My original name. files: - file1.txt - file2.txt - ... - fileN.txt The output is as the…
Charlee Chitsuk
  • 8,847
  • 2
  • 56
  • 71
1
vote
2 answers

How could I run kubectl -k in an Azure DevOps pipeline?

Currently the Azure kubectl task uses Kubectl version 1.13.xxx. Is there any way to run a newer version of kubectl that supports apply -k or kustomize?
Brad Vrabete
  • 65
  • 1
  • 5
1
vote
2 answers

ConfigMap that can reference current Namespace

I'm working with a Pod (Shiny Proxy) that talks to Kubernetes API to start other pods. I'm wanting to make this generic, and so don't want to hardcode the namespace (because I intend to have multiple of these, deployed probably as an OpenShift…
Cameron Kerr
  • 1,725
  • 16
  • 23
1
vote
1 answer

no matches for kind "Kustomization" in version "kustomize.config.k8s.io/v1beta1"

Getting the below error for the command kubectl apply -n prod -f kustomize/kustomization.yaml error: unable to recognize "kustomize/kustomization.yaml": no matches for kind "Kustomization" in version "kustomize.config.k8s.io/v1beta1" Please advise.
1
vote
1 answer

Converting `ClusterRoleBinding` to `RoleBinding` and setting namespace for it and an additional `Deployment` resource using `kustomize`

I would like to transform a ClusterRoleBinding in a RoleBinding using kustomize-v4.0.5, and also set the namespace field for the RoleBinding and in an additional Deployment resource with the same value. I succeed in doing that using files below: cat…
Fabrice Jammes
  • 2,275
  • 1
  • 26
  • 39
1
vote
1 answer

Is it possible to load annotations from file in Kubernetes?

I have a very long configuration for nginx ingress that I have to specify using nginx.ingress.kubernetes.io/server-snippet annotation. nginx.ingress.kubernetes.io/server-snippet: | gzip on; gzip_types text/plain…
Ahmad
  • 5,551
  • 8
  • 41
  • 57
1
vote
1 answer

What is the correct group for ConfigMaps in a Kustomize patch?

In general, how can I get the group name for any type of resource? And in particular, what should I use for group here: - path: cm.patch.yaml target: kind: ConfigMap group: "" # <------ version: v1 name:…
Behrang
  • 46,888
  • 25
  • 118
  • 160
1
vote
1 answer

Split ConfigMap in two with using Kustomize

I have the following ConfigMap. I'm trying to split the two datasources out into two separate files, and merge them at "build time" using Kustomize. But I just can't figure out how to do that? This is what I have: apiVersion: v1 kind:…
Joel
  • 8,502
  • 11
  • 66
  • 115