diff --git a/incubator/zookeeper/Chart.yaml b/incubator/zookeeper/Chart.yaml index f742cc9150..6dd1fec6f9 100755 --- a/incubator/zookeeper/Chart.yaml +++ b/incubator/zookeeper/Chart.yaml @@ -1,6 +1,6 @@ name: zookeeper home: https://zookeeper.apache.org/ -version: 0.4.7 +version: 0.5.0 description: Centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. icon: https://zookeeper.apache.org/images/zookeeper_small.gif diff --git a/incubator/zookeeper/README.md b/incubator/zookeeper/README.md index d4ceb9bcfb..e61eeaf5d8 100644 --- a/incubator/zookeeper/README.md +++ b/incubator/zookeeper/README.md @@ -71,8 +71,13 @@ The configuration parameters in this section control the resources requested and | `resources.requests.cpu` | The amount of CPU to request. As ZooKeeper is not very CPU intensive, `2` is a good choice to start with for a production deployment. | `500m` | | `heap` | The amount of JVM heap that the ZooKeeper servers will use. As ZooKeeper stores all of its data in memory, this value should reflect the size of your working set. The JVM -Xms/-Xmx format is used. |`2G` | | `resources.requests.memory` | The amount of memory to request. This value should be at least 2 GiB larger than `heap` to avoid swapping. You may want to use `1.5 * heap` for values larger than 2GiB. The Kubernetes format is used. |`2Gi` | -| `storage` | The amount of storage to request. Even though ZooKeeper keeps is working set in memory, it logs all transactions, and periodically snapshots, to storage media. The amount of storage required will vary with your workload, working memory size, and log and snapshot retention policy. Note that, on some cloud providers selecting a small volume size will result is sub-par I/O performance. 250 GiB is a good place to start for production workloads. | `50Gi`| -| `storageClass` | The storage class of the storage allocated for the ensemble. If this value is present, it will add an annotation asking the PV Provisioner for that storage class. | `default` | + +### Persistence +| Parameter | Description | Default | +| --------- | ----------- | ------- | +| `persistence.enabled` | Whether to create a PVC. If `false`, an `emptyDir` on the host will be used. | `true` | +| `persistence.size` | Size of PVC that gets created. For production deployments this value should likely be much larger. | `5Gi` | +| `persistence.storageClass` | Valid options: `nil`, `"-"`, or storage class name. See values.yaml for details. | `nil` | ### Network These parameters control the network ports on which the ensemble communicates. diff --git a/incubator/zookeeper/templates/statefulset.yaml b/incubator/zookeeper/templates/statefulset.yaml index 2387144cc7..36d378f014 100644 --- a/incubator/zookeeper/templates/statefulset.yaml +++ b/incubator/zookeeper/templates/statefulset.yaml @@ -87,11 +87,17 @@ spec: - name: datadir mountPath: /var/lib/zookeeper subPath: data + {{ if not .Values.persistence.enabled }} + volumes: + - name: datadir + emptyDir: {} + {{- end }} {{- if eq .Values.security.enabled true }} securityContext: runAsUser: {{ .Values.security.runAsUser }} fsGroup: {{ .Values.security.fsGroup }} {{- end }} + {{- if .Values.persistence.enabled }} volumeClaimTemplates: - metadata: name: datadir @@ -99,7 +105,12 @@ spec: accessModes: [ "ReadWriteOnce" ] resources: requests: - storage: {{ .Values.storage }} - {{- if .Values.storageClass }} - storageClassName: {{ .Values.storageClass | quote }} + storage: {{ .Values.persistence.size }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" {{- end }} + {{- end }} + {{- end }} diff --git a/incubator/zookeeper/values.yaml b/incubator/zookeeper/values.yaml index e6baeb0f2d..023a737643 100644 --- a/incubator/zookeeper/values.yaml +++ b/incubator/zookeeper/values.yaml @@ -14,8 +14,6 @@ resources: cpu: 1 memory: 4Gi heap: "2G" -storage: "50Gi" -# storageClass: default serverPort: 2888 leaderElectionPort: 3888 clientPort: 2181 @@ -56,3 +54,22 @@ affinity: {} ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ ## nodeSelector: {} + +## Persistence configuration. Specify if and how to persist data to a persistent volume. +## +persistence: + enabled: true + + ## The size of the PersistentVolume to allocate to each Zookeeper Pod in the StatefulSet. For + ## production servers this number should likely be much larger. + ## + size: "5Gi" + + ## Zookeeper 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: