From 6028007fc0dc5d7dd823c3521623a45afea6c7e1 Mon Sep 17 00:00:00 2001 From: Uros Bajzelj Date: Fri, 26 Sep 2025 12:55:37 +0200 Subject: [PATCH] add support to define the volumes for static and media files --- charts/nautobot/templates/nautobot-deployment.yaml | 5 ++++- charts/nautobot/values.yaml | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/nautobot/templates/nautobot-deployment.yaml b/charts/nautobot/templates/nautobot-deployment.yaml index 0755b234..fff80bb5 100644 --- a/charts/nautobot/templates/nautobot-deployment.yaml +++ b/charts/nautobot/templates/nautobot-deployment.yaml @@ -433,12 +433,15 @@ spec: persistentVolumeClaim: claimName: {{ include "common.names.fullname" $ }}-static {{- else }} - emptyDir: {} + {{- toYaml $nautobot.staticFilesVolume | nindent 10 }} {{- end }} {{- if $nautobot.persistenceMediaFiles.enabled }} - name: "nautobot-media" persistentVolumeClaim: claimName: {{ include "common.names.fullname" $ }}-media + {{- else if $nautobot.mediaFilesVolume }} + - name: "nautobot-media" + {{- toYaml $nautobot.mediaFilesVolume | nindent 10 }} {{- end }} - name: "git-repos" emptyDir: {} diff --git a/charts/nautobot/values.yaml b/charts/nautobot/values.yaml index 65c59beb..b618718e 100644 --- a/charts/nautobot/values.yaml +++ b/charts/nautobot/values.yaml @@ -252,6 +252,10 @@ nautobot: value: 2 periodSeconds: 15 + # --- Define the volume for the static files + staticFilesVolume: + emptyDir: {} + # Add a Persistent Volume Claim for Nautobot static files persistenceStaticFiles: # --- Enable PVC and the relevant volumes @@ -269,6 +273,9 @@ nautobot: # matchLabel: # nautobot-storage: static + # --- Define the volume for the media files + mediaFilesVolume: {} + # Add a Persistent Volume Claim for Nautobot media files persistenceMediaFiles: # --- Enable PVC and the relevant volumes