diff --git a/templates/database/statefulset.yaml b/templates/database/statefulset.yaml index c6f3c22..fc931ef 100644 --- a/templates/database/statefulset.yaml +++ b/templates/database/statefulset.yaml @@ -42,20 +42,26 @@ spec: {{- end }} image: {{ printf "%s:%s" (default "database" .internal.image.repository) ((default "16" .internal.image.tag) | toString) }} imagePullPolicy: {{ $.Values.image.pullPolicy }} + {{- with .internal.livenessProbe }} livenessProbe: - exec: - command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"] + {{- toYaml . | nindent 10 }} + {{- end }} ports: - name: database containerPort: {{ default "5432" .config.port }} protocol: TCP + {{- with .internal.readinessProbe }} readinessProbe: - exec: - command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"] + {{- toYaml . | nindent 10 }} + {{- end }} {{- with .internal.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} + {{- with .internal.startupProbe }} + startupProbe: + {{- toYaml . | nindent 10 }} + {{- end }} volumeMounts: - mountPath: /var/lib/postgresql/data name: {{ include "liferay.fullname" $ }}-database-pvc diff --git a/templates/objectstorage/statefulset.yaml b/templates/objectstorage/statefulset.yaml index 7885134..f483f17 100644 --- a/templates/objectstorage/statefulset.yaml +++ b/templates/objectstorage/statefulset.yaml @@ -70,16 +70,10 @@ spec: {{- end }} image: {{ printf "%s:%s" (default "bitnami/minio" .internal.image.repository) ((default "2024" .internal.image.tag) | toString) }} imagePullPolicy: {{ $.Values.image.pullPolicy }} + {{- with .internal.livenessProbe }} livenessProbe: - httpGet: - path: /minio/health/live - port: {{ default "9000" .config.ports.api }} - scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 10 - successThreshold: 1 - failureThreshold: 3 + {{- toYaml . | nindent 10 }} + {{- end }} ports: - name: api containerPort: {{ default "9000" .config.ports.api }} @@ -87,20 +81,18 @@ spec: - name: console containerPort: {{ default "9001" .config.ports.console }} protocol: TCP + {{- with .internal.readinessProbe }} readinessProbe: - httpGet: - path: /minio/health/ready - port: {{ default "9000" .config.ports.api }} - scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 10 - successThreshold: 1 - failureThreshold: 3 + {{- toYaml . | nindent 10 }} + {{- end }} {{- with .internal.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} + {{- with .internal.startupProbe }} + startupProbe: + {{- toYaml . | nindent 10 }} + {{- end }} volumeMounts: - mountPath: /tmp name: {{ include "liferay.fullname" $ }}-objectstorage-pvc diff --git a/templates/search/statefulset.yaml b/templates/search/statefulset.yaml index 800f609..86dab25 100644 --- a/templates/search/statefulset.yaml +++ b/templates/search/statefulset.yaml @@ -46,20 +46,26 @@ spec: {{- end }} image: {{ printf "%s:%s" (default "search" .internal.image.repository) ((default "8.17.0" .internal.image.tag) | toString) }} imagePullPolicy: {{ $.Values.image.pullPolicy }} + {{- with .internal.livenessProbe }} livenessProbe: - tcpSocket: - port: search + {{- toYaml . | nindent 10 }} + {{- end }} ports: - name: search containerPort: {{ default "9200" .config.port }} protocol: TCP + {{- with .internal.readinessProbe }} readinessProbe: - tcpSocket: - port: search + {{- toYaml . | nindent 10 }} + {{- end }} {{- with .internal.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} + {{- with .internal.startupProbe }} + startupProbe: + {{- toYaml . | nindent 10 }} + {{- end }} volumeMounts: - mountPath: /usr/share/elasticsearch/config name: {{ include "liferay.fullname" $ }}-search-pvc diff --git a/templates/statefulset.yaml b/templates/statefulset.yaml index 8636b28..9282cce 100644 --- a/templates/statefulset.yaml +++ b/templates/statefulset.yaml @@ -68,6 +68,10 @@ spec: readinessProbe: {{- toYaml . | nindent 10 }} {{- end }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{- end }} securityContext: capabilities: drop: @@ -77,10 +81,6 @@ spec: startupProbe: {{- toYaml . | nindent 10 }} {{- end }} - {{- with .Values.resources }} - resources: - {{- toYaml . | nindent 10 }} - {{- end }} volumeMounts: # Mounts for liferay working directories allowing the # container's root file system to remain readonly. diff --git a/values.yaml b/values.yaml index 0af5646..accfdf4 100644 --- a/values.yaml +++ b/values.yaml @@ -116,6 +116,16 @@ database: # See: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ initContainers: {} + livenessProbe: + exec: + command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"] + readinessProbe: + exec: + command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"] + startupProbe: + exec: + command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"] + # Set the number of database replicas (0 or 1 for now) replicaCount: 1 @@ -171,6 +181,16 @@ search: # See: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ initContainers: {} + livenessProbe: + tcpSocket: + port: search + readinessProbe: + tcpSocket: + port: search + startupProbe: + tcpSocket: + port: search + # Set the number of search replicas (0 or 1 for now) replicaCount: 1 @@ -224,6 +244,22 @@ objectstorage: # See: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ initContainers: {} + livenessProbe: + httpGet: + path: /minio/health/live + port: api + scheme: HTTP + readinessProbe: + httpGet: + path: /minio/health/ready + port: api + scheme: HTTP + startupProbe: + httpGet: + path: /minio/health/ready + port: api + scheme: HTTP + # Set the number of objectstorage replicas (0 or 1 for now) replicaCount: 1