Skip to content

Commit

Permalink
Merge pull request #47 from rotty3000/LCD-44702
Browse files Browse the repository at this point in the history
LCD-44702 configurable service probes
  • Loading branch information
rotty3000 authored Feb 11, 2025
2 parents d44a830 + 604c298 commit 410a0ad
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 30 deletions.
14 changes: 10 additions & 4 deletions templates/database/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 10 additions & 18 deletions templates/objectstorage/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,37 +70,29 @@ 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 }}
protocol: TCP
- 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
Expand Down
14 changes: 10 additions & 4 deletions templates/search/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ spec:
readinessProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
securityContext:
capabilities:
drop:
Expand All @@ -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.
Expand Down
36 changes: 36 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 410a0ad

Please sign in to comment.