File tree 14 files changed +1498
-334
lines changed
14 files changed +1498
-334
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ dependencies:
11
11
version : v1.16.2
12
12
repository : https://charts.jetstack.io
13
13
- name : cloudnative-pg
14
- version : 0.22.1
14
+ version : 0.23.0
15
15
repository : https://cloudnative-pg.github.io/charts
16
16
- name : external-dns
17
17
version : 6.20.4
Original file line number Diff line number Diff line change 1
1
apiVersion : v2
2
- appVersion : 1.24.1
2
+ appVersion : 1.25.0
3
3
dependencies :
4
4
- alias : monitoring
5
5
condition : monitoring.grafanaDashboard.create
@@ -22,4 +22,4 @@ name: cloudnative-pg
22
22
sources :
23
23
- https://github.com/cloudnative-pg/charts
24
24
type : application
25
- version : 0.22.1
25
+ version : 0.23.0
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
1
2
2
CloudNativePG operator should be installed in namespace "{{ .Release.Namespace }}".
3
- You can now create a PostgreSQL cluster with 3 nodes in the current namespace as follows:
3
+ You can now create a PostgreSQL cluster with 3 nodes as follows:
4
4
5
5
cat <<EOF | kubectl apply -f -
6
6
# Example of PostgreSQL cluster
7
7
apiVersion: postgresql.cnpg.io/v1
8
8
kind: Cluster
9
9
metadata:
10
10
name: cluster-example
11
+ {{if not .Values.config.clusterWide -}}
12
+ namespace: {{ .Release.Namespace }}
13
+ {{- end }}
11
14
spec:
12
15
instances: 3
13
16
storage:
14
17
size: 1Gi
15
18
EOF
16
19
17
- kubectl get cluster
20
+ kubectl get -A cluster
18
21
Original file line number Diff line number Diff line change
1
+ { {/*
2
+ Allow the release namespace to be overridden for multi-namespace deployments in combined charts
3
+ */} }
4
+ { {- define " cloudnative-pg.namespace" -} }
5
+ { {- if .Values.namespaceOverride -} }
6
+ { {- .Values.namespaceOverride -} }
7
+ { {- else -} }
8
+ { {- .Release.Namespace -} }
9
+ { {- end -} }
10
+ { {- end -} }
11
+
1
12
{ {/*
2
13
Expand the name of the chart.
3
14
*/} }
@@ -60,3 +71,231 @@ Create the name of the service account to use
60
71
{ {- default " default" .Values.serviceAccount.name } }
61
72
{ {- end } }
62
73
{ {- end } }
74
+
75
+ { {/*
76
+ Define the common set of rules that can be applied either with
77
+ namespace scope or clusterwide
78
+ */} }
79
+ { {- define " cloudnative-pg.commonRules" } }
80
+ - apiGroups:
81
+ - ""
82
+ resources:
83
+ - configmaps
84
+ - secrets
85
+ - services
86
+ verbs:
87
+ - create
88
+ - delete
89
+ - get
90
+ - list
91
+ - patch
92
+ - update
93
+ - watch
94
+ - apiGroups:
95
+ - ""
96
+ resources:
97
+ - configmaps/status
98
+ - secrets/status
99
+ verbs:
100
+ - get
101
+ - patch
102
+ - update
103
+ - apiGroups:
104
+ - ""
105
+ resources:
106
+ - events
107
+ verbs:
108
+ - create
109
+ - patch
110
+ - apiGroups:
111
+ - ""
112
+ resources:
113
+ - persistentvolumeclaims
114
+ - pods
115
+ - pods/exec
116
+ verbs:
117
+ - create
118
+ - delete
119
+ - get
120
+ - list
121
+ - patch
122
+ - watch
123
+ - apiGroups:
124
+ - ""
125
+ resources:
126
+ - pods/status
127
+ verbs:
128
+ - get
129
+ - apiGroups:
130
+ - ""
131
+ resources:
132
+ - serviceaccounts
133
+ verbs:
134
+ - create
135
+ - get
136
+ - list
137
+ - patch
138
+ - update
139
+ - watch
140
+ - apiGroups:
141
+ - apps
142
+ resources:
143
+ - deployments
144
+ verbs:
145
+ - create
146
+ - delete
147
+ - get
148
+ - list
149
+ - patch
150
+ - update
151
+ - watch
152
+ - apiGroups:
153
+ - batch
154
+ resources:
155
+ - jobs
156
+ verbs:
157
+ - create
158
+ - delete
159
+ - get
160
+ - list
161
+ - patch
162
+ - watch
163
+ - apiGroups:
164
+ - coordination.k8s.io
165
+ resources:
166
+ - leases
167
+ verbs:
168
+ - create
169
+ - get
170
+ - update
171
+ - apiGroups:
172
+ - monitoring.coreos.com
173
+ resources:
174
+ - podmonitors
175
+ verbs:
176
+ - create
177
+ - delete
178
+ - get
179
+ - list
180
+ - patch
181
+ - watch
182
+ - apiGroups:
183
+ - policy
184
+ resources:
185
+ - poddisruptionbudgets
186
+ verbs:
187
+ - create
188
+ - delete
189
+ - get
190
+ - list
191
+ - patch
192
+ - update
193
+ - watch
194
+ - apiGroups:
195
+ - postgresql.cnpg.io
196
+ resources:
197
+ - backups
198
+ - clusters
199
+ - databases
200
+ - poolers
201
+ - publications
202
+ - scheduledbackups
203
+ - subscriptions
204
+ verbs:
205
+ - create
206
+ - delete
207
+ - get
208
+ - list
209
+ - patch
210
+ - update
211
+ - watch
212
+ - apiGroups:
213
+ - postgresql.cnpg.io
214
+ resources:
215
+ - backups/status
216
+ - databases/status
217
+ - publications/status
218
+ - scheduledbackups/status
219
+ - subscriptions/status
220
+ verbs:
221
+ - get
222
+ - patch
223
+ - update
224
+ - apiGroups:
225
+ - postgresql.cnpg.io
226
+ resources:
227
+ - imagecatalogs
228
+ verbs:
229
+ - get
230
+ - list
231
+ - watch
232
+ - apiGroups:
233
+ - postgresql.cnpg.io
234
+ resources:
235
+ - clusters/finalizers
236
+ - poolers/finalizers
237
+ verbs:
238
+ - update
239
+ - apiGroups:
240
+ - postgresql.cnpg.io
241
+ resources:
242
+ - clusters/status
243
+ - poolers/status
244
+ verbs:
245
+ - get
246
+ - patch
247
+ - update
248
+ - watch
249
+ - apiGroups:
250
+ - rbac.authorization.k8s.io
251
+ resources:
252
+ - rolebindings
253
+ - roles
254
+ verbs:
255
+ - create
256
+ - get
257
+ - list
258
+ - patch
259
+ - update
260
+ - watch
261
+ - apiGroups:
262
+ - snapshot.storage.k8s.io
263
+ resources:
264
+ - volumesnapshots
265
+ verbs:
266
+ - create
267
+ - get
268
+ - list
269
+ - patch
270
+ - watch
271
+ { {- end } }
272
+
273
+ { {/*
274
+ Define the set of rules that must be applied clusterwide
275
+ */} }
276
+ { {- define " cloudnative-pg.clusterwideRules" } }
277
+ - apiGroups:
278
+ - ""
279
+ resources:
280
+ - nodes
281
+ verbs:
282
+ - get
283
+ - list
284
+ - watch
285
+ - apiGroups:
286
+ - admissionregistration.k8s.io
287
+ resources:
288
+ - mutatingwebhookconfigurations
289
+ - validatingwebhookconfigurations
290
+ verbs:
291
+ - get
292
+ - patch
293
+ - apiGroups:
294
+ - postgresql.cnpg.io
295
+ resources:
296
+ - clusterimagecatalogs
297
+ verbs:
298
+ - get
299
+ - list
300
+ - watch
301
+ { {- end } }
Original file line number Diff line number Diff line change @@ -19,14 +19,21 @@ apiVersion: v1
19
19
kind : ConfigMap
20
20
metadata :
21
21
name : {{ .Values.config.name }}
22
+ namespace : {{ include "cloudnative-pg.namespace" . }}
22
23
labels :
23
24
{{- include "cloudnative-pg.labels" . | nindent 4 }}
24
25
{{- with .Values.commonAnnotations }}
25
26
annotations :
26
27
{{- toYaml . | nindent 4 }}
27
28
{{- end }}
28
29
data :
30
+ {{- if .Values.config.clusterWide -}}
29
31
{{- toYaml .Values.config.data | nindent 2 }}
32
+ {{- else -}}
33
+ {{- $watchNamespaceMap := dict "WATCH_NAMESPACE" .Release.Namespace -}}
34
+ {{- $fullConfiguration := merge .Values.config.data $watchNamespaceMap -}}
35
+ {{- toYaml $fullConfiguration | nindent 2 }}
36
+ {{- end -}}
30
37
{{- else }}
31
38
apiVersion : v1
32
39
kind : Secret
@@ -40,6 +47,12 @@ metadata:
40
47
{{- toYaml . | nindent 4 }}
41
48
{{- end }}
42
49
stringData :
50
+ {{- if .Values.config.clusterWide -}}
43
51
{{- toYaml .Values.config.data | nindent 2 }}
52
+ {{- else -}}
53
+ {{- $watchNamespaceMap := dict "WATCH_NAMESPACE" .Release.Namespace -}}
54
+ {{- $fullConfiguration := merge .Values.config.data $watchNamespaceMap -}}
55
+ {{- toYaml $fullConfiguration | nindent 2 }}
56
+ {{- end -}}
44
57
{{- end }}
45
58
{{- end }}
You can’t perform that action at this time.
0 commit comments