88[ demos ] : demos/README.md
99[ imageBase ] : docs/base.jpg
1010[ imageOverlay ] : docs/overlay.jpg
11- [ installation ] : INSTALL.md
11+ [ install ] : INSTALL.md
1212[ kubernetes style ] : docs/glossary.md#kubernetes-style-object
1313[ kustomization ] : docs/glossary.md#kustomization
1414[ overlay ] : docs/glossary.md#overlay
@@ -35,67 +35,64 @@ and it's like [`sed`], in that it emits editted text.
3535[ ![ Build Status] ( https://travis-ci.org/kubernetes-sigs/kustomize.svg?branch=master )] ( https://travis-ci.org/kubernetes-sigs/kustomize )
3636[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/kubernetes-sigs/kustomize )] ( https://goreportcard.com/report/github.com/kubernetes-sigs/kustomize )
3737
38- ** Installation** :
39- Download a binary from the [ release page] , or
40- see these [ installation] alternatives.
41-
42- Be sure to try one of the tested [ demos] .
38+ ** Installation** : Download a binary from the [ release
39+ page] , or see these [ install] notes. Then try one of
40+ the tested [ demos] .
4341
4442## Usage
4543
4644
47- ### Make a [ base ]
45+ ### 1) Make a [ kustomization ] file
4846
4947In some directory containing your YAML [ resource]
5048files (deployments, services, configmaps, etc.), create a
5149[ kustomization] file.
5250
5351This file should declare those resources, and any
54- common customization to apply to them, e.g. _ add a
55- common label_ .
52+ customization to apply to them, e.g. _ add a common
53+ label_ .
5654
5755![ base image] [ imageBase ]
5856
5957File structure:
6058
6159> ```
62- > ~/yourApp
63- > └── base
64- > ├── deployment.yaml
65- > ├── kustomization.yaml
66- > └── service.yaml
60+ > ~/someApp
61+ > ├── deployment.yaml
62+ > ├── kustomization.yaml
63+ > └── service.yaml
6764> ```
6865
69- This is your [base]. The resources in it could be a
70- fork of someone else's configuration. If so, you can
71- easily rebase from the source material to capture
66+ The resources in this directory could be a fork of
67+ someone else's configuration. If so, you can easily
68+ rebase from the source material to capture
7269improvements, because you don't modify the resources
7370directly.
7471
7572Generate customized YAML with:
7673
7774```
78- kustomize build ~ /yourApp/base
75+ kustomize build ~ /someApp
7976```
8077
8178The YAML can be directly [applied] to a cluster:
8279
8380> ```
84- > kustomize build ~/yourApp/base | kubectl apply -f -
81+ > kustomize build ~/someApp | kubectl apply -f -
8582> ```
8683
8784
88- ### Create [variants] of a common base using [overlays]
85+ ### 2) Create [variants] using [overlays]
8986
90- Manage traditional [variants] of a configuration like
91- _development_, _staging_ and _production_ using
92- [overlays].
87+ Manage traditional [variants] of a configuration - like
88+ _development_, _staging_ and _production_ - using
89+ [overlays] that modify a common [base] .
9390
9491![overlay image][imageOverlay]
9592
9693File structure:
9794> ```
98- > ~/yourApp
95+ > ~/someApp
9996> ├── base
10097> │ ├── deployment.yaml
10198> │ ├── kustomization.yaml
@@ -111,21 +108,32 @@ File structure:
111108> └── replica_count.yaml
112109> ```
113110
114- Store your overlays in your own repository. On disk,
115- the overlay can reference a base in a sibling
116- directory. This avoids trouble with nesting git
117- repositories.
111+ Take the work from step (1) above, move it into a
112+ `someApp` subdirectory called `base`, then
113+ place overlays in a sibling directory.
114+
115+ An overlay is just another kustomization, refering to
116+ the base, and referring to patches to apply to that
117+ base.
118+
119+ This arrangement makes it easy to manage your
120+ configuration with `git`. The base could have files
121+ from an upstream repository managed by someone else.
122+ The overlays could be in a repository you own.
123+ Arranging the repo clones as siblings on disk avoids
124+ the need for git submodules (though that works fine, if
125+ you are a submodule fan).
118126
119127Generate YAML with
120128
121129```
122- kustomize build ~ /yourApp /overlays/production
130+ kustomize build ~ /someApp /overlays/production
123131```
124132
125133The YAML can be directly [applied] to a cluster:
126134
127135> ```
128- > kustomize build ~/yourApp /overlays/production | kubectl apply -f -
136+ > kustomize build ~/someApp /overlays/production | kubectl apply -f -
129137> ```
130138
131139## About
0 commit comments