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
74
votes
3 answers

What is the difference between Helm and Kustomize?

I have been using the Kubernetes and Helm for a while and have now come across Kustomize for the first time. But what exactly is the difference between Kustomize and Helm? Are both simply different solutions for bundling K8s elements such as…
Datz
  • 3,156
  • 3
  • 22
  • 50
40
votes
1 answer

What is the difference between patches vs patchesJson6902 in Kustomize

Based on the docs that I've read, there are 3 methods of patching: patches patchesStrategicMerge patchesJson6902. The difference between patchesStrategicMerge and patchesJson6902 is obvious. patchesStrategicMerge requires a duplicate structure of…
Alex
  • 1,293
  • 1
  • 13
  • 26
32
votes
3 answers

Exclude Resource in kustomization.yaml

I have a kustomize base that I'd like to re-use without editing it. Unfortunately, it creates a namespace I don't want to create. I'd like to simply remove that resource from consideration when compiling the manifests and add a resource for mine…
Josiah
  • 2,666
  • 5
  • 30
  • 40
25
votes
6 answers

How can I create a namespace with kustomize?

I've a simple project that use kustomize like this: base/ namespace.yaml kustomization.yaml service.yaml With kustomization.yaml is: resources: - namespace.yaml - service.yaml namespace: my_wanted_namespace And namespace.yaml…
Djabx
  • 635
  • 1
  • 8
  • 16
21
votes
3 answers

Kustomize how to replace only the host in Ingress configuration

I've got this ingress.yaml base configuration: apiVersion: extensions/v1beta1 kind: Ingress metadata: labels: sia: aza app: asap-ingress-internal name: asap-ingress-internal annotations: kubernetes.io/ingress.class:…
jmcollin92
  • 2,896
  • 6
  • 27
  • 49
20
votes
2 answers

Kubernetes kustomize command giving error when we specify base manifest files in kustomization.yaml file under resources section

I am trying to build manifest file for specific environment example:- test and I want to re-use base manifest files as mentioned below. k8s/kustomize/overlays/test/kustomization.yaml commonLabels: variant: test app: test-app resources: -…
shivakumar sajjan
  • 447
  • 2
  • 5
  • 11
17
votes
4 answers

How to override a namespace override

In the following scenario I have my containers defined in ../base/. In this /dev/ directory I want to start all the deployments and statefulsets in namespace dev. The rub is that I also want to run the local-path-storage CSI in the…
Dan Garthwaite
  • 3,436
  • 4
  • 22
  • 32
15
votes
1 answer

Can someone explain 'patchesStrategicMerge'

I see patchesStrategicMergein my kustomization.yaml file, but not getting it clearly, like whats its need or why we require that? kustomization.yaml resources: - a.yaml patchesStrategicMerge: - b.yaml - c.yaml I went through this:…
Hari Kishore
  • 2,201
  • 2
  • 19
  • 28
15
votes
4 answers

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

I am new to Kustomize and am getting the following error: Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Kustomization" in version "kustomize.config.k8s.io/v1beta1" but I am using the…
user3877654
  • 1,045
  • 1
  • 16
  • 40
14
votes
1 answer

kubectl apply -k throws Error: rawResources failed to read Resources: Load from path ../../base failed: '../../base' must be a file

Can you please help me figure out why kubectl apply fails? When I try to run kubectl apply -k k8s/overlays/dev it fails with error message "error: rawResources failed to read Resources: Load from path ../../base failed: '../../base' must be a…
11
votes
2 answers

Changing image tags and name with kustomization.yaml

According to the official documentation I should be able to easily override the tags and name of my docker images using some nifty kustomization syntax. I have tried to reproduce this. In my deployment.yaml I have the following: apiVersion:…
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
10
votes
4 answers

How to use dynamic/variable image tag in a Kubernetes deployment?

In our project, which also uses Kustomize, our base deployment.yaml file looks like this: apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app:…
Behrang
  • 46,888
  • 25
  • 118
  • 160
9
votes
3 answers

Selectively apply nameprefix/namesuffix in kustomize

Currently we are using ${HOME}/bin/kustomize edit set nameprefix prefix1 But it is adding nameprefix to all of our resources like deployment.yaml and service.yaml. We want to apply nameprefix to deployment.yaml only and not apply it to service.yaml
coderatcloud9
  • 85
  • 1
  • 1
  • 7
9
votes
3 answers

ArgoCD tracking subdirectories in a specified path

I'm using ArgoCD and I want to track files under different subdirectories. I've setted the path as ./root_directory, but I would like to track also files in the subdirectories of root_directory. For instance /root_directory/dir1,…
Stewe
  • 119
  • 1
  • 1
  • 8
8
votes
1 answer

Patching list in kubernetes manifest with Kustomize

I want to patch (overwrite) list in kubernetes manifest with Kustomize. I am using patchesStrategicMerge method. When I patch the parameters which are not in list the patching works as expected - only addressed parameters in patch.yaml are replaced,…
Artur Ferfecki
  • 148
  • 1
  • 2
  • 15
1
2 3
24 25