You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/12/03 01:44:57 UTC

[GitHub] daisy-ycguo closed pull request #378: cleanup specification of storageclasses and persistence

daisy-ycguo closed pull request #378: cleanup specification of storageclasses and persistence
URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/378
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/configurationChoices.md b/docs/configurationChoices.md
index 3ffad96..ad1a448 100644
--- a/docs/configurationChoices.md
+++ b/docs/configurationChoices.md
@@ -178,20 +178,22 @@ See [NFS Dynamis Storage Provisioning](./k8s-nfs-dynamic-storage.md) for one
 approach to provisioning dynamic storage if it's not already provisioned
 on your cluster.
 
-If your cluster is not properly configured, then you will need to
-manually create the necessary PersistentVolumes when deploying the
-Helm chart. In this case, you should also disable the use of dynamic
-provisioning by the Helm chart by adding the following stanza to your
-mycluster.yaml
+If your cluster is not thus configured and you want to use persistence,
+then you will need to add the following stanza to your mycluster.yaml.
 ```yaml
 k8s:
   persistence:
-    useDynamicProvisioning: false
+    hasDefaultStorageClass: false
+    explicitStorageClass: <DESIRED_STORAGE_CLASS_NAME>
 ```
+If <DESIRED_STORAGE_CLASS_NAME> has a dynamic provisioner, deploying
+the Helm chart will automatically create the required PersistentVolumes.
+If <DESIRED_STORAGE_CLASS_NAME> does not have a dynamic provisioner,
+then you will need to manually create the required persistent volumes.
 
-You may disable persistence entirely by adding the following stanza to
-your mycluster.yaml:
-```
+Alternatively, you may also entirely disable the usage of persistence
+by adding the following stanza to your mycluster.yaml:
+```yaml
 k8s:
   persistence:
     enabled: false
diff --git a/docs/k8s-docker-for-mac.md b/docs/k8s-docker-for-mac.md
index 5f1ca22..1b95f68 100644
--- a/docs/k8s-docker-for-mac.md
+++ b/docs/k8s-docker-for-mac.md
@@ -64,29 +64,6 @@ nginx:
   httpsNodePort: 31001
 ```
 
-#### Additional Configuration for Docker for Mac 18.06
-
-If you are using Docker for Mac 18.06, you will need
-to add an additional stanza to your mycluster.yaml because
-this version does not have out-of-the-box support for automatic
-dynamic provisioning of persistent volumes. This additional
-configuration is not needed if you are using Docker for Mac 2.0.0
-or later.
-
-For 18.06 you should either set the defaultStorageClass
-by adding the stanza below to mycluster.yaml:
-```yaml
-k8s:
-  persistence:
-    defaultStorageClass: hostpath
-```
-or completely disable the use of persistence by adding the stanza below:
-```yaml
-k8s:
-  persistence:
-    enabled: false
-```
-
 ## Hints and Tips
 
 One nice feature of using Kubernetes in Docker, is that the
diff --git a/docs/k8s-ibm-private.md b/docs/k8s-ibm-private.md
index 53b429d..eccaf9b 100644
--- a/docs/k8s-ibm-private.md
+++ b/docs/k8s-ibm-private.md
@@ -152,7 +152,8 @@ whisk:
 
 k8s:
   persistence:
-    defaultStorageClass: openwhisk
+    hasDefaultStorageClass: false
+    explicitStorageClass: openwhisk
 ```
 
 ICP does not (by default) provide a properly configured DefaultStorageClass,
@@ -178,7 +179,8 @@ nginx:
 
 k8s:
   persistence:
-    defaultStorageClass: openwhisk
+    hasDefaultStorageClass: false
+    explicitStorageClass: openwhisk
 ```
 
 ICP does not (by default) provide a properly configured DefaultStorageClass,
diff --git a/docs/k8s-ibm-public.md b/docs/k8s-ibm-public.md
index f7f9820..5b3c75d 100644
--- a/docs/k8s-ibm-public.md
+++ b/docs/k8s-ibm-public.md
@@ -97,12 +97,17 @@ whisk:
 
 k8s:
   persistence:
-    defaultStorageClass: default
+    hasDefaultStorageClass: false
+    explicitStorageClass: default
 ```
 
 IKS does not provide a properly configured DefaultStorageClass,
 instead you need to tell the Helm chart to use the `default`
