diff --git a/charts/rhdh/Chart.yaml b/charts/rhdh/Chart.yaml index 14bbf51a..3603c3f4 100644 --- a/charts/rhdh/Chart.yaml +++ b/charts/rhdh/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: redhat-developer-hub type: application -version: 3.3.0 +version: 3.4.0 appVersion: 2.1.0 annotations: artifacthub.io/category: integration-delivery diff --git a/charts/rhdh/README.md b/charts/rhdh/README.md index b70a2139..cc55a0bd 100644 --- a/charts/rhdh/README.md +++ b/charts/rhdh/README.md @@ -1,7 +1,7 @@ # RHDH Helm Chart for OpenShift and Kubernetes -![Version: 3.3.0](https://img.shields.io/badge/Version-3.3.0-informational?style=flat-square) +![Version: 3.4.0](https://img.shields.io/badge/Version-3.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for deploying Red Hat Developer Hub, which is a Red Hat supported version of Backstage. @@ -36,7 +36,7 @@ For the **Generally Available** version of this chart, see: helm repo add bitnami https://charts.bitnami.com/bitnami helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart -helm install my-rhdh redhat-developer/redhat-developer-hub --version 3.3.0 +helm install my-rhdh redhat-developer/redhat-developer-hub --version 3.4.0 ``` ## Introduction @@ -276,6 +276,7 @@ Kubernetes: `>= 1.31.0-0` | intelligentAssistant.plugins | Intelligent Assistant dynamic plugin packages. | list | `[{"enabled":true,"package":"ref://red-hat-developer-hub-backstage-plugin-intelligent-assistant"},{"enabled":true,"package":"ref://red-hat-developer-hub-backstage-plugin-intelligent-assistant-backend"}]` | | intelligentAssistant.runtimeVolume | Writable scratch volume for the sidecar (/tmp). | object | `{"emptyDir":{},"persistentVolumeClaim":{},"type":"emptyDir"}` | | intelligentAssistant.runtimeVolume.type | Volume type: "emptyDir" or "persistentVolumeClaim". | string | `"emptyDir"` | +| lifecycleHooks | Lifecycle hooks for the main RHDH container. Ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ | object | `{}` | | livenessProbe | Liveness probe configuration. | object | `{"failureThreshold":3,"httpGet":{"path":"/.backstage/health/v1/liveness","port":"backend","scheme":"HTTP"},"periodSeconds":10,"successThreshold":1,"timeoutSeconds":4}` | | metrics | Prometheus metrics configuration. | object | `{"serviceMonitor":{"annotations":{},"enabled":false,"interval":"","labels":{},"path":"/metrics","port":"http-metrics"}}` | | nameOverride | Override the chart name used in resource naming. | string | `"developer-hub"` | @@ -301,6 +302,7 @@ Kubernetes: `>= 1.31.0-0` | podSecurityContext | Pod-level security context. | object | `{}` | | postgresql | Built-in PostgreSQL database (bitnami subchart). | object | `{"auth":{"secretKeys":{"adminPasswordKey":"postgres-password","userPasswordKey":"password"}},"enabled":true,"image":{"digest":"","registry":"quay.io","repository":"fedora/postgresql-18","tag":"latest"},"postgresqlDataDir":"/var/lib/pgsql/data/userdata","primary":{"containerSecurityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"enabled":false},"extraEnvVars":[{"name":"POSTGRESQL_ADMIN_PASSWORD","valueFrom":{"secretKeyRef":{"key":"{{- include \"rhdh.postgresql.adminPasswordKey\" . }}","name":"{{- include \"rhdh.postgresql.secretName\" . }}"}}}],"networkPolicy":{"enabled":false},"persistence":{"enabled":true,"mountPath":"/var/lib/pgsql/data","size":"1Gi"},"podSecurityContext":{"enabled":false},"resources":{"limits":{"cpu":"250m","ephemeral-storage":"20Mi","memory":"1024Mi"},"requests":{"cpu":"250m","memory":"256Mi"}}},"readReplicas":{"networkPolicy":{"enabled":false}},"serviceBindings":{"enabled":true}}` | | preInitContainers | Init containers to run BEFORE the system init containers (e.g. inject auth credentials before install-dynamic-plugins runs). | list | `[]` | +| priorityClassName | Priority class name for pod scheduling. Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ | string | `""` | | readinessProbe | Readiness probe configuration. | object | `{"failureThreshold":3,"httpGet":{"path":"/.backstage/health/v1/readiness","port":"backend","scheme":"HTTP"},"periodSeconds":10,"successThreshold":2,"timeoutSeconds":4}` | | replicaCount | Number of desired pods. | int | `1` | | resources | Resource requests and limits for the main RHDH container. | object | `{"limits":{"cpu":"1000m","ephemeral-storage":"5Gi","memory":"2.5Gi"},"requests":{"cpu":"250m","memory":"1Gi"}}` | @@ -315,6 +317,7 @@ Kubernetes: `>= 1.31.0-0` | serviceAccount.name | The name of the service account to use. If not set and create is true, a name is generated using the fullname template. | string | `""` | | startupProbe | Startup probe configuration. Gives the application time to start before liveness/readiness probes kick in. | object | `{"failureThreshold":3,"httpGet":{"path":"/.backstage/health/v1/liveness","port":"backend","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":20,"successThreshold":1,"timeoutSeconds":4}` | | strategy | Deployment update strategy. | object | `{}` | +| terminationGracePeriodSeconds | Duration in seconds the pod needs to terminate gracefully before being force killed. Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination | string | `nil` | | test | Test pod configuration for `helm test`. | object | `{"enabled":true,"image":{"digest":"","pullPolicy":"IfNotPresent","registry":"quay.io","repository":"curl/curl","tag":"8.22.0"},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true}}` | | tolerations | Tolerations for pod assignment. | list | `[]` | | topologySpreadConstraints | Topology spread constraints for pod scheduling. | list | `[]` | diff --git a/charts/rhdh/templates/_backstage-pod-template.tpl b/charts/rhdh/templates/_backstage-pod-template.tpl index ca8fbf1c..e94f510c 100644 --- a/charts/rhdh/templates/_backstage-pod-template.tpl +++ b/charts/rhdh/templates/_backstage-pod-template.tpl @@ -45,6 +45,12 @@ spec: hostAliases: {{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 4 }} {{- end }} + {{- with .Values.priorityClassName }} + priorityClassName: {{ . | quote }} + {{- end }} + {{- if not (kindIs "invalid" .Values.terminationGracePeriodSeconds) }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- end }} volumes: # --- System volumes (hardcoded, never replaced) --- - name: dynamic-plugins-root @@ -249,6 +255,10 @@ spec: securityContext: {{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }} {{- end }} + {{- with .Values.lifecycleHooks }} + lifecycle: + {{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }} + {{- end }} {{- if .Values.commandOverride }} command: {{- include "common.tplvalues.render" (dict "value" .Values.commandOverride "context" $) | nindent 8 }} diff --git a/charts/rhdh/templates/deployment.yaml b/charts/rhdh/templates/deployment.yaml index a107667a..e693daf5 100644 --- a/charts/rhdh/templates/deployment.yaml +++ b/charts/rhdh/templates/deployment.yaml @@ -28,4 +28,4 @@ spec: {{- include "rhdh.selectorLabels" . | nindent 6 }} template: {{- include "rhdh.backstagePodTemplate" . | nindent 4 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/rhdh/values.schema.json b/charts/rhdh/values.schema.json index d141c1d9..1fe503ae 100644 --- a/charts/rhdh/values.schema.json +++ b/charts/rhdh/values.schema.json @@ -1813,6 +1813,12 @@ "title": "Built-in Intelligent Assistant feature configuration.", "type": "object" }, + "lifecycleHooks": { + "default": {}, + "description": "Ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/", + "title": "Lifecycle hooks for the main RHDH container.", + "type": "object" + }, "livenessProbe": { "default": { "failureThreshold": 3, @@ -2332,6 +2338,12 @@ "title": "Init containers to run BEFORE the system init containers (e.g. inject auth credentials before install-dynamic-plugins runs).", "type": "array" }, + "priorityClassName": { + "default": "", + "description": "Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/", + "title": "Priority class name for pod scheduling.", + "type": "string" + }, "readinessProbe": { "default": { "failureThreshold": 3, @@ -2528,6 +2540,16 @@ "title": "Deployment update strategy.", "type": "object" }, + "terminationGracePeriodSeconds": { + "default": null, + "description": "Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination", + "minimum": 0, + "title": "Duration in seconds the pod needs to terminate gracefully before being force killed.", + "type": [ + "integer", + "null" + ] + }, "test": { "additionalProperties": false, "properties": { diff --git a/charts/rhdh/values.schema.tmpl.json b/charts/rhdh/values.schema.tmpl.json index 79f64126..4570e49f 100644 --- a/charts/rhdh/values.schema.tmpl.json +++ b/charts/rhdh/values.schema.tmpl.json @@ -392,6 +392,25 @@ "type": "array", "default": [] }, + "priorityClassName": { + "title": "Priority class name for pod scheduling.", + "description": "Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/", + "type": "string", + "default": "" + }, + "terminationGracePeriodSeconds": { + "title": "Duration in seconds the pod needs to terminate gracefully before being force killed.", + "description": "Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination", + "type": ["integer", "null"], + "default": null, + "minimum": 0 + }, + "lifecycleHooks": { + "title": "Lifecycle hooks for the main RHDH container.", + "description": "Ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/", + "type": "object", + "default": {} + }, "deploymentAnnotations": { "title": "Annotations for the Deployment resource (not the pod).", "type": "object", diff --git a/charts/rhdh/values.yaml b/charts/rhdh/values.yaml index 2c76717f..ad5473e5 100644 --- a/charts/rhdh/values.yaml +++ b/charts/rhdh/values.yaml @@ -352,6 +352,23 @@ topologySpreadConstraints: [] # -- Host aliases for /etc/hosts entries. hostAliases: [] +# -- Priority class name for pod scheduling. +# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ +priorityClassName: "" + +# -- Duration in seconds the pod needs to terminate gracefully before being force killed. +# Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination +# @default -- `nil` +terminationGracePeriodSeconds: + +# -- Lifecycle hooks for the main RHDH container. +# Ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ +lifecycleHooks: {} +# lifecycleHooks: +# preStop: +# exec: +# command: ["/bin/sh", "-c", "sleep 10"] + # -- Annotations for the Deployment resource (not the pod). deploymentAnnotations: {}