Skip to content

Commit 8c9085d

Browse files
authored
Merge pull request #642 from snyk/feat/configurable-pvc-storage-class-name
feat: allow configuring PVC StorageClass name
2 parents 302849d + 2c4a2e6 commit 8c9085d

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

snyk-monitor/templates/pvc.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
{{ if .Values.pvc.enabled }}
1+
# We create a PVC only if the default PVC name has not changed.
2+
# If the name has changed, it means our users want to use their own pre-provisioned PVC.
3+
# In such cases it would be an error to create a PVC as it would result in a conflict - the PVC already exists.
4+
{{- if .Values.pvc.enabled }}{{- if eq .Values.pvc.name "snyk-monitor-pvc" }}
25
kind: PersistentVolumeClaim
36
apiVersion: v1
47
metadata:
@@ -10,4 +13,5 @@ spec:
1013
resources:
1114
requests:
1215
storage: {{ .Values.temporaryStorageSize }}
13-
{{ end }}
16+
storageClassName: {{ .Values.pvc.storageClassName }}
17+
{{- end }}{{- end }}

snyk-monitor/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ temporaryStorageSize: 50Gi # Applies to PVC too
3939
# Change to true to use a PVC instead of emptyDir for local storage
4040
pvc:
4141
enabled: false
42-
name: 'snyk-monitor-pvc'
42+
name: snyk-monitor-pvc
43+
storageClassName: null
4344

4445
# Node.js in-container process memory enhancements
4546
envs:

snyk-operator/deploy/olm-catalog/snyk-operator/0.0.0/snyk-operator.v0.0.0.clusterserviceversion.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ metadata:
2323
"temporaryStorageSize": "50Gi",
2424
"pvc": {
2525
"enabled": false,
26-
"name": "snyk-monitor-pvc"
26+
"name": "snyk-monitor-pvc",
27+
"storageClassName": null
2728
},
2829
"initContainerImage": {
2930
"repository": "busybox",
@@ -126,6 +127,12 @@ spec:
126127
path: pvc.name
127128
x-descriptors:
128129
- 'urn:alm:descriptor:text'
130+
- description: >-
131+
The name of the StorageClass to use for the PVC, when enabled.
132+
displayName: PVC StorageClass name
133+
path: pvc.storageClassName
134+
x-descriptors:
135+
- 'urn:alm:descriptor:text'
129136
- description: >-
130137
The repo to use for initContainer, if overriding.
131138
displayName: InitContainer image repo

snyk-operator/deploy/olm-catalog/snyk-operator/0.0.0/snykmonitors.charts.helm.k8s.io.crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ spec:
5252
type: boolean
5353
name:
5454
type: string
55+
storageClassName:
56+
type: string
5557
type: object
5658
initContainerImage:
5759
properties:

0 commit comments

Comments
 (0)