-StorageClassName as shown above.
+StorageClassName as shown above. This StorageClass does have
+a dynamic provisioner, so it is not necessary to manually create
+the PersistentVolumes. Note that it is not unusual for it to take
+several minutes for your PersistentVolumes to be created
+(dependent resources will be in `Pending` state).
 
 ####  IBM Cloud Lite cluster
 
@@ -125,12 +130,17 @@ nginx:
 
 k8s:
   persistence:
-    defaultStorageClass: default
+    hasDefaultStorageClass: false
+    explicitStorageClass: default
 ```
 
 IKS does not provide a properly configured DefaultStorageClass,
 instead you need to tell the Helm chart to use the `default`
-StorageClassName as shown above.
+StorageClassName as shown above. This StorageClass does have
+a dynamic provisioner, so it is not necessary to manually create
+the PersistentVolumes. Note that it is not unusual for it to take
+several minutes for your PersistentVolumes to be created
+(dependent resources will be in `Pending` state).
 
 ## Hints and Tips
 
diff --git a/docs/k8s-nfs-dynamic-storage.md b/docs/k8s-nfs-dynamic-storage.md
index 1c62c27..df2b4be 100644
--- a/docs/k8s-nfs-dynamic-storage.md
+++ b/docs/k8s-nfs-dynamic-storage.md
@@ -57,5 +57,7 @@ helm install --namespace openwhisk \
   stable/nfs-client-provisioner
 ```
 
-When you configure OpenWhisk, do remember to set the `k8s.persistence.defaultStorageClass`
-to be `openwhisk`.  And then you should be off to the races.
+When you configure OpenWhisk, do remember to set
+`k8s.persistence.hasDefaultStorageClass` to `false` and set
+`k8s.persistence.explicitStorageClass` to be `openwhisk`.
+And then you should be off to the races.
diff --git a/helm/openwhisk/README.md b/helm/openwhisk/README.md
index 3026efc..c2810e1 100644
--- a/helm/openwhisk/README.md
+++ b/helm/openwhisk/README.md
@@ -72,7 +72,7 @@ This chart requires 5 Persistent Volumes to be created to avoid loss of data.  O
 
 * When the chart is deployed, the value `k8s.persistence.enabled` is set to false to disable usage of Persistent Volumes (for development and test activities).
 * The Kubernetes cluster supports Dynamic Volume Provisioning and has a default StorageClass defined with an associated provisioner.
-* The Kubernetes cluster supports Dynamic Volume Provisioning and when the chart is deployed, the value `k8s.persistence.defaultStorageClass` is set to a StorageClass which has an associated provisioner.
+* The Kubernetes cluster supports Dynamic Volume Provisioning and when the chart is deployed, the value `k8s.persistence.hasDefaultStorageClass` is set to `false` and `k8s.persistence.explicitStorageClass` is set to a StorageClass which has an associated provisioner.
 
 ### PodSecurityPolicy Requirements
 
diff --git a/helm/openwhisk/templates/couchdb-pvc.yaml b/helm/openwhisk/templates/couchdb-pvc.yaml
index f682304..0f6ce28 100644
--- a/helm/openwhisk/templates/couchdb-pvc.yaml
+++ b/helm/openwhisk/templates/couchdb-pvc.yaml
@@ -9,8 +9,8 @@ metadata:
   labels:
 {{ include "openwhisk.label_boilerplate" . | indent 4 }}
 spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-  storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+  storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
   accessModes:
     - ReadWriteOnce
diff --git a/helm/openwhisk/templates/kafka-pvc.yaml b/helm/openwhisk/templates/kafka-pvc.yaml
index 651ff36..f16839a 100644
--- a/helm/openwhisk/templates/kafka-pvc.yaml
+++ b/helm/openwhisk/templates/kafka-pvc.yaml
@@ -9,8 +9,8 @@ metadata:
   labels:
 {{ include "openwhisk.label_boilerplate" . | indent 4 }}
 spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-  storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+  storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
   accessModes:
     - ReadWriteOnce
diff --git a/helm/openwhisk/templates/provider-alarm-pvc.yaml b/helm/openwhisk/templates/provider-alarm-pvc.yaml
index 40d1fd7..a45c9a8 100644
--- a/helm/openwhisk/templates/provider-alarm-pvc.yaml
+++ b/helm/openwhisk/templates/provider-alarm-pvc.yaml
@@ -9,8 +9,8 @@ metadata:
   labels:
 {{ include "openwhisk.label_boilerplate" . | indent 4 }}
 spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-  storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+  storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
   accessModes:
     - ReadWriteOnce
