Skip to content

Commit a02c705

Browse files
committed
chore(addon): update postgresql
1 parent c4851cb commit a02c705

15 files changed

Lines changed: 133 additions & 103 deletions

File tree

addons/postgresql-1.1.0/chart/postgresql/templates/primary/statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ spec:
400400
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.primary.startupProbe "enabled") "context" $) | nindent 12 }}
401401
exec:
402402
command:
403+
- init-stack
403404
- /bin/sh
404405
- -c
405406
{{- if (include "postgresql.database" .) }}
@@ -414,6 +415,7 @@ spec:
414415
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.primary.livenessProbe "enabled") "context" $) | nindent 12 }}
415416
exec:
416417
command:
418+
- init-stack
417419
- /bin/sh
418420
- -c
419421
{{- if (include "postgresql.database" .) }}
@@ -428,6 +430,7 @@ spec:
428430
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.primary.readinessProbe "enabled") "context" $) | nindent 12 }}
429431
exec:
430432
command:
433+
- init-stack
431434
- /bin/sh
432435
- -c
433436
- -e

addons/postgresql-1.1.0/chart/postgresql/templates/read/statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ spec:
323323
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.startupProbe "enabled") "context" $) | nindent 12 }}
324324
exec:
325325
command:
326+
- init-stack
326327
- /bin/sh
327328
- -c
328329
{{- if (include "postgresql.database" .) }}
@@ -337,6 +338,7 @@ spec:
337338
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.livenessProbe "enabled") "context" $) | nindent 12 }}
338339
exec:
339340
command:
341+
- init-stack
340342
- /bin/sh
341343
- -c
342344
{{- if (include "postgresql.database" .) }}
@@ -351,6 +353,7 @@ spec:
351353
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.readinessProbe "enabled") "context" $) | nindent 12 }}
352354
exec:
353355
command:
356+
- init-stack
354357
- /bin/sh
355358
- -c
356359
- -e

addons/postgresql-1.1.0/chart/postgresql/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ ldap:
218218
postgresqlDataDir: /drycc/postgresql/data
219219
## @param postgresqlSharedPreloadLibraries Shared preload libraries (comma-separated list)
220220
##
221-
postgresqlSharedPreloadLibraries: "pgaudit"
221+
# postgresqlSharedPreloadLibraries: "pgaudit" # todo add pgaudit
222222
## Start PostgreSQL pod(s) without limitations on shm memory.
223223
## By default docker and containerd (and possibly other container runtimes) limit `/dev/shm` to `64M`
224224
## ref: https://github.com/docker-library/postgres/issues/416

addons/postgresql-1.1.0/plans/standard-1024/bind.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,50 @@ credential:
22
- name: HOST
33
valueFrom:
44
serviceRef:
5-
name: {{ template "postgresql.fullname" . }}
5+
name: {{ template "postgresql.primary.fullname" . }}
66
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
77

88
- name: PORT
9-
valueFrom:
9+
valueFrom:
1010
serviceRef:
11-
name: {{ template "postgresql.fullname" . }}
11+
name: {{ template "postgresql.primary.fullname" . }}
1212
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
1313

14+
{{- if not (empty (include "postgresql.username" .)) }}
1415
- name: USERNAME
15-
value: {{ .Values.postgresqlUsername }}
16+
value: {{ template "postgresql.username" . }}
17+
{{- end }}
1618

1719
- name: PASSWORD
1820
valueFrom:
1921
secretKeyRef:
20-
name: {{ template "postgresql.fullname" . }}
21-
jsonpath: '{ .data.postgresql-password }'
22+
name: {{ template "common.names.fullname" . }}
23+
jsonpath: '{ .data.postgres-password }'
24+
25+
{{- if (include "postgresql.database" .) }}
26+
- name: DATABASE
27+
value: {{ template "postgresql.database" . }}
28+
{{- end }}
2229

23-
{{- if .Values.replication.enabled }}
30+
{{- if eq .Values.architecture "replication" }}
2431
- name: READHOST
2532
valueFrom:
2633
serviceRef:
27-
name: {{ template "postgresql.fullname" . }}-read
34+
name: {{ template "postgresql.readReplica.fullname" . }}
2835
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
2936

3037
- name: READPORT
3138
valueFrom:
3239
serviceRef:
33-
name: {{ template "postgresql.fullname" . }}-read
40+
name: {{ template "postgresql.readReplica.fullname" . }}
3441
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
3542

3643
- name: REPLICATIONUSERNAME
37-
value: {{ template "postgresql.replication.username" . }}
44+
value: {{ .Values.auth.replicationUsername }}
3845

