netbox: Finish persistence configuration

This commit is contained in:
Alexander Olofsson 2019-07-05 10:28:32 +02:00
parent 726dbbbf97
commit c78d430e68
No known key found for this signature in database
GPG key ID: D439C9470CB04C73
4 changed files with 34 additions and 6 deletions

View file

@ -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

View file

@ -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 }}

View 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 -}}

View file

@ -110,6 +110,10 @@ extraVolumeMounts: []
persistence:
enabled: false
# existingClaim: netbox-data
# storageClass: "-"
accessMode: ReadWriteOnce
size: 10Gi
worker:
enabled: false