Skip to content

Commit b7a63bc

Browse files
committed
fix: Make the dynamic plugins root PVC storage class configurable [RHDHBUGS-156][RHIDP-5573] (redhat-developer#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
1 parent efcacd8 commit b7a63bc

File tree

6 files changed

+61
-7
lines changed

6 files changed

+61
-7
lines changed

.github/workflows/test.yml

+26
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ jobs:
6565
- name: Create KIND Cluster
6666
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
6767

68+
- name: Create custom storage class
69+
run: |
70+
cat <<EOF | kubectl apply -f -
71+
apiVersion: storage.k8s.io/v1
72+
kind: StorageClass
73+
metadata:
74+
name: custom-sc
75+
# same provisioner as the one used by the default storage class on KinD
76+
provisioner: rancher.io/local-path
77+
reclaimPolicy: Delete
78+
volumeBindingMode: WaitForFirstConsumer
79+
EOF
80+
6881
- name: Install Ingress Controller
6982
run: "helm install ingress-nginx/ingress-nginx --generate-name --set controller.service.type='NodePort' --set controller.admissionWebhooks.enabled=false"
7083

@@ -105,6 +118,19 @@ jobs:
105118
- name: Create KIND Cluster
106119
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
107120

121+
- name: Create custom storage class
122+
run: |
123+
cat <<EOF | kubectl apply -f -
124+
apiVersion: storage.k8s.io/v1
125+
kind: StorageClass
126+
metadata:
127+
name: custom-sc
128+
# same provisioner as the one used by the default storage class on KinD
129+
provisioner: rancher.io/local-path
130+
reclaimPolicy: Delete
131+
volumeBindingMode: WaitForFirstConsumer
132+
EOF
133+
108134
- name: Install Ingress Controller
109135
run: "helm install ingress-nginx/ingress-nginx --generate-name --set controller.service.type='NodePort' --set controller.admissionWebhooks.enabled=false"
110136

charts/backstage/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ sources:
4545
# This is the chart version. This version number should be incremented each time you make changes
4646
# to the chart and its templates, including the app version.
4747
# Versions are expected to follow Semantic Versioning (https://semver.org/)
48-
version: 2.19.0
48+
version: 2.19.1

charts/backstage/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# RHDH Backstage Helm Chart for OpenShift (Community Version)
33

44
[![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)
5-
![Version: 2.19.0](https://img.shields.io/badge/Version-2.19.0-informational?style=flat-square)
5+
![Version: 2.19.1](https://img.shields.io/badge/Version-2.19.1-informational?style=flat-square)
66
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
77

88
A Helm chart for deploying Red Hat Developer Hub.
@@ -141,6 +141,7 @@ Kubernetes: `>= 1.25.0-0`
141141

142142
| Key | Description | Type | Default |
143143
|-----|-------------|------|---------|
144+
| 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}` |
144145
| global.auth | Enable service authentication within Backstage instance | object | `{"backend":{"enabled":true,"existingSecret":"","value":""}}` |
145146
| global.auth.backend | Backend service to service authentication <br /> Ref: https://backstage.io/docs/auth/service-to-service-auth/ | object | `{"enabled":true,"existingSecret":"","value":""}` |
146147
| global.auth.backend.enabled | Enable backend service to service authentication, unless configured otherwise it generates a secret value | bool | `true` |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Workaround for kind cluster in CI which has no Routes
2+
route:
3+
enabled: false
4+
upstream:
5+
postgresql:
6+
primary:
7+
persistence:
8+
# This custom-sc storage class is created in the test GH Workflow
9+
storageClass: custom-sc
10+
11+
dynamicPlugins:
12+
cache:
13+
volumeClaimSpec:
14+
resources:
15+
requests:
16+
storage: 3Gi
17+
# This custom-sc storage class is created in the test GH Workflow
18+
storageClassName: custom-sc

charts/backstage/templates/pvcs.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@ apiVersion: v1
1414
metadata:
1515
name: {{ printf "%s-dynamic-plugins-root" .Release.Name }}
1616
spec:
17-
accessModes:
18-
- ReadWriteOnce
19-
resources:
20-
requests:
21-
storage: 5Gi
17+
{{- toYaml .Values.dynamicPlugins.cache.volumeClaimSpec | nindent 2 }}

charts/backstage/values.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ upstream:
230230
enabled: true
231231
size: 1Gi
232232
mountPath: /var/lib/pgsql/data
233+
storageClass: null
233234
extraEnvVars:
234235
- name: POSTGRESQL_ADMIN_PASSWORD
235236
valueFrom:
@@ -281,3 +282,15 @@ route:
281282
# -- Indicates the desired behavior for insecure connections to a route.
282283
# <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.
283284
insecureEdgeTerminationPolicy: "Redirect"
285+
286+
dynamicPlugins:
287+
cache:
288+
# -- Spec of the dynamic plugins root volume claim.
289+
# <br/> Note that, by default, this is set to use the default storage class, if available in the cluster.
290+
volumeClaimSpec:
291+
accessModes:
292+
- ReadWriteOnce
293+
resources:
294+
requests:
295+
storage: 5Gi
296+
storageClassName: null

0 commit comments

Comments
 (0)