From 8f0d2e828eeb0a35e3b45d92fa0c9c726a0f70c5 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 17 Aug 2018 13:57:47 -0400 Subject: Example of NFS storage class for netbox chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I415184938523e12a6e2459bbadc9f77de3ac1a40 Issue-ID: CCSDK-366 Signed-off-by: Alexis de Talhouët --- .../charts/netbox/charts/netbox-app/templates/pv.yaml | 2 ++ .../charts/netbox/charts/netbox-app/templates/pvc.yaml | 4 +++- .../charts/netbox/charts/netbox-app/values.yaml | 17 +---------------- .../netbox/charts/netbox-postgres/templates/pv.yaml | 2 ++ .../netbox/charts/netbox-postgres/templates/pvc.yaml | 4 +++- .../charts/netbox/charts/netbox-postgres/values.yaml | 18 ++---------------- 6 files changed, 13 insertions(+), 34 deletions(-) (limited to 'kubernetes/contrib/charts/netbox') diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml index eacd4959e8..f741cba64c 100755 --- a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml @@ -15,6 +15,7 @@ */}} {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +{{- if not .Values.persistence.storageClass -}} kind: PersistentVolume apiVersion: v1 metadata: @@ -35,3 +36,4 @@ spec: hostPath: path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/app {{- end -}} +{{- end -}} diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml index b911d239e5..8fbd4544dc 100755 --- a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml @@ -27,12 +27,14 @@ metadata: heritage: "{{ .Release.Service }}" {{- if .Values.persistence.annotations }} annotations: -{{ toYaml .Values.persistence.annotations | indent 4 }} +{{ .Values.persistence.annotations | indent 4 }} {{- end }} spec: +{{- if not .Values.persistence.storageClass -}} selector: matchLabels: name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }} +{{- end }} accessModes: - {{ .Values.persistence.accessMode }} resources: diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/values.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/values.yaml index 9d5060de03..49a96eb053 100755 --- a/kubernetes/contrib/charts/netbox/charts/netbox-app/values.yaml +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/values.yaml @@ -77,25 +77,10 @@ affinity: {} ## Persist data to a persitent volume persistence: enabled: true - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: volumeReclaimPolicy: Retain - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" accessMode: ReadWriteMany size: 100Mi - mountPath: /dockerdata-nfs - mountSubPath: netbox/shared + storageClass: "nfs-dev-sc" # Names used for shared pv/pvcs across App & Nginx containers staticPvName: netbox-static diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pv.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pv.yaml index 882aed7cef..a19f5001e5 100755 --- a/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pv.yaml +++ b/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pv.yaml @@ -15,6 +15,7 @@ */}} {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +{{- if not .Values.persistence.storageClass -}} kind: PersistentVolume apiVersion: v1 metadata: @@ -35,3 +36,4 @@ spec: hostPath: path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }} {{- end -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pvc.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pvc.yaml index a3813f1af8..77602117a6 100755 --- a/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pvc.yaml +++ b/kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pvc.yaml @@ -27,12 +27,14 @@ metadata: heritage: "{{ .Release.Service }}" {{- if .Values.persistence.annotations }} annotations: -{{ toYaml .Values.persistence.annotations | indent 4 }} +{{ .Values.persistence.annotations | indent 4 }} {{- end }} spec: +{{- if not .Values.persistence.storageClass -}} selector: matchLabels: name: {{ include "common.fullname" . }} +{{- end }} accessModes: - {{ .Values.persistence.accessMode }} resources: diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-postgres/values.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-postgres/values.yaml index 06127e3a1f..c54c3a68f5 100755 --- a/kubernetes/contrib/charts/netbox/charts/netbox-postgres/values.yaml +++ b/kubernetes/contrib/charts/netbox/charts/netbox-postgres/values.yaml @@ -56,25 +56,11 @@ readiness: ## Persist data to a persitent volume persistence: enabled: true - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: volumeReclaimPolicy: Retain - - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" + storageClass: "nfs-dev-sc" accessMode: ReadWriteMany size: 1Gi - mountPath: /dockerdata-nfs - mountSubPath: netbox/postgres/data + service: type: ClusterIP name: netbox-postgres -- cgit 1.2.3-korg