Skip to content

Commit

Permalink
Add readiness/liveness probes (#101)
Browse files Browse the repository at this point in the history
* Add readiness/liveness probes

Signed-off-by: damatj <joel.damata@pointclickcare.com>

* Bump chart yaml version

Signed-off-by: damatj <joel.damata@pointclickcare.com>

* Fix linting

Signed-off-by: damatj <joel.damata@pointclickcare.com>

* Fix linting

Signed-off-by: damatj <joel.damata@pointclickcare.com>

* Description in wrong location

Signed-off-by: damatj <joel.damata@pointclickcare.com>

* add ci file

Signed-off-by: damatj <joel.damata@pointclickcare.com>

* run precommit

Signed-off-by: damatj <joel.damata@pointclickcare.com>

---------

Signed-off-by: damatj <joel.damata@pointclickcare.com>
Co-authored-by: damatj <joel.damata@pointclickcare.com>
  • Loading branch information
jdamata and pcc-damatj authored May 31, 2023
1 parent 55e0195 commit d94c8a2
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
version: 1.1.0
4 changes: 3 additions & 1 deletion charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Backstage Helm Chart

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/backstage)](https://artifacthub.io/packages/search?repo=backstage)
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square)
![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart for deploying a Backstage application
Expand Down Expand Up @@ -134,9 +134,11 @@ Kubernetes: `>= 1.19.0-0`
| backstage.image.tag | Backstage image tag (immutable tags are recommended) | string | `"latest"` |
| backstage.initContainers | Backstage container init containers | list | `[]` |
| backstage.installDir | Directory containing the backstage installation | string | `"/app"` |
| backstage.livenessProbe | Liveness Probe Backstage doesn't provide any health endpoints by default. A simple one can be added like this: https://backstage.io/docs/plugins/observability/#health-checks <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes <!-- E.g. livenessProbe: failureThreshold: 3 httpGet: path: /healthcheck port: 7007 scheme: HTTP initialDelaySeconds: 60 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 2 | object | `{}` |
| backstage.nodeSelector | Node labels for pod assignment <br /> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector | object | `{}` |
| backstage.podAnnotations | Annotations to add to the backend deployment pods | object | `{}` |
| backstage.podSecurityContext | Security settings for a Pod. The security settings that you specify for a Pod apply to all Containers in the Pod. <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod | object | `{}` |
| backstage.readinessProbe | Readiness Probe Backstage doesn't provide any health endpoints by default. A simple one can be added like this: https://backstage.io/docs/plugins/observability/#health-checks <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes <!-- E.g. readinessProbe: failureThreshold: 3 httpGet: path: /healthcheck port: 7007 scheme: HTTP initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 2 timeoutSeconds: 2 | object | `{}` |
| backstage.replicas | Number of deployment replicas | int | `1` |
| backstage.resources | Resource requests/limits <br /> Ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-requests-and-limits-of-pod-and-container <!-- E.g. resources: limits: memory: 1Gi cpu: 1000m requests: memory: 250Mi cpu: 100m --> | object | `{}` |
| backstage.tolerations | Node tolerations for server scheduling to nodes with taints <br /> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ | list | `[]` |
Expand Down
21 changes: 21 additions & 0 deletions charts/backstage/ci/probes-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
backstage:
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 7007
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 2
timeoutSeconds: 2
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 7007
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
6 changes: 6 additions & 0 deletions charts/backstage/templates/backstage-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ spec:
{{- if .Values.backstage.resources }}
resources: {{- include "common.tplvalues.render" (dict "value" .Values.backstage.resources "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.backstage.readinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.backstage.readinessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.backstage.livenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.backstage.livenessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.backstage.extraEnvVarsSecrets }}
envFrom:
{{- range .Values.backstage.extraEnvVarsSecrets }}
Expand Down
40 changes: 40 additions & 0 deletions charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,46 @@
}
]
},
"readinessProbe": {
"title": "Readiness probe",
"description": "Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/",
"$ref": "https://kubernetesjsonschema.dev/master/_definitions.json#/definitions/io.k8s.api.core.v1.Probe",
"default": {},
"examples": [
{
"failureThreshold": 3,
"httpGet": {
"path": "/healthcheck",
"port": 7007,
"scheme": "HTTP"
},
"initialDelaySeconds": 30,
"periodSeconds": 10,
"successThreshold": 2,
"timeoutSeconds": 2
}
]
},
"livenessProbe": {
"title": "Liveness probe",
"description": "Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/",
"$ref": "https://kubernetesjsonschema.dev/master/_definitions.json#/definitions/io.k8s.api.core.v1.Probe",
"default": {},
"examples": [
{
"failureThreshold": 3,
"httpGet": {
"path": "/healthcheck",
"port": 7007,
"scheme": "HTTP"
},
"initialDelaySeconds": 60,
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 2
}
]
},
"podSecurityContext": {
"title": "Security settings for a Pod.",
"description": "The security settings that you specify for a Pod apply to all Containers in the Pod. Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod",
Expand Down
32 changes: 32 additions & 0 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,38 @@ backstage:
# cpu: 100m -->
resources: {}

# -- Readiness Probe
# Backstage doesn't provide any health endpoints by default. A simple one can be added like this: https://backstage.io/docs/plugins/observability/#health-checks
# <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes
# <!-- E.g.
# readinessProbe:
# failureThreshold: 3
# httpGet:
# path: /healthcheck
# port: 7007
# scheme: HTTP
# initialDelaySeconds: 30
# periodSeconds: 10
# successThreshold: 2
# timeoutSeconds: 2
readinessProbe: {}

# -- Liveness Probe
# Backstage doesn't provide any health endpoints by default. A simple one can be added like this: https://backstage.io/docs/plugins/observability/#health-checks
# <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes
# <!-- E.g.
# livenessProbe:
# failureThreshold: 3
# httpGet:
# path: /healthcheck
# port: 7007
# scheme: HTTP
# initialDelaySeconds: 60
# periodSeconds: 10
# successThreshold: 1
# timeoutSeconds: 2
livenessProbe: {}

# -- Security settings for a Pod.
# The security settings that you specify for a Pod apply to all Containers in the Pod.
# <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
Expand Down

0 comments on commit d94c8a2

Please sign in to comment.