Example of NFS storage class for netbox chart 15/61115/8
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Fri, 17 Aug 2018 17:57:47 +0000 (13:57 -0400)
committerAlexis de Talhouët <adetalhouet89@gmail.com>
Wed, 29 Aug 2018 18:25:12 +0000 (14:25 -0400)
Change-Id: I415184938523e12a6e2459bbadc9f77de3ac1a40
Issue-ID: CCSDK-366
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml
kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml
kubernetes/contrib/charts/netbox/charts/netbox-app/values.yaml
kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pv.yaml
kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pvc.yaml
kubernetes/contrib/charts/netbox/charts/netbox-postgres/values.yaml

index eacd495..f741cba 100755 (executable)
@@ -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 -}}
index b911d23..8fbd454 100755 (executable)
@@ -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:
index 9d5060d..49a96eb 100755 (executable)
@@ -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: <storageClass>
-  ## 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
index 882aed7..a19f500 100755 (executable)
@@ -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
index a3813f1..7760211 100755 (executable)
@@ -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:
index 06127e3..c54c3a6 100755 (executable)
@@ -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: <storageClass>
-  ## 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