@@ -36,11 +36,16 @@ be updated on a regular basis going forward, and such updates
36
36
will be reflected in the Kubernetes release notes.
37
37
38
38
| Kubectl version | Kustomize version |
39
- | --- | --- |
40
- | < v1.14 | n/a |
41
- | v1.14-v1.20 | v2.0.3 |
42
- | v1.21 | v4.0.5 |
43
- | v1.22 | v4.2.0 |
39
+ | --------------- | ----------------- |
40
+ | < v1.14 | n/a |
41
+ | v1.14-v1.20 | v2.0.3 |
42
+ | v1.21 | v4.0.5 |
43
+ | v1.22 | v4.2.0 |
44
+ | v1.23 | v4.4.1 |
45
+ | v1.24 | v4.5.4 |
46
+ | v1.25 | v4.5.7 |
47
+ | v1.26 | v4.5.7 |
48
+ | v1.27 | v5.0.1 |
44
49
45
50
[ v2.0.3 ] : https://github.com/kubernetes-sigs/kustomize/releases/tag/v2.0.3
46
51
[ #2506 ] : https://github.com/kubernetes-sigs/kustomize/issues/2506
@@ -63,7 +68,37 @@ This file should declare those resources, and any
63
68
customization to apply to them, e.g. _ add a common
64
69
label_ .
65
70
66
- ![ base image] [ imageBase ]
71
+ ```
72
+
73
+ base: kustomization + resources
74
+
75
+ kustomization.yaml deployment.yaml service.yaml
76
+ +---------------------------------------------+ +-------------------------------------------------------+ +-----------------------------------+
77
+ | apiVersion: kustomize.config.k8s.io/v1beta1 | | apiVersion: apps/v1 | | apiVersion: v1 |
78
+ | kind: Kustomization | | kind: Deployment | | kind: Service |
79
+ |.commonLabels: | | metadata: | | metadata: |
80
+ | app: myapp | | name: myapp | | name: myapp |
81
+ | resources: | | spec: | | spec: |
82
+ | - deployment.yaml | | selector: | | selector: |
83
+ | - service.yaml | | matchLabels: | | app: myapp |
84
+ | configMapGenerator: | | app: myapp | | ports: |
85
+ | - name: myapp-map | | template: | | - port: 6060 |
86
+ | literals: | | metadata: | | targetPort: 6060 |
87
+ | - KEY=value | | labels: | +-----------------------------------+
88
+ +---------------------------------------------+ | app: myapp |
89
+ | spec: |
90
+ | containers: |
91
+ | - name: myapp |
92
+ | image: myapp |
93
+ | resources: |
94
+ | limits: |
95
+ | memory: "128Mi" |
96
+ | cpu: "500m" |
97
+ | ports: |
98
+ | - containerPort: 6060 |
99
+ +-------------------------------------------------------+
100
+
101
+ ```
67
102
68
103
File structure:
69
104
@@ -99,20 +134,41 @@ Manage traditional [variants] of a configuration - like
99
134
_development_, _staging_ and _production_ - using
100
135
[overlays] that modify a common [base].
101
136
102
- ![overlay image][imageOverlay]
137
+ ```
138
+
139
+ overlay: kustomization + patches
140
+
141
+ kustomization.yaml replica_count.yaml cpu_count.yaml
142
+ +-----------------------------------------------+ +-------------------------------+ +------------------------------------------+
143
+ | apiVersion: kustomize.config.k8s.io/v1beta1 | | apiVersion: apps/v1 | | apiVersion: apps/v1 |
144
+ | kind: Kustomization | | kind: Deployment | | kind: Deployment |
145
+ | commonLabels: | | metadata: | | metadata: |
146
+ | variant: prod | | name: myapp | | name: myapp |
147
+ | resources: | | spec: | | spec: |
148
+ | - ../../base | | replicas: 80 | | template: |
149
+ | patches: | +-------------------------------+ | spec: |
150
+ | - path: replica_count.yaml | | containers: |
151
+ | - path: cpu_count.yaml | | - name: myapp |
152
+ +-----------------------------------------------+ | resources: |
153
+ | limits: |
154
+ | memory: "128Mi" |
155
+ | cpu: "7000m" |
156
+ +------------------------------------------+
157
+ ```
158
+
103
159
104
160
File structure:
105
161
> ```
106
162
> ~/someApp
107
163
> ├── base
108
- > │ ├── deployment.yaml
109
- > │ ├── kustomization.yaml
110
- > │ └── service.yaml
164
+ > │ ├── deployment.yaml
165
+ > │ ├── kustomization.yaml
166
+ > │ └── service.yaml
111
167
> └── overlays
112
168
> ├── development
113
- > │ ├── cpu_count.yaml
114
- > │ ├── kustomization.yaml
115
- > │ └── replica_count.yaml
169
+ > │ ├── cpu_count.yaml
170
+ > │ ├── kustomization.yaml
171
+ > │ └── replica_count.yaml
116
172
> └── production
117
173
> ├── cpu_count.yaml
118
174
> ├── kustomization.yaml
@@ -166,8 +222,6 @@ is governed by the [Kubernetes Code of Conduct].
166
222
[applied]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#apply
167
223
[base]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#base
168
224
[declarative configuration]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#declarative-application-management
169
- [imageBase]: images/base.jpg
170
- [imageOverlay]: images/overlay.jpg
171
225
[kubectl announcement]: https://kubernetes.io/blog/2019/03/25/kubernetes-1-14-release-announcement
172
226
[kubernetes documentation]: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/
173
227
[kubernetes style]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#kubernetes-style-object
0 commit comments