Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit ba705e8

Browse files
author
Raymond Augé
authored
Merge pull request #45 from rotty3000/main
main
2 parents 875635b + 899af5a commit ba705e8

File tree

5 files changed

+423
-323
lines changed

5 files changed

+423
-323
lines changed

templates/database/statefulset.yaml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,71 @@ spec:
2020
app: {{ $.Chart.Name }}-database
2121
{{- include "liferay.labels" $ | nindent 8 }}
2222
spec:
23+
{{- with .internal.affinity }}
24+
affinity:
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
2327
containers:
2428
- name: {{ $.Chart.Name }}-database
2529
env:
26-
- name: POSTGRES_DB
27-
value: {{ .config.database }}
28-
- name: POSTGRES_PASSWORD
29-
value: {{ .config.password }}
30-
- name: POSTGRES_USER
31-
value: {{ .config.user }}
32-
- name: PGUSER
33-
value: {{ .config.user }}
34-
- name: PGDATA
35-
value: /var/lib/postgresql/data/db
36-
{{- with .internal.env }}
37-
{{- toYaml . | nindent 10 }}
38-
{{- end }}
30+
- name: POSTGRES_DB
31+
value: {{ .config.database }}
32+
- name: POSTGRES_PASSWORD
33+
value: {{ .config.password }}
34+
- name: POSTGRES_USER
35+
value: {{ .config.user }}
36+
- name: PGUSER
37+
value: {{ .config.user }}
38+
- name: PGDATA
39+
value: /var/lib/postgresql/data/db
40+
{{- with .internal.env }}
41+
{{- toYaml . | nindent 8 }}
42+
{{- end }}
3943
image: {{ printf "%s:%s" (default "database" .internal.image.repository) ((default "16" .internal.image.tag) | toString) }}
4044
imagePullPolicy: {{ $.Values.image.pullPolicy }}
4145
livenessProbe:
4246
exec:
43-
command: ["sh", "-c", "pg_isready", "-U", "$POSTGRES_USER"]
47+
command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"]
4448
ports:
4549
- name: database
4650
containerPort: {{ default "5432" .config.port }}
4751
protocol: TCP
4852
readinessProbe:
4953
exec:
50-
command: ["sh", "-c", "pg_isready", "-U", "$POSTGRES_USER"]
54+
command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"]
5155
{{- with .internal.resources }}
5256
resources:
5357
{{- toYaml . | nindent 12 }}
5458
{{- end }}
5559
volumeMounts:
5660
- mountPath: /var/lib/postgresql/data
57-
name: liferay-database-pvc
61+
name: {{ include "liferay.fullname" $ }}-database-pvc
62+
{{- with .internal.imagePullSecrets }}
63+
imagePullSecrets:
64+
{{- toYaml . | nindent 8 }}
65+
{{- end }}
66+
{{- with .internal.initContainers -}}
67+
initContainers:
68+
{{ toYaml . | nindent 6 }}
69+
{{- end }}
70+
{{- with .internal.nodeSelector }}
71+
nodeSelector:
72+
{{- toYaml . | nindent 8 }}
73+
{{- end }}
74+
{{- with .internal.schedulingGates }}
75+
schedulingGates:
76+
{{- toYaml . | nindent 8 }}
77+
{{- end }}
78+
serviceAccountName: {{ include "liferay.serviceAccountName" $ }}
79+
{{- with .internal.tolerations }}
80+
tolerations:
81+
{{- toYaml . | nindent 8 }}
82+
{{- end }}
5883
updateStrategy:
5984
type: RollingUpdate
6085
volumeClaimTemplates:
6186
- metadata:
62-
name: liferay-database-pvc
87+
name: {{ include "liferay.fullname" $ }}-database-pvc
6388
spec:
6489
accessModes: [ "ReadWriteOnce" ]
6590
resources:

