From 28a30f7789fdcd323236c6ce8a11c7ea0bdaf8e8 Mon Sep 17 00:00:00 2001 From: jon4hz Date: Mon, 16 Sep 2024 15:30:28 +0200 Subject: [PATCH] feat(hedgedoc): customize liveness and readiness probes (#1320) --- charts/hedgedoc/Chart.yaml | 4 +++- charts/hedgedoc/README.md | 9 ++++++++- charts/hedgedoc/templates/deployment.yaml | 23 ++++++++++++++--------- charts/hedgedoc/values.yaml | 17 +++++++++++++++++ 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/charts/hedgedoc/Chart.yaml b/charts/hedgedoc/Chart.yaml index 1f8f1abdf..90d820d63 100644 --- a/charts/hedgedoc/Chart.yaml +++ b/charts/hedgedoc/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: hedgedoc description: Chart for HedgeDoc, a fork of CodiMD type: application -version: 0.5.1 +version: 0.5.2 appVersion: "1.10.0" icon: https://raw.githubusercontent.com/hedgedoc/hedgedoc-logo/main/LOGOTYPE/PNG/HedgeDoc-Logo%201.png sources: @@ -24,3 +24,5 @@ annotations: artifacthub.io/changes: | - kind: changed description: Bumped hedgedoc image tag to 1.10.0 + - kind: added + description: Option to customize liveness and readiness probe diff --git a/charts/hedgedoc/README.md b/charts/hedgedoc/README.md index 8a6403172..a1910b1f0 100644 --- a/charts/hedgedoc/README.md +++ b/charts/hedgedoc/README.md @@ -1,6 +1,6 @@ # hedgedoc -![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.10.0](https://img.shields.io/badge/AppVersion-1.10.0-informational?style=flat-square) +![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.10.0](https://img.shields.io/badge/AppVersion-1.10.0-informational?style=flat-square) Chart for HedgeDoc, a fork of CodiMD @@ -38,6 +38,7 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | image.tag | string | `""` | Override the imaae tag | | imagePullSecrets | list | `[]` | | | ingress | object | `{"annotations":{},"className":"","enabled":false,"hosts":[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}],"tls":[]}` | Ingress configuration | +| livenessProbe | object | `{"enabled":true,"failureThreshold":2,"initialDelaySeconds":20,"periodSeconds":5,"successThreshold":1,"timeoutSeconds":2}` | Specify custom options for the containers liveness and readiness probes | | nameOverride | string | `""` | | | nodeSelector | object | `{}` | | | podAnnotations | object | `{}` | | @@ -50,6 +51,12 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | prometheus.serviceMonitor.interval | string | `"30s"` | Interval at which metrics should be scraped | | prometheus.serviceMonitor.metricRelabelings | list | `[]` | MetricRelabelConfigs to apply to samples before ingestion | | prometheus.serviceMonitor.relabelings | list | `[]` | RelabelConfigs to apply to samples before scraping | +| readinessProbe.enabled | bool | `true` | | +| readinessProbe.failureThreshold | int | `2` | | +| readinessProbe.initialDelaySeconds | int | `20` | | +| readinessProbe.periodSeconds | int | `5` | | +| readinessProbe.successThreshold | int | `1` | | +| readinessProbe.timeoutSeconds | int | `2` | | | replicaCount | int | `1` | | | resources | object | `{}` | | | securityContext | object | `{}` | | diff --git a/charts/hedgedoc/templates/deployment.yaml b/charts/hedgedoc/templates/deployment.yaml index b4b2cc0de..5651f33e8 100644 --- a/charts/hedgedoc/templates/deployment.yaml +++ b/charts/hedgedoc/templates/deployment.yaml @@ -79,23 +79,28 @@ spec: subPath: {{ .subPath }} readOnly: {{ .readOnly }} {{- end }} + {{- if .Values.livenessProbe.enabled }} livenessProbe: httpGet: path: /_health port: http - initialDelaySeconds: 20 - failureThreshold: 2 - successThreshold: 1 - timeoutSeconds: 2 - periodSeconds: 5 + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} readinessProbe: httpGet: path: /status port: http - initialDelaySeconds: 20 - periodSeconds: 5 - successThreshold: 1 - timeoutSeconds: 2 + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/charts/hedgedoc/values.yaml b/charts/hedgedoc/values.yaml index 6ec358214..8c73d59f4 100644 --- a/charts/hedgedoc/values.yaml +++ b/charts/hedgedoc/values.yaml @@ -56,6 +56,23 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 +# -- Specify custom options for the containers liveness and readiness probes +livenessProbe: + enabled: true + initialDelaySeconds: 20 + periodSeconds: 5 + timeoutSeconds: 2 + successThreshold: 1 + failureThreshold: 2 + +readinessProbe: + enabled: true + initialDelaySeconds: 20 + periodSeconds: 5 + timeoutSeconds: 2 + successThreshold: 1 + failureThreshold: 2 + # -- Ingress configuration ingress: enabled: false