diff --git a/charts/drill/Chart.yaml b/charts/drill/Chart.yaml index d1fdec6..d343b94 100644 --- a/charts/drill/Chart.yaml +++ b/charts/drill/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: drill -version: 1.2.3 +version: 1.2.4 appVersion: 1.21.1 description: Helm Charts for deploying Apache Drill Clusters on Kubernetes icon: https://raw.githubusercontent.com/wearefrank/charts/master/charts/drill/icon.svg diff --git a/charts/drill/README.md b/charts/drill/README.md index ed70acd..9532c7f 100644 --- a/charts/drill/README.md +++ b/charts/drill/README.md @@ -207,3 +207,51 @@ For more options refer to the [Apache Drill documentation](https://drill.apache. | `drill.authentication.users.name` | Username for the user | `""` | | `drill.authentication.users.password` | Password for the user | `""` | | `drill.authentication.users.admin` | Configures if the user should be admin | `""` | + +### Persistence + +Persistence is currently only for login. Configuration for Drill will be saved in ZooKeeper. Make sure that ZooKeeper is persistent if you want to keep changes in the Web UI. + + +### End + +@sectionEnd + +@param persistence.enabled Enable persistence using Persistent Volume Claims + +@param persistence.storageClass 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 + +@param persistence.accessModes [array] Persistent Volume access modes + +@param persistence.size Persistent Volume size + +@param persistence.dataSource Custom PVC data source + +@param persistence.existingClaim The name of an existing PVC to use for persistence + +@param persistence.selector Selector to match an existing Persistent Volume for WordPress data PVC +If set, the PVC can't have a PV dynamically provisioned for it +E.g. +selector: +matchLabels: +app: my-app + +@param persistence.annotations Persistent Volume Claim annotations +You might need to add an annotation for selected node: +E.g: volume.kubernetes.io/selected-node: nodeName +Ref: https://kubernetes.io/docs/reference/labels-annotations-taints/#volume-kubernetes-io-selected-node + + +| Name | Description | Value | +| --------------------------- | ---------------------------------------------------------------------- | ------- | +| `persistence.enabled` | Enable persistence using Persistent Volume Claims | `false` | +| `persistence.storageClass` | Persistent Volume storage class | `""` | +| `persistence.accessModes` | Persistent Volume access modes | `[]` | +| `persistence.size` | Persistent Volume size | `2Gi` | +| `persistence.dataSource` | Custom PVC data source | `{}` | +| `persistence.existingClaim` | The name of an existing PVC to use for persistence | `""` | +| `persistence.selector` | Selector to match an existing Persistent Volume for WordPress data PVC | `{}` | +| `persistence.annotations` | Persistent Volume Claim annotations | `{}` | diff --git a/charts/drill/templates/_labels.tpl b/charts/drill/templates/_labels.tpl index 0ebcd33..eec283d 100644 --- a/charts/drill/templates/_labels.tpl +++ b/charts/drill/templates/_labels.tpl @@ -15,5 +15,6 @@ Selector labels */}} {{- define "drill.selectorLabels" -}} app.kubernetes.io/name: {{ include "drill.name" . }} +app.kubernetes.io/component: {{ include "drill.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} diff --git a/charts/drill/templates/statefulset.yaml b/charts/drill/templates/statefulset.yaml index ba4e5ee..3258b07 100644 --- a/charts/drill/templates/statefulset.yaml +++ b/charts/drill/templates/statefulset.yaml @@ -85,6 +85,8 @@ spec: - mountPath: /etc/passwd name: {{ template "drill.fullname" . }}-users subPath: passwd + - name: {{ template "drill.fullname" . }}-logs + mountPath: /opt/drill/logs terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} volumes: - name: {{ template "drill.fullname" . }}-override @@ -101,7 +103,38 @@ spec: {{- else }} secretName: {{ template "drill.fullname" . }}-users {{- end }} + {{- if and .Values.persistence.enabled .Values.persistence.existingClaim }} + - name: {{ template "drill.fullname" . }}-logs + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} + {{- else if (not .Values.persistence.enabled) }} + - name: {{ template "drill.fullname" . }}-logs + emptyDir: {} + {{- end}} initContainers: - name: zookeeper-available image: busybox command: [ 'sh', '-c', 'until nc -z {{ include "zookeeper.fullname" . }} 2181; do echo Waiting for ZooKeeper to come up; sleep 5; done; ' ] + {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} + volumeClaimTemplates: + - metadata: + name: {{ template "drill.fullname" . }}-logs + labels: + {{- include "drill.labels" . | nindent 10 }} + {{- if .Values.persistence.annotations }} + annotations: + {{- toYaml .Values.persistence.annotations | nindent 10 }} + {{- end }} + spec: + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + selector: + {{- toYaml .Values.persistence.selector | nindent 10 }} + storageClassName: {{ .Values.persistence.storageClass | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- end }} + diff --git a/charts/drill/values.schema.json b/charts/drill/values.schema.json index fd54e2e..d2d74ab 100644 --- a/charts/drill/values.schema.json +++ b/charts/drill/values.schema.json @@ -305,6 +305,56 @@ } } } + }, + "persistence": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable persistence using Persistent Volume Claims", + "default": false + }, + "storageClass": { + "type": "string", + "description": "Persistent Volume storage class", + "default": "" + }, + "accessModes": { + "type": "array", + "description": "Persistent Volume access modes", + "default": [ + "ReadWriteOnce" + ], + "items": { + "type": "string" + } + }, + "size": { + "type": "string", + "description": "Persistent Volume size", + "default": "2Gi" + }, + "dataSource": { + "type": "object", + "description": "Custom PVC data source", + "default": {} + }, + "existingClaim": { + "type": "string", + "description": "The name of an existing PVC to use for persistence", + "default": "" + }, + "selector": { + "type": "object", + "description": "Selector to match an existing Persistent Volume for WordPress data PVC", + "default": {} + }, + "annotations": { + "type": "object", + "description": "Persistent Volume Claim annotations", + "default": {} + } + } } } } \ No newline at end of file diff --git a/charts/drill/values.yaml b/charts/drill/values.yaml index cba2955..3c68db6 100644 --- a/charts/drill/values.yaml +++ b/charts/drill/values.yaml @@ -295,40 +295,45 @@ drill: ## users: [] -#persistence: -# ## @param persistence.enabled Enable persistence using Persistent Volume Claims -# ## -# enabled: true -# ## @param persistence.storageClass 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 -# ## -# storageClass: "" -# ## @param persistence.accessModes [array] Persistent Volume access modes -# ## -# accessModes: -# - ReadWriteOnce -# ## @param persistence.accessMode Persistent Volume access mode (DEPRECATED: use `persistence.accessModes` instead) -# ## -# accessMode: ReadWriteOnce -# ## @param persistence.size Persistent Volume size -# ## -# size: 10Gi -# ## @param persistence.dataSource Custom PVC data source -# ## -# dataSource: {} -# ## @param persistence.existingClaim The name of an existing PVC to use for persistence -# ## -# existingClaim: "" -# ## @param persistence.selector Selector to match an existing Persistent Volume for WordPress data PVC -# ## If set, the PVC can't have a PV dynamically provisioned for it -# ## E.g. -# ## selector: -# ## matchLabels: -# ## app: my-app -# ## -# selector: {} -# ## @param persistence.annotations Persistent Volume Claim annotations -# ## -# annotations: {} +## @section Persistence +## @descriptionStart +## Persistence is currently only for login. Configuration for Drill will be saved in ZooKeeper. Make sure that ZooKeeper is persistent if you want to keep changes in the Web UI. +## @sectionEnd +## +persistence: + ## @param persistence.enabled Enable persistence using Persistent Volume Claims + ## + enabled: false + ## @param persistence.storageClass 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 + ## + storageClass: "" + ## @param persistence.accessModes [array] Persistent Volume access modes + ## + accessModes: + - ReadWriteOnce + ## @param persistence.size Persistent Volume size + ## + size: 2Gi + ## @param persistence.dataSource Custom PVC data source + ## + dataSource: {} + ## @param persistence.existingClaim The name of an existing PVC to use for persistence + ## + existingClaim: "" + ## @param persistence.selector Selector to match an existing Persistent Volume for WordPress data PVC + ## If set, the PVC can't have a PV dynamically provisioned for it + ## E.g. + ## selector: + ## matchLabels: + ## app: my-app + ## + selector: {} + ## @param persistence.annotations Persistent Volume Claim annotations + ## You might need to add an annotation for selected node: + ## E.g: volume.kubernetes.io/selected-node: nodeName + ## Ref: https://kubernetes.io/docs/reference/labels-annotations-taints/#volume-kubernetes-io-selected-node + ## + annotations: {}