netbox: Finish persistence configuration
This commit is contained in:
parent
726dbbbf97
commit
c78d430e68
4 changed files with 34 additions and 6 deletions
|
@ -4,4 +4,4 @@ appVersion: "2.6.1"
|
|||
description: An IP address management (IPAM) and data center infrastructure management (DCIM) tool.
|
||||
icon: https://raw.githubusercontent.com/digitalocean/netbox/develop/netbox/project-static/img/netbox.ico
|
||||
name: netbox
|
||||
version: 0.2.3
|
||||
version: 0.3.0
|
||||
|
|
|
@ -44,10 +44,8 @@ spec:
|
|||
readOnly: true
|
||||
- name: netbox-socket
|
||||
mountPath: /tmp/netbox
|
||||
{{- if .Values.persistence.enabled }}
|
||||
- name: data
|
||||
mountPath: /etc/netbox/media
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{ toYaml .Values.extraVolumeMounts | indent 12 }}
|
||||
{{- end }}
|
||||
|
@ -93,11 +91,13 @@ spec:
|
|||
emptyDir: {}
|
||||
- name: netbox-socket
|
||||
emptyDir: {}
|
||||
{{- if .Values.persistence.enabled }}
|
||||
- name: data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "netbox.fullname" . }}
|
||||
{{- end }}
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "netbox.fullname" .) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{ toYaml .Values.extraVolumes | indent 8 }}
|
||||
{{- end }}
|
||||
|
|
24
charts/netbox/templates/pvc.yaml
Normal file
24
charts/netbox/templates/pvc.yaml
Normal file
|
@ -0,0 +1,24 @@
|
|||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "netbox.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "netbox.name" . }}
|
||||
helm.sh/chart: {{ include "netbox.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.persistence.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
|
@ -110,6 +110,10 @@ extraVolumeMounts: []
|
|||
|
||||
persistence:
|
||||
enabled: false
|
||||
# existingClaim: netbox-data
|
||||
# storageClass: "-"
|
||||
accessMode: ReadWriteOnce
|
||||
size: 10Gi
|
||||
|
||||
worker:
|
||||
enabled: false
|
||||
|
|
Loading…
Reference in a new issue