From 67bb4ae6ceb99a4300208b9cb8565febba8171f7 Mon Sep 17 00:00:00 2001 From: Timo Notheisen Date: Wed, 11 Dec 2024 07:58:42 +0100 Subject: [PATCH] feat: add HealthCheckPolicy --- .../consumerapi/healthcheckpolicy.yaml | 22 ++++++++++++++ .../sseserver/healthcheckpolicy.yaml | 22 ++++++++++++++ helm/values.yaml | 30 +++++++++++++++++-- 3 files changed, 72 insertions(+), 2 deletions(-) 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 4e9f0c4cb2..438e248404 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -225,7 +225,7 @@ consumerapi: targetCPUUtilizationPercentage: 80 targetMemoryUtilizationPercentage: "" - # backendConfig - only applicable if .Values.global.provider is set to "GoogleCloud"; see https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-configuration#direct_health for a description of `HttpRoute`s` + # backendConfig - only applicable if .Values.global.provider is set to "GoogleCloud"; see https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-configuration#direct_health for a description of `BackendConfig`s backendConfig: healthCheck: # checkIntervalSec - time from the start of one prober's check to the start of its next check @@ -237,6 +237,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: @@ -542,7 +555,7 @@ sseserver: # the affinity for the pods deployed by the Deployment (see https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#NodeAffinity) affinity: {} - # backendConfig - only applicable if .Values.global.provider is set to "GoogleCloud"; see https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-configuration#direct_health for a description of `HttpRoute`s` + # backendConfig - only applicable if .Values.global.provider is set to "GoogleCloud"; see https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-configuration#direct_health for a description of `BackendConfig`s backendConfig: healthCheck: # checkIntervalSec - time from the start of one prober's check to the start of its next check @@ -554,6 +567,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: # useBuiltInEventbus - if a development event bus should be created, set this to true; if you want to use an existing one, set it to false useBuiltInEventbus: false