templates/objectstorage/statefulset.yaml

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ spec:
2020
app: {{ $.Chart.Name }}-objectstorage
2121
{{- include "liferay.labels" $ | nindent 8 }}
2222
spec:
23-
securityContext:
24-
fsGroup: 1001
25-
fsGroupChangePolicy: "OnRootMismatch"
23+
{{- with .internal.affinity }}
24+
affinity:
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
2627
containers:
2728
- name: {{ $.Chart.Name }}-objectstorage
2829
securityContext:
@@ -39,34 +40,34 @@ spec:
3940
seccompProfile:
4041
type: RuntimeDefault
4142
env:
42-
- name: MINIO_API_PORT_NUMBER
43-
value: {{ default "9000" .config.ports.api | quote }}
44-
{{- range .internal.ingress.hosts }}
45-
{{- $host := .host }}
46-
{{- range .paths }}
47-
{{- if eq .backendServicePortName "console" }}
48-
- name: MINIO_BROWSER_REDIRECT_URL
49-
value: {{ printf "%s://%s/" (default "http" $.Values.objectstorage.config.scheme) $host }}
50-
{{- end }}
51-
{{- end }}
52-
{{- end }}
53-
- name: MINIO_CONSOLE_PORT_NUMBER
54-
value: {{ default "9001" .config.ports.console | quote }}
55-
- name: MINIO_DEFAULT_BUCKETS
56-
value: {{ .config.buckets }}
57-
- name: MINIO_REGION
58-
value: {{ .config.region }}
59-
- name: MINIO_ROOT_PASSWORD
60-
value: {{ .config.password }}
61-
- name: MINIO_ROOT_USER
62-
value: {{ .config.user }}
63-
- name: MINIO_SCHEME
64-
value: {{ default "http" .config.scheme }}
65-
- name: MINIO_SERVER_URL
66-
value: "http://localhost:9000"
67-
{{- with .internal.env }}
68-
{{- toYaml . | nindent 10 }}
69-
{{- end }}
43+
- name: MINIO_API_PORT_NUMBER
44+
value: {{ default "9000" .config.ports.api | quote }}
45+
{{- range .internal.ingress.hosts }}
46+
{{- $host := .host }}
47+
{{- range .paths }}
48+
{{- if eq .backendServicePortName "console" }}
49+
- name: MINIO_BROWSER_REDIRECT_URL
50+
value: {{ printf "%s://%s/" (default "http" $.Values.objectstorage.config.scheme) $host }}
51+
{{- end }}
52+
{{- end }}
53+
{{- end }}
54+
- name: MINIO_CONSOLE_PORT_NUMBER
55+
value: {{ default "9001" .config.ports.console | quote }}
56+
- name: MINIO_DEFAULT_BUCKETS
57+
value: {{ .config.buckets }}
58+
- name: MINIO_REGION
59+
value: {{ .config.region }}
60+
- name: MINIO_ROOT_PASSWORD
61+
value: {{ .config.password }}
62+
- name: MINIO_ROOT_USER
63+
value: {{ .config.user }}
64+
- name: MINIO_SCHEME
65+
value: {{ default "http" .config.scheme }}
66+
- name: MINIO_SERVER_URL
67+
value: "http://localhost:9000"
68+
{{- with .internal.env }}
69+
{{- toYaml . | nindent 8 }}
70+
{{- end }}
7071
image: {{ printf "%s:%s" (default "bitnami/minio" .internal.image.repository) ((default "2024" .internal.image.tag) | toString) }}
7172
imagePullPolicy: {{ $.Values.image.pullPolicy }}
7273
livenessProbe:
@@ -102,22 +103,46 @@ spec:
102103
{{- end }}
103104
volumeMounts:
104105
- mountPath: /tmp
105-
name: liferay-objectstorage-pvc
106+
name: {{ include "liferay.fullname" $ }}-objectstorage-pvc
106107
subPath: tmp-dir
107108
- mountPath: /opt/bitnami/minio/tmp
108-
name: liferay-objectstorage-pvc
109+
name: {{ include "liferay.fullname" $ }}-objectstorage-pvc
109110
subPath: app-tmp-dir
110111
- mountPath: /.mc
111-
name: liferay-objectstorage-pvc
112+
name: {{ include "liferay.fullname" $ }}-objectstorage-pvc
112113
subPath: app-mc-dir
113114
- mountPath: /bitnami/minio/data
114-
name: liferay-objectstorage-pvc
115+
name: {{ include "liferay.fullname" $ }}-objectstorage-pvc
115116
subPath: data-dir
117+
{{- with .internal.imagePullSecrets }}
118+
imagePullSecrets:
119+
{{- toYaml . | nindent 8 }}
120+
{{- end }}
121+
{{- with .internal.initContainers -}}
122+
initContainers:
123+
{{ toYaml . | nindent 6 }}
124+
{{- end }}
125+
{{- with .internal.nodeSelector }}
126+
nodeSelector:
127+
{{- toYaml . | nindent 8 }}
128+
{{- end }}
129+
{{- with .internal.schedulingGates }}
130+
schedulingGates:
131+
{{- toYaml . | nindent 8 }}
132+
{{- end }}
133+
securityContext:
134+
fsGroup: 1001
135+
fsGroupChangePolicy: "OnRootMismatch"
136+
serviceAccountName: {{ include "liferay.serviceAccountName" $ }}
137+
{{- with .internal.tolerations }}
138+
tolerations:
139+
{{- toYaml . | nindent 8 }}
140+
{{- end }}
116141
updateStrategy:
117142
type: RollingUpdate
118143
volumeClaimTemplates:
119144
- metadata:
120-
name: liferay-objectstorage-pvc
145+
name: {{ include "liferay.fullname" $ }}-objectstorage-pvc
121146
spec:
122147
accessModes: [ "ReadWriteOnce" ]
123148
resources:

0 commit comments

Comments
 (0)