This is an automated email from the ASF dual-hosted git repository.
xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 5b2b4aab82 Adding minion stateless k8s deployment for minion and by
default turn off minion statefulset deployment. (#8936)
5b2b4aab82 is described below
commit 5b2b4aab825194210ca1ae1d009b7147533753ec
Author: Xiang Fu <[email protected]>
AuthorDate: Mon Jun 20 16:43:59 2022 -0700
Adding minion stateless k8s deployment for minion and by default turn off
minion statefulset deployment. (#8936)
---
kubernetes/helm/pinot/requirements.lock | 6 +-
kubernetes/helm/pinot/requirements.yaml | 2 +-
kubernetes/helm/pinot/templates/_helpers.tpl | 33 ++++++
.../{minion => minion-stateless}/configmap.yaml | 14 ++-
.../templates/minion-stateless/deployment.yml | 121 +++++++++++++++++++++
.../service.yaml => minion-stateless/pvc.yaml} | 31 +++---
.../helm/pinot/templates/minion/configmap.yaml | 2 +
.../pinot/templates/minion/service-headless.yaml | 2 +
.../helm/pinot/templates/minion/service.yaml | 2 +
.../helm/pinot/templates/minion/statefulset.yml | 2 +
kubernetes/helm/pinot/values.yaml | 72 +++++++++++-
11 files changed, 263 insertions(+), 24 deletions(-)
diff --git a/kubernetes/helm/pinot/requirements.lock
b/kubernetes/helm/pinot/requirements.lock
index ad40541fd6..4a3dfaaea7 100644
--- a/kubernetes/helm/pinot/requirements.lock
+++ b/kubernetes/helm/pinot/requirements.lock
@@ -20,6 +20,6 @@
dependencies:
- name: zookeeper
repository: https://charts.bitnami.com/bitnami
- version: 7.0.0
-digest: sha256:db1ecacbb7016e8c0d9c6642c917461d6190ef88fb9a2a5147b2230e94c64eab
-generated: "2021-12-22T12:04:57.707437-08:00"
+ version: 9.2.7
+digest: sha256:a5da7ddd352d63b0a0e1e5bd85e90e304ae5d0fa7759d5cb7ffb39f61adef1e9
+generated: "2022-06-20T14:57:34.981883-07:00"
diff --git a/kubernetes/helm/pinot/requirements.yaml
b/kubernetes/helm/pinot/requirements.yaml
index cdf2e8b417..ece3625593 100644
--- a/kubernetes/helm/pinot/requirements.yaml
+++ b/kubernetes/helm/pinot/requirements.yaml
@@ -19,6 +19,6 @@
dependencies:
- name: zookeeper
- version: 7.0.0
+ version: 9.x.x
repository: https://charts.bitnami.com/bitnami
condition: pinot.zookeeper.enabled,zookeeper.enabled
diff --git a/kubernetes/helm/pinot/templates/_helpers.tpl
b/kubernetes/helm/pinot/templates/_helpers.tpl
index c1876fbbc5..fa30dcfc81 100644
--- a/kubernetes/helm/pinot/templates/_helpers.tpl
+++ b/kubernetes/helm/pinot/templates/_helpers.tpl
@@ -99,6 +99,14 @@ Minion labels
component: {{ .Values.minion.name }}
{{- end }}
+{{/*
+minionStateless labels
+*/}}
+{{- define "pinot.minionStatelessLabels" -}}
+{{- include "pinot.labels" . }}
+component: {{ .Values.minionStateless.name }}
+{{- end }}
+
{{/*
Server labels
*/}}
@@ -135,6 +143,15 @@ component: {{ .Values.minion.name }}
{{- end }}
+{{/*
+MinionStateless Match Selector labels
+*/}}
+{{- define "pinot.minionStatelessMatchLabels" -}}
+{{- include "pinot.matchLabels" . }}
+component: {{ .Values.minionStateless.name }}
+{{- end }}
+
+
{{/*
Server Match Selector labels
*/}}
@@ -217,6 +234,15 @@ We truncate at 63 chars because some Kubernetes name
fields are limited to this
{{ template "pinot.fullname" . }}-{{ .Values.minion.name }}
{{- end -}}
+
+{{/*
+Create a default fully qualified pinot minion stateless name.
+We truncate at 63 chars because some Kubernetes name fields are limited to
this (by the DNS naming spec).
+*/}}
+{{- define "pinot.minionStateless.fullname" -}}
+{{ template "pinot.fullname" . }}-{{ .Values.minionStateless.name }}
+{{- end -}}
+
{{/*
The name of the pinot controller headless service.
*/}}
@@ -286,3 +312,10 @@ The name of the pinot minion config.
{{- define "pinot.minion.config" -}}
{{- printf "%s-config" (include "pinot.minion.fullname" .) | trunc 63 |
trimSuffix "-" -}}
{{- end -}}
+
+{{/*
+The name of the pinot minion stateless config.
+*/}}
+{{- define "pinot.minionStateless.config" -}}
+{{- printf "%s-config" (include "pinot.minionStateless.fullname" .) | trunc 63
| trimSuffix "-" -}}
+{{- end -}}
diff --git a/kubernetes/helm/pinot/templates/minion/configmap.yaml
b/kubernetes/helm/pinot/templates/minion-stateless/configmap.yaml
similarity index 70%
copy from kubernetes/helm/pinot/templates/minion/configmap.yaml
copy to kubernetes/helm/pinot/templates/minion-stateless/configmap.yaml
index 116c573007..f61c597fad 100644
--- a/kubernetes/helm/pinot/templates/minion/configmap.yaml
+++ b/kubernetes/helm/pinot/templates/minion-stateless/configmap.yaml
@@ -17,14 +17,16 @@
# under the License.
#
+{{- if .Values.minionStateless.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ include "pinot.minion.config" . }}
+ name: {{ include "pinot.minionStateless.config" . }}
data:
- pinot-minion.conf: |-
- pinot.minion.port={{ .Values.minion.service.port }}
- {{- if .Values.minion.dataDir }}
- dataDir={{ .Values.minion.dataDir }}
+ pinot-minion-stateless.conf: |-
+ pinot.minion.port={{ .Values.minionStateless.service.port }}
+ {{- if .Values.minionStateless.dataDir }}
+ dataDir={{ .Values.minionStateless.dataDir }}
{{- end }}
-{{ .Values.minion.extra.configs | indent 4 }}
+{{ .Values.minionStateless.extra.configs | indent 4 }}
+{{- end }}
diff --git a/kubernetes/helm/pinot/templates/minion-stateless/deployment.yml
b/kubernetes/helm/pinot/templates/minion-stateless/deployment.yml
new file mode 100644
index 0000000000..1f286f7a80
--- /dev/null
+++ b/kubernetes/helm/pinot/templates/minion-stateless/deployment.yml
@@ -0,0 +1,121 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+{{- if .Values.minionStateless.enabled }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "pinot.minionStateless.fullname" . }}
+ labels:
+ {{- include "pinot.minionStatelessLabels" . | nindent 4 }}
+spec:
+ selector:
+ matchLabels:
+ {{- include "pinot.minionStatelessMatchLabels" . | nindent 6 }}
+ replicas: {{ .Values.minionStateless.replicaCount }}
+ template:
+ metadata:
+ labels:
+ {{- include "pinot.minionStatelessLabels" . | nindent 8 }}
+ annotations:
+{{ toYaml .Values.minionStateless.podAnnotations | indent 8 }}
+ spec:
+ terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds
}}
+ securityContext:
+ {{- toYaml .Values.minionStateless.podSecurityContext | nindent 8 }}
+ {{- with .Values.imagePullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ nodeSelector:
+{{ toYaml .Values.minionStateless.nodeSelector | indent 8 }}
+ affinity:
+{{ toYaml .Values.minionStateless.affinity | indent 8 }}
+ tolerations:
+{{ toYaml .Values.minionStateless.tolerations | indent 8 }}
+ containers:
+ - name: minion-stateless
+ securityContext:
+ {{- toYaml .Values.minionStateless.securityContext | nindent 10 }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ args: [
+ "StartMinion",
+ "-clusterName", "{{ .Values.cluster.name }}",
+ "-zkAddress", {{ include "zookeeper.url" . | quote }},
+ "-configFileName",
"/var/pinot/minion/config/pinot-minion-stateless.conf"
+ ]
+ env:
+ - name: JAVA_OPTS
+ value: "{{ .Values.minionStateless.jvmOpts }}
-Dlog4j2.configurationFile={{ .Values.minionStateless.log4j2ConfFile }}
-Dplugins.dir={{ .Values.minionStateless.pluginsDir }}"
+{{- if .Values.minionStateless.extraEnv }}
+{{ toYaml .Values.minionStateless.extraEnv | indent 10 }}
+{{- end }}
+ envFrom:
+{{ toYaml .Values.minionStateless.envFrom | indent 10 }}
+ ports:
+ - containerPort: {{ .Values.minionStateless.service.port }}
+ protocol: {{ .Values.minionStateless.service.protocol }}
+ name: {{ .Values.minionStateless.service.name }}
+ {{- if .Values.minionStateless.probes.livenessEnabled }}
+ livenessProbe:
+ initialDelaySeconds: {{ .Values.probes.initialDelaySeconds }}
+ periodSeconds: {{ .Values.probes.periodSeconds }}
+ httpGet:
+ path: {{ .Values.minionStateless.probes.endpoint }}
+ port: {{ .Values.minionStateless.service.port }}
+ {{- end }}
+ {{- if .Values.minionStateless.probes.readinessEnabled }}
+ readinessProbe:
+ initialDelaySeconds: {{ .Values.probes.initialDelaySeconds }}
+ periodSeconds: {{ .Values.probes.periodSeconds }}
+ httpGet:
+ path: {{ .Values.minionStateless.probes.endpoint }}
+ port: {{ .Values.minionStateless.service.port }}
+ {{- end }}
+ volumeMounts:
+ - name: config
+ mountPath: /var/pinot/minion/config
+ {{- if .Values.minionStateless.persistence.enabled }}
+ - name: data
+ mountPath: "{{ .Values.minionStateless.persistence.mountPath }}"
+ {{- end }}
+ {{- if ne (len
.Values.minionStateless.persistence.extraVolumeMounts) 0 }}
+{{ toYaml .Values.minionStateless.persistence.extraVolumeMounts | indent 10 }}
+ {{- end }}
+ resources:
+{{ toYaml .Values.minionStateless.resources | indent 12 }}
+ restartPolicy: Always
+ volumes:
+ - name: config
+ configMap:
+ name: {{ include "pinot.minionStateless.config" . }}
+ {{- if not .Values.minionStateless.persistence.enabled }}
+ - name: data
+ emptyDir: {}
+ {{- end }}
+ {{- if .Values.minionStateless.persistence.enabled }}
+ - name: data
+ persistentVolumeClaim:
+ claimName: {{ .Values.minionStateless.persistence.pvcName }}
+ {{- end }}
+ {{- if ne (len .Values.minionStateless.persistence.extraVolumes) 0 }}
+{{ toYaml .Values.minionStateless.persistence.extraVolumes | indent 8 }}
+ {{- end }}
+{{- end }}
diff --git a/kubernetes/helm/pinot/templates/minion/service.yaml
b/kubernetes/helm/pinot/templates/minion-stateless/pvc.yaml
similarity index 56%
copy from kubernetes/helm/pinot/templates/minion/service.yaml
copy to kubernetes/helm/pinot/templates/minion-stateless/pvc.yaml
index 99ac36d0a2..3db9473f25 100644
--- a/kubernetes/helm/pinot/templates/minion/service.yaml
+++ b/kubernetes/helm/pinot/templates/minion-stateless/pvc.yaml
@@ -17,19 +17,24 @@
# under the License.
#
+{{- if .Values.minionStateless.enabled }}
+{{- if .Values.minionStateless.persistence.enabled }}
+kind: PersistentVolumeClaim
apiVersion: v1
-kind: Service
metadata:
- name: {{ include "pinot.minion.fullname" . }}
- annotations:
-{{ toYaml .Values.minion.service.annotations | indent 4 }}
- labels:
- {{- include "pinot.minionLabels" . | nindent 4 }}
+ name: {{ .Values.minionStateless.persistence.pvcName }}
spec:
- type: {{ .Values.minion.service.type }}
- ports:
- # [pod_name].[service_name].[namespace].svc.cluster.local
- - name: {{ .Values.minion.service.name }}
- port: {{ .Values.minion.service.port }}
- selector:
- {{- include "pinot.minionMatchLabels" . | nindent 4 }}
+ accessModes:
+ - {{ .Values.minionStateless.persistence.accessMode | quote }}
+ resources:
+ requests:
+ storage: {{ .Values.minionStateless.persistence.size }}
+{{- if .Values.minionStateless.persistence.storageClass }}
+{{- if (eq "-" .Values.minionStateless.persistence.storageClass) }}
+ storageClassName: ""
+{{- else }}
+ storageClassName: {{ .Values.minionStateless.persistence.storageClass }}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/kubernetes/helm/pinot/templates/minion/configmap.yaml
b/kubernetes/helm/pinot/templates/minion/configmap.yaml
index 116c573007..59ed600502 100644
--- a/kubernetes/helm/pinot/templates/minion/configmap.yaml
+++ b/kubernetes/helm/pinot/templates/minion/configmap.yaml
@@ -17,6 +17,7 @@
# under the License.
#
+{{- if .Values.minion.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
@@ -28,3 +29,4 @@ data:
dataDir={{ .Values.minion.dataDir }}
{{- end }}
{{ .Values.minion.extra.configs | indent 4 }}
+{{- end }}
diff --git a/kubernetes/helm/pinot/templates/minion/service-headless.yaml
b/kubernetes/helm/pinot/templates/minion/service-headless.yaml
index 0fe1f6874e..120042b8b1 100644
--- a/kubernetes/helm/pinot/templates/minion/service-headless.yaml
+++ b/kubernetes/helm/pinot/templates/minion/service-headless.yaml
@@ -17,6 +17,7 @@
# under the License.
#
+{{- if .Values.minion.enabled }}
apiVersion: v1
kind: Service
metadata:
@@ -31,3 +32,4 @@ spec:
port: {{ .Values.minion.service.port }}
selector:
{{- include "pinot.minionMatchLabels" . | nindent 4 }}
+{{- end }}
diff --git a/kubernetes/helm/pinot/templates/minion/service.yaml
b/kubernetes/helm/pinot/templates/minion/service.yaml
index 99ac36d0a2..d4f61d982d 100644
--- a/kubernetes/helm/pinot/templates/minion/service.yaml
+++ b/kubernetes/helm/pinot/templates/minion/service.yaml
@@ -17,6 +17,7 @@
# under the License.
#
+{{- if .Values.minion.enabled }}
apiVersion: v1
kind: Service
metadata:
@@ -33,3 +34,4 @@ spec:
port: {{ .Values.minion.service.port }}
selector:
{{- include "pinot.minionMatchLabels" . | nindent 4 }}
+{{- end }}
diff --git a/kubernetes/helm/pinot/templates/minion/statefulset.yml
b/kubernetes/helm/pinot/templates/minion/statefulset.yml
index 2d48514430..db43b87ded 100644
--- a/kubernetes/helm/pinot/templates/minion/statefulset.yml
+++ b/kubernetes/helm/pinot/templates/minion/statefulset.yml
@@ -17,6 +17,7 @@
# under the License.
#
+{{- if .Values.minion.enabled }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -135,3 +136,4 @@ spec:
requests:
storage: {{ .Values.minion.persistence.size }}
{{ end }}
+{{- end }}
diff --git a/kubernetes/helm/pinot/values.yaml
b/kubernetes/helm/pinot/values.yaml
index 5e7a0811bd..5a72b3fa0d 100644
--- a/kubernetes/helm/pinot/values.yaml
+++ b/kubernetes/helm/pinot/values.yaml
@@ -344,8 +344,9 @@ server:
# Pinot Minion:
#
------------------------------------------------------------------------------
minion:
+ enabled: false
name: minion
- replicaCount: 1
+ replicaCount: 0
podManagementPolicy: Parallel
podSecurityContext: {}
# fsGroup: 2000
@@ -417,6 +418,75 @@ minion:
configs: |-
pinot.set.instance.id.to.hostname=true
+
+#
------------------------------------------------------------------------------
+# Pinot Minion Stateless:
+#
------------------------------------------------------------------------------
+minionStateless:
+ enabled: true
+ name: minion-stateless
+ replicaCount: 1
+ podSecurityContext: {}
+ # fsGroup: 2000
+ securityContext: {}
+
+ probes:
+ endpoint: "/health"
+ livenessEnabled: true
+ readinessEnabled: true
+
+ dataDir: /var/pinot/minion/data
+ jvmOpts: "-Xms256M -Xmx1G -XX:+UseG1GC -XX:MaxGCPauseMillis=200
-Xlog:gc*:file=/opt/pinot/gc-pinot-minion.log"
+
+ log4j2ConfFile: /opt/pinot/conf/log4j2.xml
+ pluginsDir: /opt/pinot/plugins
+
+ persistence:
+ enabled: false
+ pvcName: minion-data-vol
+ accessMode: ReadWriteOnce
+ size: 4G
+ mountPath: /var/pinot/minion/data
+ storageClass: ""
+ #storageClass: "ssd"
+ extraVolumes: []
+ extraVolumeMounts: []
+
+ service:
+ port: 9514
+ protocol: TCP
+ name: minion
+
+ resources: {}
+
+ nodeSelector: {}
+
+ affinity: {}
+
+ tolerations: []
+
+ podAnnotations: {}
+
+ # Use envFrom to define all of the ConfigMap or Secret data as container
environment variables.
+ # ref:
https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables
+ # ref:
https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#configure-all-key-value-pairs-in-a-secret-as-container-environment-variables
+ envFrom: []
+ # - configMapRef:
+ # name: special-config
+ # - secretRef:
+ # name: test-secret
+
+ # Use extraEnv to add individual key value pairs as container environment
variables.
+ # ref:
https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
+ extraEnv: []
+ # - name: PINOT_CUSTOM_ENV
+ # value: custom-value
+
+ # Extra configs will be appended to pinot-minion.conf file
+ extra:
+ configs: |-
+ pinot.set.instance.id.to.hostname=true
+
#
------------------------------------------------------------------------------
# Zookeeper:
# NOTE: IN PRODUCTION USE CASES, IT's BEST TO USE ZOOKEEPER K8S OPERATOR
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]