feat(deploy): add healthchecks to docker, docker compose, podman quadlet, and helm chart (#1137)
This commit is contained in:
@@ -116,7 +116,11 @@ ENV APP_VERSION=${APP_VERSION} \
|
|||||||
APP_REVISION=${APP_REVISION}
|
APP_REVISION=${APP_REVISION}
|
||||||
|
|
||||||
ARG BOOKLORE_PORT=6060
|
ARG BOOKLORE_PORT=6060
|
||||||
|
ENV BOOKLORE_PORT=${BOOKLORE_PORT}
|
||||||
EXPOSE ${BOOKLORE_PORT}
|
EXPOSE ${BOOKLORE_PORT}
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=60s --timeout=10s --start-period=60s --retries=5 \
|
||||||
|
CMD wget -q --spider http://localhost:${BOOKLORE_PORT}/api/v1/healthcheck
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
CMD ["java", "--enable-native-access=ALL-UNNAMED", "--enable-preview", "-jar", "/app/app.jar"]
|
CMD ["java", "--enable-native-access=ALL-UNNAMED", "--enable-preview", "-jar", "/app/app.jar"]
|
||||||
|
|||||||
@@ -33,12 +33,17 @@ services:
|
|||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
- ./books:/books
|
- ./books:/books
|
||||||
- ./bookdrop:/bookdrop
|
- ./bookdrop:/bookdrop
|
||||||
healthcheck:
|
# Uncomment the block below if you need to override the defaults:
|
||||||
test: wget -q -O - http://localhost:6060/api/v1/healthcheck
|
#healthcheck:
|
||||||
interval: 60s
|
# test: wget -q --spider http://localhost:6060/api/v1/healthcheck
|
||||||
retries: 5
|
# interval: 60s
|
||||||
start_period: 60s
|
# retries: 5
|
||||||
timeout: 10s
|
# start_period: 60s
|
||||||
|
# timeout: 10s
|
||||||
|
#
|
||||||
|
# Uncomment the block below if you want to disable healthchecks:
|
||||||
|
#healthcheck:
|
||||||
|
# disable: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ spec:
|
|||||||
name: {{ .Release.Name }}-mariadb
|
name: {{ .Release.Name }}-mariadb
|
||||||
{{- end }}
|
{{- end }}
|
||||||
key: mariadb-password
|
key: mariadb-password
|
||||||
|
{{- with .Values.startupProbe }}
|
||||||
|
startupProbe:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.livenessProbe }}
|
{{- with .Values.livenessProbe }}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
|
|||||||
@@ -89,13 +89,28 @@ resources: {}
|
|||||||
# cpu: 100m
|
# cpu: 100m
|
||||||
# memory: 128Mi
|
# memory: 128Mi
|
||||||
|
|
||||||
# # This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
|
# This is to setup the startup, liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
|
||||||
|
startupProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /api/v1/healthcheck
|
||||||
|
port: http
|
||||||
|
failureThreshold: 5
|
||||||
|
periodSeconds: 30
|
||||||
|
timeoutSeconds: 5
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
tcpSocket:
|
httpGet:
|
||||||
|
path: /api/v1/healthcheck
|
||||||
port: http
|
port: http
|
||||||
|
failureThreshold: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
tcpSocket:
|
httpGet:
|
||||||
|
path: /api/v1/healthcheck
|
||||||
port: http
|
port: http
|
||||||
|
failureThreshold: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
# If you want to bring your own persistence (such as a hostPath),
|
# If you want to bring your own persistence (such as a hostPath),
|
||||||
# disable these and do so in extraVolumes/extraVolumeMounts
|
# disable these and do so in extraVolumes/extraVolumeMounts
|
||||||
persistence:
|
persistence:
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Environment=TZ=Etc/UTC
|
|||||||
Secret=grimmory_db_pass,type=env,target=DATABASE_PASSWORD
|
Secret=grimmory_db_pass,type=env,target=DATABASE_PASSWORD
|
||||||
Environment=DATABASE_URL=jdbc:mariadb://localhost:3306/grimmory
|
Environment=DATABASE_URL=jdbc:mariadb://localhost:3306/grimmory
|
||||||
Environment=DATABASE_USERNAME=grimmory
|
Environment=DATABASE_USERNAME=grimmory
|
||||||
HealthCmd=wget -q -O - http://localhost:6060/api/v1/healthcheck
|
HealthCmd=CMD-SHELL wget -q --spider http://localhost:${BOOKLORE_PORT:-6060}/api/v1/healthcheck
|
||||||
HealthInterval=1m
|
HealthInterval=1m
|
||||||
HealthRetries=5
|
HealthRetries=5
|
||||||
HealthStartPeriod=1m
|
HealthStartPeriod=1m
|
||||||
|
|||||||
Reference in New Issue
Block a user