Skip to content

Commit

Permalink
Use nfs PersistentVolume for Licensify Helm chart for compliance with…
Browse files Browse the repository at this point in the history
… PSS restricted

Description:
- PSS restricted doesn't allow volume types of `nfs`(see [here](https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted)) but does allow `PersistentVolume`
- Refactor the NFS volume to use a `PersistentVolume` of type NFS
- As part of #1883
  • Loading branch information
nimalank7 committed Jan 13, 2025
1 parent af21288 commit aeb9693
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
6 changes: 2 additions & 4 deletions charts/licensify/templates/clamav/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ spec:
- name: app-clamav-log
emptyDir: {}
- name: app-clamav-db
nfs:
server: "{{ .Values.assetManagerNFS }}"
path: /clamav-db
readOnly: true
persistentVolumeClaim:
claimName: {{ .Values.appName }}-db
{{- if eq "arm64" .Values.arch }}
tolerations:
- key: arch
Expand Down
18 changes: 18 additions & 0 deletions charts/licensify/templates/clamav/pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ $app := .Values.clamav }}
{{ $_ := set .Values "appName" $app.name }}
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Values.appName }}-db
labels:
{{- include "licensify.labels" . | nindent 4 }}
spec:
capacity:
storage: {{ .Values.nfs.storage }}
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
nfs:
server: {{ .Values.assetManagerNFS }}
path: /clamav-db
readOnly: true
19 changes: 19 additions & 0 deletions charts/licensify/templates/clamav/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{ $app := .Values.clamav }}
{{ $_ := set .Values "appName" $app.name }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.appName }}-db
labels:
{{- include "licensify.labels" . | nindent 4 }}
app: {{ .Values.appName }}
app.kubernetes.io/name: {{ .Values.appName }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.nfs.storage }}
selector:
matchLabels:
{{- include "licensify.selectorLabels" . | nindent 6 }}
3 changes: 3 additions & 0 deletions charts/licensify/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ nginx:
requests:
cpu: 50m
memory: 512Mi
nfs:
# Value is arbitrary and used to check PersistentVolume and PersistentVolumeClaim compatibility
storage: 15Gi

apps:
licensifyAdmin:
Expand Down

0 comments on commit aeb9693

Please sign in to comment.