You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by da...@apache.org on 2018/12/03 01:44:59 UTC

[incubator-openwhisk-deploy-kube] branch master updated: cleanup specification of storageclasses and persistence (#378)

This is an automated email from the ASF dual-hosted git repository.

daisyguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git


The following commit(s) were added to refs/heads/master by this push:
     new c4303a8  cleanup specification of storageclasses and persistence (#378)
c4303a8 is described below

commit c4303a8f2cbfbd49707254589ce7349c81511fff
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Sun Dec 2 20:44:54 2018 -0500

    cleanup specification of storageclasses and persistence (#378)
    
    Rename persistence variables in values.yaml to better reflect
    what they actually mean. Update docs to match.
    
    Remove special instructions for persistence on
    Docker Desktop 18.06 (not actually needed).
    
    Fixes #376.
---
 docs/configurationChoices.md                       | 20 ++++++++++---------
 docs/k8s-docker-for-mac.md                         | 23 ----------------------
 docs/k8s-ibm-private.md                            |  6 ++++--
 docs/k8s-ibm-public.md                             | 18 +++++++++++++----
 docs/k8s-nfs-dynamic-storage.md                    |  6 ++++--
 helm/openwhisk/README.md                           |  2 +-
 helm/openwhisk/templates/couchdb-pvc.yaml          |  4 ++--
 helm/openwhisk/templates/kafka-pvc.yaml            |  4 ++--
 helm/openwhisk/templates/provider-alarm-pvc.yaml   |  4 ++--
 .../openwhisk/templates/provider-cloudant-pvc.yaml |  4 ++--
 helm/openwhisk/templates/redis-pvc.yaml            |  4 ++--
 helm/openwhisk/templates/zookeeper-pod.yaml        |  8 ++++----
 helm/openwhisk/templates/zookeeper-pvc-data.yaml   |  4 ++--
 .../openwhisk/templates/zookeeper-pvc-datalog.yaml |  4 ++--
 helm/openwhisk/values.yaml                         |  4 ++--
 15 files changed, 54 insertions(+), 61 deletions(-)

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: