blob: 959203e57c19aae53aafc34b57eb06bf6049849d [file] [log] [blame]
#
# 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.
#
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "pinot.minion.fullname" . }}
labels:
app: {{ include "pinot.name" . }}
chart: {{ include "pinot.chart" . }}
component: {{ .Values.minion.name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: {{ include "pinot.name" . }}
release: {{ .Release.Name }}
component: {{ .Values.minion.name }}
serviceName: {{ template "pinot.minion.headless" . }}
replicas: {{ .Values.minion.replicaCount }}
updateStrategy:
type: {{ .Values.minion.updateStrategy.type }}
podManagementPolicy: Parallel
template:
metadata:
labels:
app: {{ include "pinot.name" . }}
release: {{ .Release.Name }}
component: {{ .Values.minion.name }}
annotations:
{{ toYaml .Values.minion.podAnnotations | indent 8 }}
spec:
nodeSelector:
{{ toYaml .Values.minion.nodeSelector | indent 8 }}
affinity:
{{ toYaml .Values.minion.affinity | indent 8 }}
tolerations:
{{ toYaml .Values.minion.tolerations | indent 8 }}
containers:
- name: minion
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.conf"
]
env:
- name: JAVA_OPTS
value: "{{ .Values.minion.jvmOpts }} -Dlog4j2.configurationFile={{ .Values.minion.log4j2ConfFile }} -Dplugins.dir={{ .Values.minion.pluginsDir }}"
ports:
- containerPort: {{ .Values.minion.port }}
protocol: TCP
volumeMounts:
- name: config
mountPath: /var/pinot/minion/config
{{- if .Values.minion.persistence.enabled }}
- name: data
mountPath: "{{ .Values.minion.persistence.mountPath }}"
{{- end }}
resources:
{{ toYaml .Values.minion.resources | indent 12 }}
restartPolicy: Always
volumes:
- name: config
configMap:
name: {{ include "pinot.minion.config" . }}
{{- if not .Values.minion.persistence.enabled }}
- name: data
emptyDir: {}
{{- end }}
{{- if .Values.minion.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- {{ .Values.minion.persistence.accessMode | quote }}
{{- if .Values.minion.persistence.storageClass }}
{{- if (eq "-" .Values.minion.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.minion.persistence.storageClass }}
{{- end }}
{{- end }}
resources:
requests:
storage: {{ .Values.minion.persistence.size }}
{{ end }}