Skip to content

Commit

Permalink
fix: adjust startup, liveness and readiness probes settings (#564) (#565
Browse files Browse the repository at this point in the history
)

* 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] backstage/charts#216

* Update bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml




* Regenerate bundle manifests



* Apply suggestions from code review





* Regenerate bundle manifests



---------

Co-authored-by: Patrick Knight <[email protected]>
Co-authored-by: Gustavo Lira e Silva <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: rm3l <[email protected]>
Co-authored-by: Nick Boldt <[email protected]>
Co-authored-by: Tomas Kral <[email protected]>
  • Loading branch information
7 people authored Dec 13, 2024
1 parent 02cf0e9 commit 3d725af
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ metadata:
}
}
]
createdAt: "2024-11-15T19:48:10Z"
createdAt: "2024-12-13T14:46:15Z"
description: Backstage Operator
operators.operatorframework.io/builder: operator-sdk-v1.37.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-27T11:19:54Z"
createdAt: "2024-12-13T14:46:16Z"
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
Expand Down
36 changes: 28 additions & 8 deletions bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,26 +251,46 @@ 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: 30
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
# Both liveness and readiness probes won't be triggered until the startup probe is successful.
# The startup probe is already configured to give enough time for the application to be started.
# So removing the additional delay here allows the readiness probe to be checked right away after the startup probe,
# which helps make the application available faster to the end-user.
#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
# Both liveness and readiness probes won't be triggered until the startup probe is successful.
# The startup probe is already configured to give enough time for the application to be started.
# So removing the additional delay here allows the readiness probe to be checked right away after the startup probe,
# which helps make the application available faster to the end-user.
#initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
timeoutSeconds: 4
ports:
- name: backend
containerPort: 7007
Expand Down
36 changes: 28 additions & 8 deletions config/profile/rhdh/default-config/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,46 @@ 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: 30
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
# Both liveness and readiness probes won't be triggered until the startup probe is successful.
# The startup probe is already configured to give enough time for the application to be started.
# So removing the additional delay here allows the readiness probe to be checked right away after the startup probe,
# which helps make the application available faster to the end-user.
#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
# Both liveness and readiness probes won't be triggered until the startup probe is successful.
# The startup probe is already configured to give enough time for the application to be started.
# So removing the additional delay here allows the readiness probe to be checked right away after the startup probe,
# which helps make the application available faster to the end-user.
#initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
timeoutSeconds: 4
ports:
- name: backend
containerPort: 7007
Expand Down

0 comments on commit 3d725af

Please sign in to comment.