3946
- name: REPLICATIONPASSWORD
4047
valueFrom:
4148
secretKeyRef:
42-
name: {{ template "postgresql.fullname" . }}
43-
jsonpath: '{ .data.postgresql-replication-password }'
44-
{{- end }}
45-
46-
{{- if .Values.postgresqlDatabase }}
47-
- name: DATABASE
48-
value: {{ .Values.postgresqlDatabase }}
49+
name: {{ template "common.names.fullname" . }}
50+
jsonpath: '{ .data.replication-password }'
4951
{{- end }}

addons/postgresql-1.1.0/plans/standard-1024/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ primary:
2222
limits:
2323
cpu: 16000m
2424
memory: 64Gi
25+
hugepages-2Mi: 256Mi
2526
requests:
2627
cpu: 1600m
2728
memory: 32Gi
@@ -42,6 +43,7 @@ readReplicas:
4243
limits:
4344
cpu: 16000m
4445
memory: 64Gi
46+
hugepages-2Mi: 256Mi
4547
requests:
4648
cpu: 1600m
4749
memory: 32Gi

addons/postgresql-1.1.0/plans/standard-16/bind.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,50 @@ credential:
22
- name: HOST
33
valueFrom:
44
serviceRef:
5-
name: {{ template "postgresql.fullname" . }}
5+
name: {{ template "postgresql.primary.fullname" . }}
66
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
77

88
- name: PORT
9-
valueFrom:
9+
valueFrom:
1010
serviceRef:
11-
name: {{ template "postgresql.fullname" . }}
11+
name: {{ template "postgresql.primary.fullname" . }}
1212
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
1313

14+
{{- if not (empty (include "postgresql.username" .)) }}
1415
- name: USERNAME
15-
value: {{ .Values.postgresqlUsername }}
16+
value: {{ template "postgresql.username" . }}
17+
{{- end }}
1618

1719
- name: PASSWORD
1820
valueFrom:
1921
secretKeyRef:
20-
name: {{ template "postgresql.fullname" . }}
21-
jsonpath: '{ .data.postgresql-password }'
22+
name: {{ template "common.names.fullname" . }}
23+
jsonpath: '{ .data.postgres-password }'
24+
25+
{{- if (include "postgresql.database" .) }}
26+
- name: DATABASE
27+
value: {{ template "postgresql.database" . }}
28+
{{- end }}
2229

23-
{{- if .Values.replication.enabled }}
30+
{{- if eq .Values.architecture "replication" }}
2431
- name: READHOST
2532
valueFrom:
2633
serviceRef:
27-
name: {{ template "postgresql.fullname" . }}-read
34+
name: {{ template "postgresql.readReplica.fullname" . }}
2835
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
2936

3037
- name: READPORT
3138
valueFrom:
3239
serviceRef:
33-
name: {{ template "postgresql.fullname" . }}-read
40+
name: {{ template "postgresql.readReplica.fullname" . }}
3441
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
3542

3643
- name: REPLICATIONUSERNAME
37-
value: {{ template "postgresql.replication.username" . }}
44+
value: {{ .Values.auth.replicationUsername }}
3845

3946
- name: REPLICATIONPASSWORD
4047
valueFrom:
4148
secretKeyRef:
42-
name: {{ template "postgresql.fullname" . }}
43-
jsonpath: '{ .data.postgresql-replication-password }'
44-
{{- end }}
45-
46-
{{- if .Values.postgresqlDatabase }}
47-
- name: DATABASE
48-
value: {{ .Values.postgresqlDatabase }}
49+
name: {{ template "common.names.fullname" . }}
50+
jsonpath: '{ .data.replication-password }'
4951
{{- end }}

addons/postgresql-1.1.0/plans/standard-16/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ primary:
2222
limits:
2323
cpu: 1000m
2424
memory: 1024Mi
25+
hugepages-2Mi: 256Mi
2526
requests:
2627
cpu: 100m
2728
memory: 512Mi
@@ -42,6 +43,7 @@ readReplicas:
4243
limits:
4344
cpu: 1000m
4445
memory: 1024Mi
46+
hugepages-2Mi: 256Mi
4547
requests:
4648
cpu: 100m
4749
memory: 512Mi

addons/postgresql-1.1.0/plans/standard-256/bind.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,50 @@ credential:
22
- name: HOST
33
valueFrom:
44
serviceRef:
5-
name: {{ template "postgresql.fullname" . }}
5+
name: {{ template "postgresql.primary.fullname" . }}
66
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
77

88
- name: PORT
9-
valueFrom:
9+
valueFrom:
1010
serviceRef:
11-
name: {{ template "postgresql.fullname" . }}
11+
name: {{ template "postgresql.primary.fullname" . }}
1212
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
1313

14+
{{- if not (empty (include "postgresql.username" .)) }}
1415
- name: USERNAME
15-
value: {{ .Values.postgresqlUsername }}
16+
value: {{ template "postgresql.username" . }}
17+
{{- end }}
1618

