From b8fe7a17cb836b913ab03abf418a6554ed726012 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Fri, 13 Dec 2024 11:43:53 +0100 Subject: [PATCH] fix: adjust startup, liveness and readiness probes settings Startup probe settings seem to have been added in the upstream Backstage Chart in [1], but the current settings do not allow the RHDH Chart for the liveness probe to be triggered sufficiently enough for the app to be considered live. This adjust such settings by accounting for the worst case scenario where the application might take a bit long to start. This also aligns the probe endpoints with the upstream chart. [1] https://github.com/backstage/charts/pull/216 --- ...kstage-operator.clusterserviceversion.yaml | 2 +- .../rhdh-default-config_v1_configmap.yaml | 28 +++++++++++++------ .../rhdh/default-config/deployment.yaml | 28 +++++++++++++------ 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml b/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml index 967e551f..4404cbc5 100644 --- a/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml +++ b/bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml @@ -39,7 +39,7 @@ metadata: categories: Developer Tools certified: "true" containerImage: registry-proxy.engineering.redhat.com/rh-osbs/rhdh-rhdh-rhel9-operator:1.3 - createdAt: "2024-11-27T12:15:30Z" + createdAt: "2024-12-13T10:42:18Z" description: Red Hat Developer Hub is a Red Hat supported version of Backstage. It comes with pre-built plug-ins and configuration settings, supports use of an external database, and can help streamline the process of setting up a self-managed diff --git a/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml b/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml index 72de26e4..a7b84f31 100644 --- a/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml +++ b/bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml @@ -251,26 +251,38 @@ data: type: RuntimeDefault runAsNonRoot: true allowPrivilegeEscalation: false + startupProbe: + # This gives enough time upon container startup before the liveness and readiness probes are triggered. + # Giving (120s = initialDelaySeconds + failureThreshold * periodSeconds) to account for the worst case scenario. + httpGet: + path: /.backstage/health/v1/liveness + port: backend + scheme: HTTP + initialDelaySeconds: 60 + timeoutSeconds: 4 + periodSeconds: 20 + successThreshold: 1 + failureThreshold: 3 readinessProbe: failureThreshold: 3 httpGet: - path: /healthcheck - port: 7007 + path: /.backstage/health/v1/readiness + port: backend scheme: HTTP - initialDelaySeconds: 30 + #initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 2 - timeoutSeconds: 2 + timeoutSeconds: 4 livenessProbe: failureThreshold: 3 httpGet: - path: /healthcheck - port: 7007 + path: /.backstage/health/v1/liveness + port: backend scheme: HTTP - initialDelaySeconds: 60 + #initialDelaySeconds: 60 periodSeconds: 10 successThreshold: 1 - timeoutSeconds: 2 + timeoutSeconds: 4 ports: - name: backend containerPort: 7007 diff --git a/config/profile/rhdh/default-config/deployment.yaml b/config/profile/rhdh/default-config/deployment.yaml index 13f074d7..a7a2fcb9 100644 --- a/config/profile/rhdh/default-config/deployment.yaml +++ b/config/profile/rhdh/default-config/deployment.yaml @@ -96,26 +96,38 @@ spec: type: RuntimeDefault runAsNonRoot: true allowPrivilegeEscalation: false + startupProbe: + # This gives enough time upon container startup before the liveness and readiness probes are triggered. + # Giving (120s = initialDelaySeconds + failureThreshold * periodSeconds) to account for the worst case scenario. + httpGet: + path: /.backstage/health/v1/liveness + port: backend + scheme: HTTP + initialDelaySeconds: 60 + timeoutSeconds: 4 + periodSeconds: 20 + successThreshold: 1 + failureThreshold: 3 readinessProbe: failureThreshold: 3 httpGet: - path: /healthcheck - port: 7007 + path: /.backstage/health/v1/readiness + port: backend scheme: HTTP - initialDelaySeconds: 30 + #initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 2 - timeoutSeconds: 2 + timeoutSeconds: 4 livenessProbe: failureThreshold: 3 httpGet: - path: /healthcheck - port: 7007 + path: /.backstage/health/v1/liveness + port: backend scheme: HTTP - initialDelaySeconds: 60 + #initialDelaySeconds: 60 periodSeconds: 10 successThreshold: 1 - timeoutSeconds: 2 + timeoutSeconds: 4 ports: - name: backend containerPort: 7007