From a03dbbb725db45a9e8a106e1b834d41a12450a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bry=C5=84ski?= Date: Sat, 26 Jan 2019 18:08:15 +0100 Subject: [PATCH] [incubator/druid] New Druid Chart (#9314) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Druid Chart Signed-off-by: Maciej Bryński * Druid Chart fixes Signed-off-by: Maciej Bryński * Fix E2E errors Signed-off-by: Maciej Bryński * Fix E2E errors Signed-off-by: Maciej Bryński * Fix E2E errors Signed-off-by: Maciej Bryński * fix druid typo Signed-off-by: Paul Czarkowski --- incubator/druid/.helmignore | 21 ++ incubator/druid/Chart.yaml | 16 ++ incubator/druid/OWNERS | 4 + incubator/druid/README.md | 157 ++++++++++++ incubator/druid/requirements.lock | 9 + incubator/druid/requirements.yaml | 9 + incubator/druid/templates/NOTES.txt | 19 ++ incubator/druid/templates/_helpers.tpl | 74 ++++++ .../druid/templates/broker/deployment.yaml | 89 +++++++ incubator/druid/templates/broker/ingress.yaml | 39 +++ incubator/druid/templates/broker/service.yaml | 21 ++ .../templates/coordinator/deployment.yaml | 89 +++++++ .../druid/templates/coordinator/ingress.yaml | 39 +++ .../druid/templates/coordinator/service.yaml | 21 ++ .../druid/templates/historical/ingress.yaml | 39 +++ incubator/druid/templates/historical/pdb.yaml | 24 ++ .../druid/templates/historical/service.yaml | 21 ++ .../templates/historical/statefulset.yaml | 141 ++++++++++ .../templates/middleManager/ingress.yaml | 39 +++ .../druid/templates/middleManager/pdb.yaml | 24 ++ .../templates/middleManager/service.yaml | 21 ++ .../templates/middleManager/statefulset.yaml | 141 ++++++++++ .../druid/templates/overlord/deployment.yaml | 89 +++++++ .../druid/templates/overlord/ingress.yaml | 39 +++ .../druid/templates/overlord/service.yaml | 21 ++ incubator/druid/values.yaml | 240 ++++++++++++++++++ 26 files changed, 1446 insertions(+) create mode 100644 incubator/druid/.helmignore create mode 100644 incubator/druid/Chart.yaml create mode 100644 incubator/druid/OWNERS create mode 100644 incubator/druid/README.md create mode 100644 incubator/druid/requirements.lock create mode 100644 incubator/druid/requirements.yaml create mode 100644 incubator/druid/templates/NOTES.txt create mode 100644 incubator/druid/templates/_helpers.tpl create mode 100644 incubator/druid/templates/broker/deployment.yaml create mode 100644 incubator/druid/templates/broker/ingress.yaml create mode 100644 incubator/druid/templates/broker/service.yaml create mode 100644 incubator/druid/templates/coordinator/deployment.yaml create mode 100644 incubator/druid/templates/coordinator/ingress.yaml create mode 100644 incubator/druid/templates/coordinator/service.yaml create mode 100644 incubator/druid/templates/historical/ingress.yaml create mode 100644 incubator/druid/templates/historical/pdb.yaml create mode 100644 incubator/druid/templates/historical/service.yaml create mode 100644 incubator/druid/templates/historical/statefulset.yaml create mode 100644 incubator/druid/templates/middleManager/ingress.yaml create mode 100644 incubator/druid/templates/middleManager/pdb.yaml create mode 100644 incubator/druid/templates/middleManager/service.yaml create mode 100644 incubator/druid/templates/middleManager/statefulset.yaml create mode 100644 incubator/druid/templates/overlord/deployment.yaml create mode 100644 incubator/druid/templates/overlord/ingress.yaml create mode 100644 incubator/druid/templates/overlord/service.yaml create mode 100644 incubator/druid/values.yaml diff --git a/incubator/druid/.helmignore b/incubator/druid/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/incubator/druid/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/incubator/druid/Chart.yaml b/incubator/druid/Chart.yaml new file mode 100644 index 0000000000..af81bc9e74 --- /dev/null +++ b/incubator/druid/Chart.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +appVersion: 0.12.3 +description: Apache Druid (incubating) is a high performance analytics data store for event-driven data. +name: druid +version: 0.1.0 +home: http://druid.io/ +icon: http://druid.io/img/druid_nav.png +maintainers: + - name: maver1ck + email: maciek@brynski.pl +sources: + - https://github.com/apache/incubator-druid +keywords: + - olap + - database + - analytics diff --git a/incubator/druid/OWNERS b/incubator/druid/OWNERS new file mode 100644 index 0000000000..c93ad56df0 --- /dev/null +++ b/incubator/druid/OWNERS @@ -0,0 +1,4 @@ +approvers: +- maver1ck +reviewers: +- maver1ck diff --git a/incubator/druid/README.md b/incubator/druid/README.md new file mode 100644 index 0000000000..418d436728 --- /dev/null +++ b/incubator/druid/README.md @@ -0,0 +1,157 @@ +# Apache Druid + +[Apache Druid (incubating)](http://druid.io/) is a high performance analytics data store for event-driven data. + + +## Install Chart + +To install the Druid Chart into your Kubernetes cluster : + +```bash +helm install --namespace "druid" --name "druid" incubator/druid +``` + +After installation succeeds, you can get a status of Chart + +```bash +helm status "druid" +``` + +If you want to delete your Chart, use this command: + +```bash +helm delete --purge "druid" +``` + +### Helm ingresses + +The Chart provides ingress configuration to allow customization the installation by adapting +the `values.yaml` depending on your setup. +Please read the comments in the `values.yaml` file for more details on how to configure your reverse +proxy or load balancer. + +### Chart Prefix + +This Helm automatically prefixes all names using the release name to avoid collisions. + +### URL prefix + +This chart exposes 5 endpoints: + +- Druid Overlord +- Druid Broker +- Druid Coordinator +- Druid Historical +- Druid Middle Manager + + +### Druid configuration + +Druid configuration can be changed by using environment variables from Docker image. + +See the +[Druid Docker entry point](https://github.com/maver1ck/druid-docker/blob/historical/start-druid.sh) +for more informations + +### Middle Manager and Historical Statefulset + +Middle Managers and Historicals uses StatefulSet. Persistence is enabled by default. + + +## Helm chart Configuration + +The following table lists the configurable parameters of the Druid chart and their default values. + +| Parameter | Description | Default | +|------------------------------------------|---------------------------------------------------------|---------------------------| +| `image.repository` | Container image name | `maver1ckpl/druid-docker` | +| `image.tag` | Container image tag | `0.12.3-1` | +| `image.pullPolicy` | Container pull policy | `IfNotPresent` | +| `env` | Custom env variables for all components | `` | +| `historical.name` | historical component name | `historical` | +| `historical.replicaCount` | historical node replicas (deployment) | `1` | +| `historical.port` | port of historical component | `8083` | +| `historical.serviceType` | service type for service | `ClusterIP` | +| `historical.resources` | historical node resources requests & limits | `{}` | +| `historical.podAnnotations` | historical Deployment annotations | `{}` | +| `historical.nodeSelector` | Node labels for historical pod assignment | `{}` | +| `historical.tolerations` | historical tolerations | `[]` | +| `historical.javaOpts` | historical node java options | `-Xms2G -Xmx2G -XX:MaxDirectMemorySize=8g` | +| `historical.persistence.enabled` | historical persistent enabled/disabled | `true` | +| `historical.persistence.size` | historical persistent volume size | `4Gi` | +| `historical.persistence.storageClass` | historical persistent volume Class | `nil` | +| `historical.persistence.accessMode` | historical persistent Access Mode | `ReadWriteOnce` | +| `historical.antiAffinity` | historical anti-affinity policy | `soft` | +| `historical.nodeAffinity` | historical node affinity policy | `{}` | +| `historical.ingress.enabled` | enable ingress | `false` | +| `historical.ingress.hosts` | hosts for the historical api | `[ "chart-example.local" ]` | +| `historical.ingress.path` | path of the historical api | `/` | +| `historical.ingress.annotations` | annotations for the historical api ingress | `{}` | +| `historical.ingress.tls` | TLS configuration for the ingress | `[]` | +| `middleManager.name` | middleManager component name | `middleManager` | +| `middleManager.replicaCount` | middleManager node replicas (deployment) | `1` | +| `middleManager.port` | port of middleManager component | `8091` | +| `middleManager.serviceType` | service type for service | `ClusterIP` | +| `middleManager.resources` | middleManager node resources requests & limits | `{}` | +| `middleManager.podAnnotations` | middleManager Deployment annotations | `{}` | +| `middleManager.nodeSelector` | Node labels for middleManager pod assignment | `{}` | +| `middleManager.tolerations` | middleManager tolerations | `[]` | +| `middleManager.javaOpts` | middleManager node java options | `-Xms1G -Xmx1G"` | +| `middleManager.persistence.enabled` | middleManager persistent enabled/disabled | `true` | +| `middleManager.persistence.size` | middleManager persistent volume size | `4Gi` | +| `middleManager.persistence.storageClass` | middleManager persistent volume Class | `nil` | +| `middleManager.persistence.accessMode` | middleManager persistent Access Mode | `ReadWriteOnce` | +| `middleManager.antiAffinity` | middleManager anti-affinity policy | `soft` | +| `middleManager.nodeAffinity` | middleManager node affinity policy | `{}` | +| `middleManager.ingress.enabled` | enable ingress | `false` | +| `middleManager.ingress.hosts` | hosts for the middleManager api | `[ "chart-example.local" ]` | +| `middleManager.ingress.path` | path of the middleManager api | `/` | +| `middleManager.ingress.annotations` | annotations for the middleManager api ingress | `{}` | +| `middleManager.ingress.tls` | TLS configuration for the ingress | `[]` | +| `broker.name` | broker component name | `broker` | +| `broker.replicaCount` | broker node replicas (deployment) | `1` | +| `broker.port` | port of broker component | `8082` | +| `broker.serviceType` | service type for service | `ClusterIP` | +| `broker.resources` | broker node resources requests & limits | `{}` | +| `broker.podAnnotations` | broker Deployment annotations | `{}` | +| `broker.nodeSelector` | Node labels for broker pod assignment | `{}` | +| `broker.tolerations` | broker tolerations | `[]` | +| `broker.javaOpts` | broker node java options | `-Xms2G -Xmx2G -XX:MaxDirectMemorySize=8g` | +| `broker.nodeAffinity` | broker node affinity policy | `{}` | +| `broker.ingress.enabled` | enable ingress | `false` | +| `broker.ingress.hosts` | hosts for the broker api | `[ "chart-example.local" ]` | +| `broker.ingress.path` | path of the broker api | `/` | +| `broker.ingress.annotations` | annotations for the broker api ingress | `{}` | +| `broker.ingress.tls` | TLS configuration for the ingress | `[]` | +| `overlord.name` | overlord component name | `overlord` | +| `overlord.replicaCount` | overlord node replicas (deployment) | `1` | +| `overlord.port` | port of overlord component | `8090` | +| `overlord.serviceType` | service type for service | `ClusterIP` | +| `overlord.resources` | overlord node resources requests & limits | `{}` | +| `overlord.podAnnotations` | overlord Deployment annotations | `{}` | +| `overlord.nodeSelector` | Node labels for overlord pod assignment | `{}` | +| `overlord.tolerations` | overlord tolerations | `[]` | +| `overlord.javaOpts` | overlord node java options | `--Xms1G -Xmx1G` | +| `overlord.nodeAffinity` | overlord node affinity policy | `{}` | +| `overlord.ingress.enabled` | enable ingress | `false` | +| `overlord.ingress.hosts` | hosts for the overlord api | `[ "chart-example.local" ]` | +| `overlord.ingress.path` | path of the overlord api | `/` | +| `overlord.ingress.annotations` | annotations for the overlord api ingress | `{}` | +| `overlord.ingress.tls` | TLS configuration for the ingress | `[]` | +| `coordinator.name` | coordinator component name | `coordinator` | +| `coordinator.replicaCount` | coordinator node replicas (deployment) | `1` | +| `coordinator.port` | port of coordinator component | `8081` | +| `coordinator.serviceType` | service type for service | `ClusterIP` | +| `coordinator.resources` | coordinator node resources requests & limits | `{}` | +| `coordinator.podAnnotations` | coordinator Deployment annotations | `{}` | +| `coordinator.nodeSelector` | Node labels for coordinator pod assignment | `{}` | +| `coordinator.tolerations` | coordinator tolerations | `[]` | +| `coordinator.javaOpts` | coordinator node java options | `--Xms1G -Xmx1G` | +| `coordinator.nodeAffinity` | coordinator node affinity policy | `{}` | +| `coordinator.ingress.enabled` | enable ingress | `false` | +| `coordinator.ingress.hosts` | hosts for the coordinator api | `[ "chart-example.local" ]` | +| `coordinator.ingress.path` | path of the coordinator api | `/` | +| `coordinator.ingress.annotations` | annotations for the coordinator api ingress | `{}` | +| `coordinator.ingress.tls` | TLS configuration for the ingress | `[]` | + +Full and up-to-date documentation can be found in the comments of the `values.yaml` file. diff --git a/incubator/druid/requirements.lock b/incubator/druid/requirements.lock new file mode 100644 index 0000000000..2a98b37ab4 --- /dev/null +++ b/incubator/druid/requirements.lock @@ -0,0 +1,9 @@ +dependencies: +- name: zookeeper + repository: https://kubernetes-charts-incubator.storage.googleapis.com/ + version: 1.2.0 +- name: mysql + repository: https://kubernetes-charts.storage.googleapis.com/ + version: 0.10.2 +digest: sha256:28aa139b80203f125af6c7b5c9881d0c7de98c3a420ab1a5d18daf76c819b850 +generated: 2018-11-13T14:34:00.5675116+01:00 diff --git a/incubator/druid/requirements.yaml b/incubator/druid/requirements.yaml new file mode 100644 index 0000000000..f8def8f4a6 --- /dev/null +++ b/incubator/druid/requirements.yaml @@ -0,0 +1,9 @@ +dependencies: +- name: zookeeper + version: 1.2.0 + repository: https://kubernetes-charts-incubator.storage.googleapis.com/ + condition: zookeeper.enabled +- name: mysql + version: 0.10.2 + repository: https://kubernetes-charts.storage.googleapis.com/ + condition: mysql.enabled diff --git a/incubator/druid/templates/NOTES.txt b/incubator/druid/templates/NOTES.txt new file mode 100644 index 0000000000..411cdbdca8 --- /dev/null +++ b/incubator/druid/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the broker URL by running these commands: +{{- if .Values.broker.ingress.enabled }} +{{- range .Values.broker.ingress.hosts }} + http{{ if $.Values.broker.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.broker.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.broker.serviceType }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "druid.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.broker.serviceType }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "druid.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "druid.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.broker.port }} +{{- else if contains "ClusterIP" .Values.broker.serviceType }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "druid.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.broker.port }} +{{- end }} diff --git a/incubator/druid/templates/_helpers.tpl b/incubator/druid/templates/_helpers.tpl new file mode 100644 index 0000000000..6707a85239 --- /dev/null +++ b/incubator/druid/templates/_helpers.tpl @@ -0,0 +1,74 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "druid.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "druid.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "druid.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified historical name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "druid.historical.fullname" -}} +{{ template "druid.fullname" . }}-{{ .Values.historical.name }} +{{- end -}} + +{{/* +Create a default fully qualified middleManager name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "druid.middleManager.fullname" -}} +{{ template "druid.fullname" . }}-{{ .Values.middleManager.name }} +{{- end -}} + + +{{/* +Create a default fully qualified broker name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "druid.broker.fullname" -}} +{{ template "druid.fullname" . }}-{{ .Values.broker.name }} +{{- end -}} + +{{/* +Create a default fully qualified overlord name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "druid.overlord.fullname" -}} +{{ template "druid.fullname" . }}-{{ .Values.overlord.name }} +{{- end -}} + +{{/* +Create a default fully qualified coordinator name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "druid.coordinator.fullname" -}} +{{ template "druid.fullname" . }}-{{ .Values.coordinator.name }} +{{- end -}} + diff --git a/incubator/druid/templates/broker/deployment.yaml b/incubator/druid/templates/broker/deployment.yaml new file mode 100644 index 0000000000..2a053b8a89 --- /dev/null +++ b/incubator/druid/templates/broker/deployment.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "druid.broker.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.broker.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.broker.replicaCount }} + selector: + matchLabels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.broker.name }} + template: + metadata: + labels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.broker.name }} + {{- with .Values.broker.podAnnotations }} + annotations: +{{ toYaml . | indent 8 }} + {{- end }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: [ "broker" ] + env: + {{- if .Values.zookeeper.enabled }} + - name: ZOOKEEPER_HOST + value: {{ .Release.Name }}-zookeeper-headless:2181 + {{- else }} + - name: ZOOKEEPER_HOST + value: {{ .Values.zkHosts }} + {{- end }} + {{- if .Values.mysql.enabled }} + - name: DB_HOST + value: {{ .Release.Name }}-mysql + - name: DB_TYPE + value: mysql + - name: DB_USERNAME + value: {{ .Values.mysql.mysqlUser }} + - name: DB_PASSWORD + value: {{ .Values.mysql.mysqlPassword }} + - name: DB_DBNAME + value: {{ .Values.mysql.mysqlDatabase }} + - name: DB_PORT + value: "3306" + {{- end }} + - name: JAVA_OPTS + value: {{ .Values.broker.javaOpts }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.broker.port }} + protocol: TCP + livenessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.broker.port }} + readinessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.broker.port }} + resources: +{{ toYaml .Values.broker.resources | indent 12 }} + {{- with .Values.broker.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.broker.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.broker.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/incubator/druid/templates/broker/ingress.yaml b/incubator/druid/templates/broker/ingress.yaml new file mode 100644 index 0000000000..85d267e9e8 --- /dev/null +++ b/incubator/druid/templates/broker/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.broker.ingress.enabled -}} +{{- $fullName := include "druid.broker.fullname" . -}} +{{- $ingressPath := .Values.broker.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.broker.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.broker.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.broker.ingress.tls }} + tls: + {{- range .Values.broker.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.broker.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/incubator/druid/templates/broker/service.yaml b/incubator/druid/templates/broker/service.yaml new file mode 100644 index 0000000000..60e9673588 --- /dev/null +++ b/incubator/druid/templates/broker/service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "druid.broker.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.broker.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.broker.serviceType }} + ports: + - port: {{ .Values.broker.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.broker.name }} diff --git a/incubator/druid/templates/coordinator/deployment.yaml b/incubator/druid/templates/coordinator/deployment.yaml new file mode 100644 index 0000000000..6a3060f1de --- /dev/null +++ b/incubator/druid/templates/coordinator/deployment.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "druid.coordinator.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.coordinator.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.coordinator.replicaCount }} + selector: + matchLabels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.coordinator.name }} + template: + metadata: + labels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.coordinator.name }} + {{- with .Values.coordinator.podAnnotations }} + annotations: +{{ toYaml . | indent 8 }} + {{- end }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: [ "coordinator" ] + env: + {{- if .Values.zookeeper.enabled }} + - name: ZOOKEEPER_HOST + value: {{ .Release.Name }}-zookeeper-headless:2181 + {{- else }} + - name: ZOOKEEPER_HOST + value: {{ .Values.zkHosts }} + {{- end }} + {{- if .Values.mysql.enabled }} + - name: DB_HOST + value: {{ .Release.Name }}-mysql + - name: DB_TYPE + value: mysql + - name: DB_USERNAME + value: {{ .Values.mysql.mysqlUser }} + - name: DB_PASSWORD + value: {{ .Values.mysql.mysqlPassword }} + - name: DB_DBNAME + value: {{ .Values.mysql.mysqlDatabase }} + - name: DB_PORT + value: "3306" + {{- end }} + - name: JAVA_OPTS + value: {{ .Values.coordinator.javaOpts }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.coordinator.port }} + protocol: TCP + livenessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.coordinator.port }} + readinessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.coordinator.port }} + resources: +{{ toYaml .Values.coordinator.resources | indent 12 }} + {{- with .Values.coordinator.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.coordinator.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.coordinator.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/incubator/druid/templates/coordinator/ingress.yaml b/incubator/druid/templates/coordinator/ingress.yaml new file mode 100644 index 0000000000..c1ab749c8b --- /dev/null +++ b/incubator/druid/templates/coordinator/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.coordinator.ingress.enabled -}} +{{- $fullName := include "druid.coordinator.fullname" . -}} +{{- $ingressPath := .Values.coordinator.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.coordinator.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.coordinator.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.coordinator.ingress.tls }} + tls: + {{- range .Values.coordinator.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.coordinator.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/incubator/druid/templates/coordinator/service.yaml b/incubator/druid/templates/coordinator/service.yaml new file mode 100644 index 0000000000..96d34e8947 --- /dev/null +++ b/incubator/druid/templates/coordinator/service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "druid.coordinator.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.coordinator.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.coordinator.serviceType }} + ports: + - port: {{ .Values.coordinator.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.coordinator.name }} diff --git a/incubator/druid/templates/historical/ingress.yaml b/incubator/druid/templates/historical/ingress.yaml new file mode 100644 index 0000000000..b5e42b9ab4 --- /dev/null +++ b/incubator/druid/templates/historical/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.historical.ingress.enabled -}} +{{- $fullName := include "druid.historical.fullname" . -}} +{{- $ingressPath := .Values.historical.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.historical.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.historical.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.historical.ingress.tls }} + tls: + {{- range .Values.historical.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.historical.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/incubator/druid/templates/historical/pdb.yaml b/incubator/druid/templates/historical/pdb.yaml new file mode 100644 index 0000000000..1f3da56d9e --- /dev/null +++ b/incubator/druid/templates/historical/pdb.yaml @@ -0,0 +1,24 @@ +{{- if .Values.historical.podDisruptionBudget.enabled }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + labels: + app: {{ template "druid.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: {{ .Values.historical.name }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "druid.historical.fullname" . }} +spec: +{{- if .Values.historical.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.historical.podDisruptionBudget.minAvailable }} +{{- end }} +{{- if .Values.historical.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.historical.podDisruptionBudget.maxUnavailable }} +{{- end }} + selector: + matchLabels: + app: {{ template "druid.name" . }} + component: {{ .Values.historical.name }} + release: {{ .Release.Name }} +{{- end }} \ No newline at end of file diff --git a/incubator/druid/templates/historical/service.yaml b/incubator/druid/templates/historical/service.yaml new file mode 100644 index 0000000000..5100d7c51f --- /dev/null +++ b/incubator/druid/templates/historical/service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "druid.historical.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.historical.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.historical.serviceType }} + ports: + - port: {{ .Values.historical.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.historical.name }} diff --git a/incubator/druid/templates/historical/statefulset.yaml b/incubator/druid/templates/historical/statefulset.yaml new file mode 100644 index 0000000000..69004e7583 --- /dev/null +++ b/incubator/druid/templates/historical/statefulset.yaml @@ -0,0 +1,141 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app: {{ template "druid.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: {{ .Values.historical.name }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "druid.historical.fullname" . }} +spec: + serviceName: {{ template "druid.historical.fullname" . }} + replicas: {{ .Values.historical.replicaCount }} + selector: + matchLabels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.historical.name }} + template: + metadata: + labels: + app: {{ template "druid.name" . }} + component: {{ .Values.historical.name }} + release: {{ .Release.Name }} + {{- with .Values.historical.podAnnotations }} + annotations: +{{ toYaml . | indent 8 }} + {{- end }} + spec: + {{- if or .Values.historical.antiAffinity .Values.historical.nodeAffinity }} + affinity: + {{- end }} + {{- if eq .Values.historical.antiAffinity "hard" }} + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - topologyKey: "kubernetes.io/hostname" + labelSelector: + matchLabels: + app: "{{ template "druid.name" . }}" + release: "{{ .Release.Name }}" + component: "{{ .Values.historical.name }}" + {{- else if eq .Values.historical.antiAffinity "soft" }} + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + podAffinityTerm: + topologyKey: kubernetes.io/hostname + labelSelector: + matchLabels: + app: "{{ template "druid.name" . }}" + release: "{{ .Release.Name }}" + component: "{{ .Values.historical.name }}" + {{- end }} + {{- with .Values.historical.nodeAffinity }} + nodeAffinity: +{{ toYaml . | indent 10 }} + {{- end }} +{{- if .Values.historical.nodeSelector }} + nodeSelector: +{{ toYaml .Values.historical.nodeSelector | indent 8 }} +{{- end }} +{{- if .Values.historical.tolerations }} + tolerations: +{{ toYaml .Values.historical.tolerations | indent 8 }} +{{- end }} + containers: + - name: druid + args: [ "historical" ] + env: + {{- if .Values.zookeeper.enabled }} + - name: ZOOKEEPER_HOST + value: {{ .Release.Name }}-zookeeper-headless:2181 + {{- else }} + - name: ZOOKEEPER_HOST + value: {{ .Values.zkHosts }} + {{- end }} + {{- if .Values.mysql.enabled }} + - name: DB_HOST + value: {{ .Release.Name }}-mysql + - name: DB_TYPE + value: mysql + - name: DB_USERNAME + value: {{ .Values.mysql.mysqlUser }} + - name: DB_PASSWORD + value: {{ .Values.mysql.mysqlPassword }} + - name: DB_DBNAME + value: {{ .Values.mysql.mysqlDatabase }} + - name: DB_PORT + value: "3306" + {{- end }} + - name: JAVA_OPTS + value: {{ .Values.historical.javaOpts }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + resources: +{{ toYaml .Values.historical.resources | indent 12 }} + livenessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.historical.port }} + readinessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.historical.port }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + ports: + - containerPort: {{ .Values.historical.port }} + name: http + volumeMounts: + - mountPath: /var/druid/ + name: data + {{- if not .Values.historical.persistence.enabled }} + volumes: + - name: data + emptyDir: {} + {{- end }} + updateStrategy: + type: {{ .Values.historical.updateStrategy.type }} + {{- if .Values.historical.persistence.enabled }} + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - {{ .Values.historical.persistence.accessMode | quote }} + {{- if .Values.historical.persistence.storageClass }} + {{- if (eq "-" .Values.historical.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.historical.persistence.storageClass }}" + {{- end }} + {{- end }} + resources: + requests: + storage: "{{ .Values.historical.persistence.size }}" + {{ end }} diff --git a/incubator/druid/templates/middleManager/ingress.yaml b/incubator/druid/templates/middleManager/ingress.yaml new file mode 100644 index 0000000000..cb2a98a48a --- /dev/null +++ b/incubator/druid/templates/middleManager/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.middleManager.ingress.enabled -}} +{{- $fullName := include "druid.middleManager.fullname" . -}} +{{- $ingressPath := .Values.middleManager.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.middleManager.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.middleManager.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.middleManager.ingress.tls }} + tls: + {{- range .Values.middleManager.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.middleManager.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/incubator/druid/templates/middleManager/pdb.yaml b/incubator/druid/templates/middleManager/pdb.yaml new file mode 100644 index 0000000000..90b05ea1dd --- /dev/null +++ b/incubator/druid/templates/middleManager/pdb.yaml @@ -0,0 +1,24 @@ +{{- if .Values.middleManager.podDisruptionBudget.enabled }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + labels: + app: {{ template "druid.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: {{ .Values.middleManager.name }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "druid.middleManager.fullname" . }} +spec: +{{- if .Values.middleManager.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.middleManager.podDisruptionBudget.minAvailable }} +{{- end }} +{{- if .Values.middleManager.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.middleManager.podDisruptionBudget.maxUnavailable }} +{{- end }} + selector: + matchLabels: + app: {{ template "druid.name" . }} + component: {{ .Values.middleManager.name }} + release: {{ .Release.Name }} +{{- end }} \ No newline at end of file diff --git a/incubator/druid/templates/middleManager/service.yaml b/incubator/druid/templates/middleManager/service.yaml new file mode 100644 index 0000000000..1abfae0dd7 --- /dev/null +++ b/incubator/druid/templates/middleManager/service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "druid.middleManager.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.middleManager.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.middleManager.serviceType }} + ports: + - port: {{ .Values.middleManager.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.middleManager.name }} diff --git a/incubator/druid/templates/middleManager/statefulset.yaml b/incubator/druid/templates/middleManager/statefulset.yaml new file mode 100644 index 0000000000..d87aa07eb7 --- /dev/null +++ b/incubator/druid/templates/middleManager/statefulset.yaml @@ -0,0 +1,141 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app: {{ template "druid.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: {{ .Values.middleManager.name }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "druid.middleManager.fullname" . }} +spec: + serviceName: {{ template "druid.middleManager.fullname" . }} + replicas: {{ .Values.middleManager.replicaCount }} + selector: + matchLabels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.middleManager.name }} + template: + metadata: + labels: + app: {{ template "druid.name" . }} + component: {{ .Values.middleManager.name }} + release: {{ .Release.Name }} + {{- if .Values.middleManager.podAnnotations }} + annotations: +{{ toYaml .Values.middleManager.podAnnotations | indent 8 }} + {{- end }} + spec: + {{- if or .Values.middleManager.antiAffinity .Values.middleManager.nodeAffinity }} + affinity: + {{- end }} + {{- if eq .Values.middleManager.antiAffinity "hard" }} + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - topologyKey: "kubernetes.io/hostname" + labelSelector: + matchLabels: + app: "{{ template "druid.name" . }}" + release: "{{ .Release.Name }}" + component: "{{ .Values.middleManager.name }}" + {{- else if eq .Values.middleManager.antiAffinity "soft" }} + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + podAffinityTerm: + topologyKey: kubernetes.io/hostname + labelSelector: + matchLabels: + app: "{{ template "druid.name" . }}" + release: "{{ .Release.Name }}" + component: "{{ .Values.middleManager.name }}" + {{- end }} + {{- with .Values.middleManager.nodeAffinity }} + nodeAffinity: +{{ toYaml . | indent 10 }} + {{- end }} +{{- if .Values.middleManager.nodeSelector }} + nodeSelector: +{{ toYaml .Values.middleManager.nodeSelector | indent 8 }} +{{- end }} +{{- if .Values.middleManager.tolerations }} + tolerations: +{{ toYaml .Values.middleManager.tolerations | indent 8 }} +{{- end }} + containers: + - name: druid + args: [ "middleManager" ] + env: + {{- if .Values.zookeeper.enabled }} + - name: ZOOKEEPER_HOST + value: {{ .Release.Name }}-zookeeper-headless:2181 + {{- else }} + - name: ZOOKEEPER_HOST + value: {{ .Values.zkHosts }} + {{- end }} + {{- if .Values.mysql.enabled }} + - name: DB_HOST + value: {{ .Release.Name }}-mysql + - name: DB_TYPE + value: mysql + - name: DB_USERNAME + value: {{ .Values.mysql.mysqlUser }} + - name: DB_PASSWORD + value: {{ .Values.mysql.mysqlPassword }} + - name: DB_DBNAME + value: {{ .Values.mysql.mysqlDatabase }} + - name: DB_PORT + value: "3306" + {{- end }} + - name: JAVA_OPTS + value: {{ .Values.middleManager.javaOpts }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + resources: +{{ toYaml .Values.middleManager.resources | indent 12 }} + livenessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.middleManager.port }} + readinessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.middleManager.port }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + ports: + - containerPort: {{ .Values.middleManager.port }} + name: http + volumeMounts: + - mountPath: /var/druid/ + name: data + {{- if not .Values.middleManager.persistence.enabled }} + volumes: + - name: data + emptyDir: {} + {{- end }} + updateStrategy: + type: {{ .Values.middleManager.updateStrategy.type }} + {{- if .Values.middleManager.persistence.enabled }} + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - {{ .Values.middleManager.persistence.accessMode | quote }} + {{- if .Values.middleManager.persistence.storageClass }} + {{- if (eq "-" .Values.middleManager.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.middleManager.persistence.storageClass }}" + {{- end }} + {{- end }} + resources: + requests: + storage: "{{ .Values.middleManager.persistence.size }}" + {{ end }} diff --git a/incubator/druid/templates/overlord/deployment.yaml b/incubator/druid/templates/overlord/deployment.yaml new file mode 100644 index 0000000000..72b5e8372f --- /dev/null +++ b/incubator/druid/templates/overlord/deployment.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "druid.overlord.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.overlord.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.overlord.replicaCount }} + selector: + matchLabels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.overlord.name }} + template: + metadata: + labels: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.overlord.name }} + {{- with .Values.overlord.podAnnotations }} + annotations: +{{ toYaml . | indent 8 }} + {{- end }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: [ "overlord" ] + env: + {{- if .Values.zookeeper.enabled }} + - name: ZOOKEEPER_HOST + value: {{ .Release.Name }}-zookeeper-headless:2181 + {{- else }} + - name: ZOOKEEPER_HOST + value: {{ .Values.zkHosts }} + {{- end }} + {{- if .Values.mysql.enabled }} + - name: DB_HOST + value: {{ .Release.Name }}-mysql + - name: DB_TYPE + value: mysql + - name: DB_USERNAME + value: {{ .Values.mysql.mysqlUser }} + - name: DB_PASSWORD + value: {{ .Values.mysql.mysqlPassword }} + - name: DB_DBNAME + value: {{ .Values.mysql.mysqlDatabase }} + - name: DB_PORT + value: "3306" + {{- end }} + - name: JAVA_OPTS + value: {{ .Values.overlord.javaOpts }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.overlord.port }} + protocol: TCP + livenessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.overlord.port }} + readinessProbe: + initialDelaySeconds: 60 + httpGet: + path: /status/health + port: {{ .Values.overlord.port }} + resources: +{{ toYaml .Values.overlord.resources | indent 12 }} + {{- with .Values.overlord.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.overlord.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.overlord.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/incubator/druid/templates/overlord/ingress.yaml b/incubator/druid/templates/overlord/ingress.yaml new file mode 100644 index 0000000000..366fed0b81 --- /dev/null +++ b/incubator/druid/templates/overlord/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.overlord.ingress.enabled -}} +{{- $fullName := include "druid.overlord.fullname" . -}} +{{- $ingressPath := .Values.overlord.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.overlord.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.overlord.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.overlord.ingress.tls }} + tls: + {{- range .Values.overlord.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.overlord.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/incubator/druid/templates/overlord/service.yaml b/incubator/druid/templates/overlord/service.yaml new file mode 100644 index 0000000000..3dc39a60e4 --- /dev/null +++ b/incubator/druid/templates/overlord/service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "druid.overlord.fullname" . }} + labels: + app: {{ include "druid.name" . }} + chart: {{ include "druid.chart" . }} + component: {{ .Values.overlord.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.overlord.serviceType }} + ports: + - port: {{ .Values.overlord.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ include "druid.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.overlord.name }} diff --git a/incubator/druid/values.yaml b/incubator/druid/values.yaml new file mode 100644 index 0000000000..2487e3c2b4 --- /dev/null +++ b/incubator/druid/values.yaml @@ -0,0 +1,240 @@ +# Default values for druid. + +image: + repository: maver1ckpl/druid-docker + tag: 0.12.3-2 + pullPolicy: IfNotPresent + +env: + DRUID_USE_CONTAINER_IP: true + +broker: + replicaCount: 1 + + name: broker + + port: 8082 + serviceType: ClusterIP + + javaOpts: "-Xms2G -Xmx2G -XX:MaxDirectMemorySize=8g" + + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + resources: {} + + nodeSelector: {} + + tolerations: [] + + affinity: {} + + podAnnotations: {} + +coordinator: + replicaCount: 1 + + name: coordinator + + port: 8081 + serviceType: ClusterIP + + javaOpts: "-Xms1G -Xmx1G" + + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + resources: {} + + nodeSelector: {} + + tolerations: [] + + affinity: {} + + podAnnotations: {} + +overlord: + replicaCount: 1 + + name: overlord + + port: 8090 + serviceType: ClusterIP + + javaOpts: "-Xms1G -Xmx1G" + + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + resources: {} + + nodeSelector: {} + + tolerations: [] + + affinity: {} + + podAnnotations: {} + +historical: + name: historical + replicaCount: 1 + port: 8083 + serviceType: ClusterIP + + javaOpts: "-Xms2G -Xmx2G -XX:MaxDirectMemorySize=8g" + + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + persistence: + enabled: true + accessMode: ReadWriteOnce + size: "4Gi" + # storageClass: "ssd" + + antiAffinity: "soft" + + nodeAffinity: {} + + nodeSelector: {} + + tolerations: [] + + resources: {} + + ## (dict) If specified, apply these annotations to each master Pod + podAnnotations: {} + # example: master-foo + + podDisruptionBudget: + enabled: false + # minAvailable: 2 + maxUnavailable: 1 + + updateStrategy: + type: RollingUpdate + +middleManager: + name: middle-manager + replicaCount: 1 + port: 8091 + serviceType: ClusterIP + + javaOpts: "-Xms1G -Xmx1G" + + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + persistence: + enabled: true + accessMode: ReadWriteOnce + size: "4Gi" + # storageClass: "ssd" + + antiAffinity: "soft" + + nodeAffinity: {} + + nodeSelector: {} + + tolerations: [] + + resources: {} + + ## (dict) If specified, apply these annotations to each master Pod + podAnnotations: {} + # example: master-foo + + podDisruptionBudget: + enabled: false + # minAvailable: 2 + maxUnavailable: 1 + + updateStrategy: + type: RollingUpdate + + +# ------------------------------------------------------------------------------ +# Zookeeper: +# ------------------------------------------------------------------------------ + +# zkHosts: druid-zookeeper-headless:2181 + +zookeeper: + enabled: true + ## Environmental variables to set in Zookeeper + ## + env: + ## The JVM heap size to allocate to Zookeeper + ZK_HEAP_SIZE: "512M" + ## Configure Zookeeper persistence + persistence: + enabled: true + + +# ------------------------------------------------------------------------------ +# MySQL: +# ------------------------------------------------------------------------------ +mysql: + enabled: true + mysqlRootPassword: druidroot + mysqlUser: druid + mysqlPassword: druid + mysqlDatabase: druid + configurationFiles: + mysql_collate.cnf: |- + [mysqld] + character-set-server=utf8 + collation-server=utf8_unicode_ci