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
5
votes
1 answer

Use kustomize to set hostPath path

Is it possible to use kustomize to specify a volume hostPath from an env variable? I have a Kubernetes manifest that describes my deployment consisting of a container. During development, I use a different image (that contains dev tools) and mount…
Coder Jones
  • 93
  • 1
  • 4
5
votes
3 answers

How to use Amazon EFS with EKS in Terraform

So far I have 2 directories: aws/ k8s/ Inside aws/ are .tf files describing a VPC, networking, security groups, IAM roles, EKS cluster, EKS node group, and a few EFS mounts. These are all using the AWS provider, the state in stored in S3. Then in…
5
votes
0 answers

Multiline values in kustomize environment source file

I'm trying to set multiline values (contents of a ca certificate file) to kustomize environment file for a particular key as displayed in the code below. Is there a way to achieve this? Note: Adding quotes to the value in some_params.env isn't…
Krishna D
  • 81
  • 1
  • 6
4
votes
0 answers

How to duplicate base object in an overlay with kustomize?

I have a base object (custom resource) that I need multiple times with a different name and one property added (or changed). So I have defined a base yaml file and referenced it in the overlay kustomization.yaml. ├── base │ ├──…
kampfmoehre
  • 334
  • 2
  • 11
4
votes
2 answers

Add registry prefix to all images with kustomize image transformer

A common requirement when deploying Kubernetes manifests to a cluster is to prefix the container names with a trusted registry prefix that mirrors the allowed images. Usually used along with an admission controller. Is there a sensible way to do…
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
4
votes
0 answers

List all container images in a kustomization or yaml manifest list?

When operating a k8s cluster with an admission controller that limits the allowed registries, it's desirable to check manifests to verify they only refer to such images. Is there a well established and correct way to process a Kubernetes manifest…
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
4
votes
1 answer

How to set load restrictor when using kustomize from kubectl?

I am trying to use kustomize from within kubectl. Specifically, I want to know the equivalent kubectl command for: kustomize build --load_restrictor LoadRestrictionsNone config/overlays/dev_mutation | kubectl apply -f - (kustomize properly runs…
Will Beason
  • 3,417
  • 2
  • 28
  • 46
4
votes
2 answers

referring a resource yaml from another directory in kustomization

I have a resource yaml file in a folder structure given below base ---- first.yaml main ---- kustomization.yaml In kustomization.yaml I am referring the first.yaml as resources: ../base/first.yaml But I am getting an error when i do apply of…
Kabilan R
  • 43
  • 1
  • 1
  • 3
4
votes
1 answer

How to make ConfigMapGenerator based config more intelligent

I like configMapGenerator with suffix hashes because it forces redeployment of pod that are consuming particular config. But the diff output after changing config is just delete and create, which is less than ideal. Is there a way to get more…
aisbaa
  • 9,867
  • 6
  • 33
  • 48
4
votes
2 answers

How do you add multiple config files to configMap with kustomize configMapGenerator by using a pattern/regex/...?

Currently I do this: configMapGenerator: - name: sql-config-map files: - "someDirectory/one.sql" - "someDirectory/two.sql" - "someDirectory/three.sql" and I would like to do sth. like this: configMapGenerator: - name:…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
4
votes
1 answer

How to install a specific kustomize version

I am trying to install kustomize v3.2.1 in Mac, but I am getting the following error when I do these steps. wget "https://github.com/kubernetes-sigs/kustomize/archive/refs/tags/kustomize/v3.2.1.tar.gz" Untar the source tar xzf xxxxx.tar.gz cd…
cosmos1905-12
  • 41
  • 1
  • 2
4
votes
1 answer

How to deal with a namespace different from the globally set one?

apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: ns1 resources: - r1a.yaml - r1b.yaml - r1c.yaml - r1d.yaml - r1e.yaml - r2.yaml # needs to be placed in namespace ns2 Let's assume above situation. The problem…
Raffael
  • 19,547
  • 15
  • 82
  • 160
4
votes
1 answer

Kustomize metadata.name for a specific kind:

I'am new to Kustomize, and i would like to know: How to "patch" metadata.name in a specific yaml like kind: RedisInstance. I have tried to set a nameSuffix to a specific yaml (kind: RedisInstance), but it didn't…
Canna
  • 92
  • 1
  • 2
  • 8
4
votes
1 answer

Need advice on helm charts vs manifests based deployments

In my current job we are running multiple k8s cluster and allowing multiple teams to run services in the cluster. Each service/git repo will have kustomize file, which has list of all patches. During the CD phase, we are converting this kustomize to…
cloudbud
  • 2,948
  • 5
  • 28
  • 54
4
votes
1 answer

I have 2 kustomization overlays that call the same configuration. I need to have two kustomization.yaml files in the same folder

overlays -----> configuration1 ----> kustomization.yaml | |----> configuration2 ----> kustomization.yaml resources ------> kustomization.yaml # in file resources/kustomization.yaml # for configuration1 resources: -…
Stormy Weather
  • 295
  • 1
  • 4
  • 12