Kubernetes/kustomize: Difference between revisions

From Omnia
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 4: Line 4:
  https://kubernetes.io/docs/reference/kubectl/generated/kubectl_kustomize/
  https://kubernetes.io/docs/reference/kubectl/generated/kubectl_kustomize/


Generate manifest
  kubectl kustomize DIR [flags]
  kubectl kustomize DIR [flags]
# or
kustomize build DIR [flags]


== kustomization.yaml ==
# then do a " > out.yaml " to save


<pre>
Install manifest:
  # Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml
kubectl apply -f out.yaml
  kubectl apply -k dir/
 
</pre>
or Install manifest directly:
# Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml
kubectl apply -k DIR
 
== Installation ==
 
Installation
Kustomize Installation
https://kubectl.docs.kubernetes.io/installation/kustomize/
 
Via Go source: <ref>https://kubectl.docs.kubernetes.io/installation/kustomize/source/</ref>
git clone git@github.com:kubernetes-sigs/kustomize.git
cd kustomize
make kustomize
# git checkout kustomize/v5.0.0
~/go/bin/kustomize version
 
Via binary: <ref>https://kubectl.docs.kubernetes.io/installation/kustomize/binaries/</ref>
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
mv kustomize /usr/local/bin/kustomize
 
Version:
kustomize version
  v5.4.2


== Kustomize ==
== Kustomize ==
Line 19: Line 45:


  Kustomize introduces a template-free way to customize application configuration that simplifies the use of off-the-shelf applications. Now, built into kubectl as apply -k.
  Kustomize introduces a template-free way to customize application configuration that simplifies the use of off-the-shelf applications. Now, built into kubectl as apply -k.
== Hello World ==
Hello World
https://github.com/kubernetes-sigs/kustomize/blob/master/examples/helloWorld/kustomization.yaml
<pre>
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
  name: arbitrary
# Example configuration for the webserver
# at https://github.com/monopole/hello
commonLabels:
  app: hello
resources:
- deployment.yaml
- service.yaml
- configMap.yaml
</pre>


== keywords ==
== keywords ==

Latest revision as of 22:58, 19 June 2024

kustomize

kubectl kustomize | Kubernetes
https://kubernetes.io/docs/reference/kubectl/generated/kubectl_kustomize/

Generate manifest

kubectl kustomize DIR [flags]
# or
kustomize build DIR [flags]
# then do a " > out.yaml " to save

Install manifest:

kubectl apply -f out.yaml

or Install manifest directly:

# Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml
kubectl apply -k DIR

Installation

Installation

Kustomize Installation
https://kubectl.docs.kubernetes.io/installation/kustomize/

Via Go source: [1]

git clone git@github.com:kubernetes-sigs/kustomize.git
cd kustomize
make kustomize
# git checkout kustomize/v5.0.0
~/go/bin/kustomize version

Via binary: [2]

curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
mv kustomize /usr/local/bin/kustomize

Version:

kustomize version
 v5.4.2

Kustomize

Kustomize - Kubernetes native configuration management
https://kustomize.io/
Kustomize introduces a template-free way to customize application configuration that simplifies the use of off-the-shelf applications. Now, built into kubectl as apply -k.

Hello World

Hello World
https://github.com/kubernetes-sigs/kustomize/blob/master/examples/helloWorld/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
  name: arbitrary

# Example configuration for the webserver
# at https://github.com/monopole/hello
commonLabels:
  app: hello

resources:
- deployment.yaml
- service.yaml
- configMap.yaml

keywords