diff --git a/charts/nautobot/templates/nautobot-deployment.yaml b/charts/nautobot/templates/nautobot-deployment.yaml index 2cff420f..4e860c4e 100644 --- a/charts/nautobot/templates/nautobot-deployment.yaml +++ b/charts/nautobot/templates/nautobot-deployment.yaml @@ -280,8 +280,10 @@ spec: volumeMounts: - name: "nautobot-static" mountPath: "/opt/nautobot/static" + {{- if $nautobot.persistenceMediaFiles.enabled }} - name: "nautobot-media" mountPath: "/opt/nautobot/media" + {{- end }} - name: "git-repos" mountPath: "/opt/nautobot/git" - name: "nautobot-config" @@ -416,12 +418,10 @@ spec: {{- else }} emptyDir: {} {{- end }} - - name: "nautobot-media" {{- if $nautobot.persistenceMediaFiles.enabled }} + - name: "nautobot-media" persistentVolumeClaim: claimName: {{ include "common.names.fullname" $ }}-media - {{- else }} - emptyDir: {} {{- end }} - name: "git-repos" emptyDir: {} diff --git a/charts/nautobot/templates/pvc-media.yaml b/charts/nautobot/templates/pvc-media.yaml deleted file mode 100644 index 1e5c68d8..00000000 --- a/charts/nautobot/templates/pvc-media.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if .Values.nautobot.enabled -}} -{{- if .Values.nautobot.persistenceMediaFiles.enabled -}} ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "common.names.fullname" $ }}-media - namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} - app.kubernetes.io/component: nautobot-media-pvc - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - {{- if .Values.nautobot.persistenceMediaFiles.storageClassName }} - {{- if (eq "-" .Values.nautobot.persistenceMediaFiles.storageClassName) }} - storageClassName: "" - {{- else }} - storageClassName: {{ .Values.nautobot.persistenceMediaFiles.storageClassName | quote }} - {{- end }} - {{- end }} - accessModes: - - {{ .Values.nautobot.persistenceMediaFiles.accessMode | quote }} - resources: - requests: - storage: {{ .Values.nautobot.persistenceMediaFiles.size | quote }} - {{- with .Values.nautobot.persistenceMediaFiles.selector }} - selector: - {{- toYaml . | nindent 4 }} - {{- end }} -{{ end -}} -{{ end -}} diff --git a/charts/nautobot/templates/pvc-static.yaml b/charts/nautobot/templates/pvc.yaml similarity index 51% rename from charts/nautobot/templates/pvc-static.yaml rename to charts/nautobot/templates/pvc.yaml index 1418857a..cd686aea 100644 --- a/charts/nautobot/templates/pvc-static.yaml +++ b/charts/nautobot/templates/pvc.yaml @@ -32,4 +32,37 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} {{ end -}} +{{- if .Values.nautobot.persistenceMediaFiles.enabled -}} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "common.names.fullname" $ }}-media + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "common.labels.standard" $ | nindent 4 }} + app.kubernetes.io/component: nautobot-media-pvc + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + {{- if .Values.nautobot.persistenceMediaFiles.storageClassName }} + {{- if (eq "-" .Values.nautobot.persistenceMediaFiles.storageClassName) }} + storageClassName: "" + {{- else }} + storageClassName: {{ .Values.nautobot.persistenceMediaFiles.storageClassName | quote }} + {{- end }} + {{- end }} + accessModes: + - {{ .Values.nautobot.persistenceMediaFiles.accessMode | quote }} + resources: + requests: + storage: {{ .Values.nautobot.persistenceMediaFiles.size | quote }} + {{- with .Values.nautobot.persistenceMediaFiles.selector }} + selector: + {{- toYaml . | nindent 4 }} + {{- end }} +{{ end -}} {{ end -}}