diff --git a/helm/openwhisk/templates/provider-cloudant-pvc.yaml b/helm/openwhisk/templates/provider-cloudant-pvc.yaml
index 04f5028..4b49879 100644
--- a/helm/openwhisk/templates/provider-cloudant-pvc.yaml
+++ b/helm/openwhisk/templates/provider-cloudant-pvc.yaml
@@ -9,8 +9,8 @@ metadata:
   labels:
 {{ include "openwhisk.label_boilerplate" . | indent 4 }}
 spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-  storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+  storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
   accessModes:
     - ReadWriteOnce
diff --git a/helm/openwhisk/templates/redis-pvc.yaml b/helm/openwhisk/templates/redis-pvc.yaml
index 8d3852b..d5dfa1c 100644
--- a/helm/openwhisk/templates/redis-pvc.yaml
+++ b/helm/openwhisk/templates/redis-pvc.yaml
@@ -9,8 +9,8 @@ metadata:
   labels:
 {{ include "openwhisk.label_boilerplate" . | indent 4 }}
 spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-  storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+  storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
   accessModes:
     - ReadWriteOnce
diff --git a/helm/openwhisk/templates/zookeeper-pod.yaml b/helm/openwhisk/templates/zookeeper-pod.yaml
index d8c3439..7199004 100644
--- a/helm/openwhisk/templates/zookeeper-pod.yaml
+++ b/helm/openwhisk/templates/zookeeper-pod.yaml
@@ -72,8 +72,8 @@ spec:
   - metadata:
       name: "{{- .Values.zookeeper.persistence.pvcName -}}-data"
     spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-      storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+      storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
       accessModes:
         - ReadWriteOnce
@@ -83,8 +83,8 @@ spec:
   - metadata:
       name: "{{- .Values.zookeeper.persistence.pvcName -}}-datalog"
     spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-      storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+      storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
       accessModes:
         - ReadWriteOnce
diff --git a/helm/openwhisk/templates/zookeeper-pvc-data.yaml b/helm/openwhisk/templates/zookeeper-pvc-data.yaml
index 6bef2d7..9d04e20 100644
--- a/helm/openwhisk/templates/zookeeper-pvc-data.yaml
+++ b/helm/openwhisk/templates/zookeeper-pvc-data.yaml
@@ -9,8 +9,8 @@ metadata:
   labels:
 {{ include "openwhisk.label_boilerplate" . | indent 4 }}
 spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-  storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+  storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
   accessModes:
     - ReadWriteOnce
diff --git a/helm/openwhisk/templates/zookeeper-pvc-datalog.yaml b/helm/openwhisk/templates/zookeeper-pvc-datalog.yaml
index 7526a39..a99b757 100644
--- a/helm/openwhisk/templates/zookeeper-pvc-datalog.yaml
+++ b/helm/openwhisk/templates/zookeeper-pvc-datalog.yaml
@@ -9,8 +9,8 @@ metadata:
   labels:
 {{ include "openwhisk.label_boilerplate" . | indent 4 }}
 spec:
-{{- if .Values.k8s.persistence.useDynamicProvisioning }}
-  storageClassName: {{ .Values.k8s.persistence.defaultStorageClass }}
+{{- if not .Values.k8s.persistence.hasDefaultStorageClass }}
+  storageClassName: {{ .Values.k8s.persistence.explicitStorageClass }}
 {{- end }}
   accessModes:
     - ReadWriteOnce
diff --git a/helm/openwhisk/values.yaml b/helm/openwhisk/values.yaml
index 3d1524e..87fb1d9 100644
--- a/helm/openwhisk/values.yaml
+++ b/helm/openwhisk/values.yaml
@@ -74,8 +74,8 @@ k8s:
   dns: kube-dns.kube-system
   persistence:
     enabled: true
-    useDynamicProvisioning: true
-    defaultStorageClass:               # intentionally left blank, which will result in using the default storageclass
+    hasDefaultStorageClass: true
+    explicitStorageClass: nil
 
 # Images used to run auxillary tasks/jobs
 utility:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services