@@ -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
+ | commonLabels: | | apiVersion: apps/v1 | | apiVersion: v1 |
78
+ | app: myapp | | kind: Deployment | | kind: Service |
79
+ | resources: | | metadata: | | metadata: |
80
+ | - deployment.yaml | | name: myapp | | name: myapp |
81
+ | - service.yaml | | spec: | | spec: |
82
+ | configMapGenerator: | | selector: | | selector: |
83
+ | - name: myapp-map | | matchLabels: | | app: myapp |
84
+ | files: | | app: myapp | | ports: |
85
+ | - env.startup.txt | | template: | | - port: <Port> |
86
+ +-------------------------------+ | metadata: | | targetPort: <Target Port> |
87
+ | labels: | +-----------------------------------+
88
+ | app: myapp |
89
+ | spec: |
90
+ | containers: |
91
+ | - name: myapp |
92
+ | image: <Image> |
93
+ | resources: |
94
+ | limits: |
95
+ | memory: "128Mi" |
96
+ | cpu: "500m" |
97
+ | ports: |
98
+ | - containerPort: <Port> |
99
+ +-------------------------------------------------------+
100
+
101
+ ```
67
102
68
103
File structure:
69
104
@@ -99,20 +134,47 @@ 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 + more resources
140
+
141
+ kustomization.yaml replica_count.yaml cpu_count.yaml
142
+ +---------------------------------------+ +-------------------------------+ +------------------------------------------+
143
+ | commonLabels: | | apiVersion: apps/v1 | | apiVersion: apps/v1 |
144
+ | app: myapp | | kind: Deployment | | kind: Deployment |
145
+ | resources: | | metadata: | | metadata: |
146
+ | - ../../base | | name: myapp | | name: myapp |
147
+ | patches: | | spec: | | spec: |
148
+ | - path: replica_count.yaml | | selector: | | selector: |
149
+ | - path: cpu_count.yaml | | matchLabels: | | matchLabels: |
150
+ | | | app: myapp | | app: myapp |
151
+ | | | template: | | template: |
152
+ | | | metadata: | | metadata: |
153
+ | | | labels: | | labels: |
154
+ | | | app: myapp | | app: myapp |
155
+ | | | spec: | | spec: |
156
+ | | | replicas: 80 | | containers: |
157
+ | | | | | - name: myapp |
158
+ | | | | | resources: |
159
+ | | | | | limits: |
160
+ | | | | | memory: "128Mi" |
161
+ | | | | | cpu: "7000m" |
162
+ +---------------------------------------+ +-------------------------------+ +------------------------------------------+
163
+ ```
164
+
103
165
104
166
File structure:
105
167
> ```
106
168
> ~/someApp
107
169
> ├── base
108
- > │ ├── deployment.yaml
109
- > │ ├── kustomization.yaml
110
- > │ └── service.yaml
170
+ > │ ├── deployment.yaml
171
+ > │ ├── kustomization.yaml
172
+ > │ └── service.yaml
111
173
> └── overlays
112
174
> ├── development
113
- > │ ├── cpu_count.yaml
114
- > │ ├── kustomization.yaml
115
- > │ └── replica_count.yaml
175
+ > │ ├── cpu_count.yaml
176
+ > │ ├── kustomization.yaml
177
+ > │ └── replica_count.yaml
116
178
> └── production
117
179
> ├── cpu_count.yaml
118
180
> ├── kustomization.yaml
0 commit comments