kubezero/charts/manticore/charts/manticoresearch/templates/manticore-balancer.yaml

112 lines
4.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "manticoresearch.fullname" . }}-balancer
labels:
name: {{ include "manticoresearch.fullname" . }}-balancer
{{- include "manticoresearch.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
name: {{ include "manticoresearch.fullname" . }}-balancer
template:
metadata:
{{- if or .Values.exporter.enabled .Values.podAnnotations }}
annotations:
{{- if .Values.exporter.enabled }}
{{- toYaml .Values.exporter.annotations | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
labels:
name: {{ include "manticoresearch.fullname" . }}-balancer
{{- include "manticoresearch.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "manticoresearch.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-balancer
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.balancer.image.repository }}:{{ .Values.balancer.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.balancer.image.pullPolicy }}
env:
- name: OBSERVER_RUN_INTERVAL
value: "{{ .Values.balancer.runInterval }}"
{{- if .Values.optimize.enabled }}
- name: OPTIMIZE_RUN_INTERVAL
value: "{{ .Values.optimize.interval }}"
- name: CHUNKS_COEFFICIENT
value: "{{ .Values.optimize.coefficient }}"
{{- end }}
- name: WORKER_LABEL
value: "manticore-worker"
- name: CONFIGMAP_PATH
value: {{ .Values.balancer.config.path }}
- name: BALANCER_PORT
value: "{{ .Values.balancer.service.ql.port }}"
- name: WORKER_PORT
value: "{{ .Values.worker.service.ql.port }}"
readinessProbe:
tcpSocket:
port: {{ .Values.balancer.service.ql.port }}
initialDelaySeconds: 5
periodSeconds: 3
livenessProbe:
tcpSocket:
port: {{ .Values.balancer.service.ql.port }}
initialDelaySeconds: 5
periodSeconds: 3
volumeMounts:
- name: config-volume
mountPath: {{ .Values.balancer.config.path }}
subPath: manticore.conf
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- if .Values.exporter.enabled }}
- name: {{ .Chart.Name }}-exporter
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.exporter.image.repository }}:{{ .Values.exporter.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.exporter.image.pullPolicy }}
env:
- name: MANTICORE_HOST
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: MANTICORE_PORT
value: "{{ .Values.balancer.service.ql.targetPort }}"
livenessProbe:
httpGet:
path: /health
port: {{ index .Values.exporter.annotations "prometheus.io/port" }}
initialDelaySeconds: 3
periodSeconds: 3
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- end }}
volumes:
- name: config-volume
configMap:
name: {{ include "manticoresearch.fullname" . }}-balancer-config
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}