From eae954c8d657a6f6e238edb65770bf0c6e46b810 Mon Sep 17 00:00:00 2001 From: Timo Notheisen <65653426+tnotheis@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:48:30 +0100 Subject: [PATCH] Add Azure HealthCheckPolicy to Helm Chart (#974) --- .../consumerapi/healthcheckpolicy.yaml | 22 ++++++++++++++++ .../sseserver/healthcheckpolicy.yaml | 22 ++++++++++++++++ helm/values.yaml | 26 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 helm/templates/consumerapi/healthcheckpolicy.yaml create mode 100644 helm/templates/sseserver/healthcheckpolicy.yaml diff --git a/helm/templates/consumerapi/healthcheckpolicy.yaml b/helm/templates/consumerapi/healthcheckpolicy.yaml new file mode 100644 index 0000000000..7175b517f4 --- /dev/null +++ b/helm/templates/consumerapi/healthcheckpolicy.yaml @@ -0,0 +1,22 @@ +{{- if eq .Values.global.provider "Azure" }} +apiVersion: alb.networking.azure.io/v1 +kind: HealthCheckPolicy +metadata: + name: {{ .Values.consumerapi.name }} +spec: + targetRef: + group: "" + kind: Service + name: {{ .Values.consumerapi.name }} + default: + interval: {{ .Values.consumerapi.healthCheckPolicy.interval }} + timeout: {{ .Values.consumerapi.healthCheckPolicy.timeout }} + healthyThreshold: {{ .Values.consumerapi.healthCheckPolicy.healthyThreshold }} + unhealthyThreshold: {{ .Values.consumerapi.healthCheckPolicy.unhealthyThreshold }} + http: + host: {{ default .Values.global.hostname .Values.consumerapi.healthCheckPolicy.hostOverride }} + path: /health + match: + statusCodes: + - start: 200 + end: 200 diff --git a/helm/templates/sseserver/healthcheckpolicy.yaml b/helm/templates/sseserver/healthcheckpolicy.yaml new file mode 100644 index 0000000000..55c2d933cd --- /dev/null +++ b/helm/templates/sseserver/healthcheckpolicy.yaml @@ -0,0 +1,22 @@ +{{- if eq .Values.global.provider "Azure" }} +apiVersion: alb.networking.azure.io/v1 +kind: HealthCheckPolicy +metadata: + name: {{ .Values.sseserver.name }} +spec: + targetRef: + group: "" + kind: Service + name: {{ .Values.sseserver.name }} + default: + interval: {{ .Values.sseserver.healthCheckPolicy.interval }} + timeout: {{ .Values.sseserver.healthCheckPolicy.timeout }} + healthyThreshold: {{ .Values.sseserver.healthCheckPolicy.healthyThreshold }} + unhealthyThreshold: {{ .Values.sseserver.healthCheckPolicy.unhealthyThreshold }} + http: + host: {{ default .Values.global.hostname .Values.sseserver.healthCheckPolicy.hostOverride }} + path: /health + match: + statusCodes: + - start: 200 + end: 200 diff --git a/helm/values.yaml b/helm/values.yaml index 01b06f93d7..4395bf85f9 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -210,6 +210,19 @@ consumerapi: # unhealthyThreshold - the number of consecutive failed checks required to mark a backend as unhealthy unhealthyThreshold: 2 + # healthCheckPolicy - only applicable if .Values.global.provider is set to "Azure"; see https://learn.microsoft.com/en-us/azure/application-gateway/for-containers/custom-health-probe for a description of `HealthCheckPolicy`s + healthCheckPolicy: + # hostOverride - the host name that should be used for the health check; if empty, the toplevel `hostname` property is used + hostOverride: "" + # interval - the interval in seconds between health checks + interval: 15 + # timeout - the timeout in seconds for each health check + timeout: 15 + # healthyThreshold - the number of consecutive successful health checks required to mark a backend as healthy + healthyThreshold: 1 + # unhealthyThreshold - the number of consecutive failed health checks required to mark a backend as unhealthy + unhealthyThreshold: 2 + #=========================== Database Migrator =========================== databasemigrator: @@ -527,6 +540,19 @@ sseserver: # unhealthyThreshold - the number of consecutive failed checks required to mark a backend as unhealthy unhealthyThreshold: 2 + # healthCheckPolicy - only applicable if .Values.global.provider is set to "Azure"; see https://learn.microsoft.com/en-us/azure/application-gateway/for-containers/custom-health-probe for a description of `HealthCheckPolicy`s + healthCheckPolicy: + # hostOverride - the host name that should be used for the health check; if empty, the toplevel `hostname` property is used + hostOverride: "" + # interval - the interval in seconds between health checks + interval: 15 + # timeout - the timeout in seconds for each health check + timeout: 15 + # healthyThreshold - the number of consecutive successful health checks required to mark a backend as healthy + healthyThreshold: 1 + # unhealthyThreshold - the number of consecutive failed health checks required to mark a backend as unhealthy + unhealthyThreshold: 2 + global: # defaultHostname - the default hostname the services should be reachable under (this can be overriden in the individual service configurations) defaultHostname: ""