Skip to content

Commit

Permalink
fix: Make the dynamic plugins root PVC storage class configurable [RH…
Browse files Browse the repository at this point in the history
…DHBUGS-156][RHIDP-5573] (#69)

* Extract the dynamic plugins root PVC spec in a `dynamicPlugins.cache.volumeClaimSpec` field in the values file

This way, the whole PVC spec is configurable, including the storage
class name, along with other things like the PVC size and access modes.

* Bump the Chart version

* Extract the PostgreSQL PVC storageClass field to highlight that this configurable as well

See https://github.com/bitnami/charts/blob/postgresql/12.10.0/bitnami/postgresql/README.md#postgresql-primary-parameters

* Add test values file

* Regenerate README
  • Loading branch information
rm3l authored Jan 20, 2025
1 parent e38ad40 commit 65aa524
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ jobs:
- name: Create KIND Cluster
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0

- name: Create custom storage class
run: |
cat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: custom-sc
# same provisioner as the one used by the default storage class on KinD
provisioner: rancher.io/local-path
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
EOF
- name: Install Ingress Controller
run: "helm install ingress-nginx/ingress-nginx --generate-name --set controller.service.type='NodePort' --set controller.admissionWebhooks.enabled=false"

Expand Down Expand Up @@ -105,6 +118,19 @@ jobs:
- name: Create KIND Cluster
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0

- name: Create custom storage class
run: |
cat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: custom-sc
# same provisioner as the one used by the default storage class on KinD
provisioner: rancher.io/local-path
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
EOF
- name: Install Ingress Controller
run: "helm install ingress-nginx/ingress-nginx --generate-name --set controller.service.type='NodePort' --set controller.admissionWebhooks.enabled=false"

Expand Down
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,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: 2.27.0
version: 2.28.0
3 changes: 2 additions & 1 deletion charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RHDH Backstage Helm Chart for OpenShift (Community Version)

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/rhdh-chart&style=flat-square)](https://artifacthub.io/packages/search?repo=rhdh-chart)
![Version: 2.27.0](https://img.shields.io/badge/Version-2.27.0-informational?style=flat-square)
![Version: 2.28.0](https://img.shields.io/badge/Version-2.28.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.
Expand Down Expand Up @@ -141,6 +141,7 @@ Kubernetes: `>= 1.25.0-0`

| Key | Description | Type | Default |
|-----|-------------|------|---------|
| dynamicPlugins.cache.volumeClaimSpec | Spec of the dynamic plugins root volume claim. <br/> Note that, by default, this is set to use the default storage class, if available in the cluster. | object | `{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"5Gi"}},"storageClassName":null}` |
| global.auth | Enable service authentication within Backstage instance | object | `{"backend":{"enabled":true,"existingSecret":"","value":""}}` |
| global.auth.backend | Backend service to service authentication <br /> Ref: https://backstage.io/docs/auth/service-to-service-auth/ | object | `{"enabled":true,"existingSecret":"","value":""}` |
| global.auth.backend.enabled | Enable backend service to service authentication, unless configured otherwise it generates a secret value | bool | `true` |
Expand Down
18 changes: 18 additions & 0 deletions charts/backstage/ci/with-custom-dynamic-pvc-claim-spec-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Workaround for kind cluster in CI which has no Routes
route:
enabled: false
upstream:
postgresql:
primary:
persistence:
# This custom-sc storage class is created in the test GH Workflow
storageClass: custom-sc

dynamicPlugins:
cache:
volumeClaimSpec:
resources:
requests:
storage: 3Gi
# This custom-sc storage class is created in the test GH Workflow
storageClassName: custom-sc
6 changes: 1 addition & 5 deletions charts/backstage/templates/pvcs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ apiVersion: v1
metadata:
name: {{ printf "%s-dynamic-plugins-root" .Release.Name }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
{{- toYaml .Values.dynamicPlugins.cache.volumeClaimSpec | nindent 2 }}
13 changes: 13 additions & 0 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ upstream:
enabled: true
size: 1Gi
mountPath: /var/lib/pgsql/data
storageClass: null
extraEnvVars:
- name: POSTGRESQL_ADMIN_PASSWORD
valueFrom:
Expand Down Expand Up @@ -307,3 +308,15 @@ route:
# -- Indicates the desired behavior for insecure connections to a route.
# <br /> While each router may make its own decisions on which ports to expose, this is normally port 80. The only valid values are None, Redirect, or empty for disabled.
insecureEdgeTerminationPolicy: "Redirect"

dynamicPlugins:
cache:
# -- Spec of the dynamic plugins root volume claim.
# <br/> Note that, by default, this is set to use the default storage class, if available in the cluster.
volumeClaimSpec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: null

0 comments on commit 65aa524

Please sign in to comment.