1719
- name: PASSWORD
1820
valueFrom:
1921
secretKeyRef:
20-
name: {{ template "postgresql.fullname" . }}
21-
jsonpath: '{ .data.postgresql-password }'
22+
name: {{ template "common.names.fullname" . }}
23+
jsonpath: '{ .data.postgres-password }'
24+
25+
{{- if (include "postgresql.database" .) }}
26+
- name: DATABASE
27+
value: {{ template "postgresql.database" . }}
28+
{{- end }}
2229

23-
{{- if .Values.replication.enabled }}
30+
{{- if eq .Values.architecture "replication" }}
2431
- name: READHOST
2532
valueFrom:
2633
serviceRef:
27-
name: {{ template "postgresql.fullname" . }}-read
34+
name: {{ template "postgresql.readReplica.fullname" . }}
2835
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
2936

3037
- name: READPORT
3138
valueFrom:
3239
serviceRef:
33-
name: {{ template "postgresql.fullname" . }}-read
40+
name: {{ template "postgresql.readReplica.fullname" . }}
3441
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
3542

3643
- name: REPLICATIONUSERNAME
37-
value: {{ template "postgresql.replication.username" . }}
44+
value: {{ .Values.auth.replicationUsername }}
3845

3946
- name: REPLICATIONPASSWORD
4047
valueFrom:
4148
secretKeyRef:
42-
name: {{ template "postgresql.fullname" . }}
43-
jsonpath: '{ .data.postgresql-replication-password }'
44-
{{- end }}
45-
46-
{{- if .Values.postgresqlDatabase }}
47-
- name: DATABASE
48-
value: {{ .Values.postgresqlDatabase }}
49+
name: {{ template "common.names.fullname" . }}
50+
jsonpath: '{ .data.replication-password }'
4951
{{- end }}

addons/postgresql-1.1.0/plans/standard-256/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ primary:
2222
limits:
2323
cpu: 2000m
2424
memory: 8Gi
25+
hugepages-2Mi: 256Mi
2526
requests:
2627
cpu: 200m
2728
memory: 4Gi
@@ -42,6 +43,7 @@ readReplicas:
4243
limits:
4344
cpu: 2000m
4445
memory: 8Gi
46+
hugepages-2Mi: 256Mi
4547
requests:
4648
cpu: 200m
4749
memory: 4Gi

addons/postgresql-1.1.0/plans/standard-512/bind.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,50 @@ credential:
22
- name: HOST
33
valueFrom:
44
serviceRef:
5-
name: {{ template "postgresql.fullname" . }}
5+
name: {{ template "postgresql.primary.fullname" . }}
66
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
77

88
- name: PORT
9-
valueFrom:
9+
valueFrom:
1010
serviceRef:
11-
name: {{ template "postgresql.fullname" . }}
11+
name: {{ template "postgresql.primary.fullname" . }}
1212
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
1313

14+
{{- if not (empty (include "postgresql.username" .)) }}
1415
- name: USERNAME
15-
value: {{ .Values.postgresqlUsername }}
16+
value: {{ template "postgresql.username" . }}
17+
{{- end }}
1618

1719
- name: PASSWORD
1820
valueFrom:
1921
secretKeyRef:
20-
name: {{ template "postgresql.fullname" . }}
21-
jsonpath: '{ .data.postgresql-password }'
22+
name: {{ template "common.names.fullname" . }}
23+
jsonpath: '{ .data.postgres-password }'
24+
25+
{{- if (include "postgresql.database" .) }}
26+
- name: DATABASE
27+
value: {{ template "postgresql.database" . }}
28+
{{- end }}
2229

23-
{{- if .Values.replication.enabled }}
30+
{{- if eq .Values.architecture "replication" }}
2431
- name: READHOST
2532
valueFrom:
2633
serviceRef:
27-
name: {{ template "postgresql.fullname" . }}-read
34+
name: {{ template "postgresql.readReplica.fullname" . }}
2835
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
2936

3037
- name: READPORT
3138
valueFrom:
3239
serviceRef:
33-
name: {{ template "postgresql.fullname" . }}-read
40+
name: {{ template "postgresql.readReplica.fullname" . }}
3441
jsonpath: '{ .spec.ports[?(@.name=="tcp-postgresql")].port }'
3542

3643
- name: REPLICATIONUSERNAME
37-
value: {{ template "postgresql.replication.username" . }}
44+
value: {{ .Values.auth.replicationUsername }}
3845

3946
- name: REPLICATIONPASSWORD
4047
valueFrom:
4148
secretKeyRef:
42-
name: {{ template "postgresql.fullname" . }}
43-
jsonpath: '{ .data.postgresql-replication-password }'
44-
{{- end }}
45-
46-
{{- if .Values.postgresqlDatabase }}
47-
- name: DATABASE
48-
value: {{ .Values.postgresqlDatabase }}
49+
name: {{ template "common.names.fullname" . }}
50+
jsonpath: '{ .data.replication-password }'
4951
{{- end }}

0 commit comments

Comments
 (0)