Files
2026-08-26 03:39:42 +05:30

183 lines
7.3 KiB
YAML

{{- if .Values.vminsert.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
{{- with .Values.vminsert.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 4 }}
{{- with .Values.vminsert.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vminsert.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
{{- include "victoria-metrics.vminsert.matchLabels" . | nindent 6 }}
{{- if not .Values.vminsert.horizontalPodAutoscaler.enabled }}
replicas: {{ .Values.vminsert.replicaCount }}
{{- end }}
{{- with .Values.vminsert.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
template:
metadata:
{{- with .Values.vminsert.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 8 }}
{{- with .Values.vminsert.extraLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if .Values.vminsert.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.vminsert.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- with .Values.vminsert.priorityClassName }}
priorityClassName: "{{ . }}"
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- with .Values.vminsert.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.vminsert.name }}
image: "{{ .Values.vminsert.image.repository }}:{{ .Values.vminsert.image.tag }}"
imagePullPolicy: "{{ .Values.vminsert.image.pullPolicy }}"
{{- if .Values.vminsert.containerWorkingDir }}
workingDir: {{ .Values.vminsert.containerWorkingDir }}
{{- end }}
securityContext:
{{- toYaml .Values.vminsert.podSecurityContext | nindent 12 }}
args:
{{- if not .Values.vminsert.suppresStorageFQDNsRender }}
{{- include "victoria-metrics.vminsert.vmstorage-pod-fqdn" . | nindent 12 }}
{{- end }}
{{- range $key, $value := .Values.vminsert.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
env:
- name: TZ
value: Asia/Kolkata
{{- with .Values.vminsert.env }}
{{ toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8480
{{- if .Values.vminsert.extraArgs.clusternativeListenAddr }}
- name: cluster-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.clusternativeListenAddr }}
{{- end }}
{{- if .Values.vminsert.extraArgs.graphiteListenAddr }}
- name: graphite-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.graphiteListenAddr }}
{{- end }}
{{- if .Values.vminsert.extraArgs.graphiteListenAddr }}
- name: graphite-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.graphiteListenAddr }}
{{- end }}
{{- if .Values.vminsert.extraArgs.influxListenAddr }}
- name: influx-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.influxListenAddr }}
{{- end }}
{{- if .Values.vminsert.extraArgs.influxListenAddr }}
- name: influx-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.influxListenAddr }}
{{- end }}
{{- if .Values.vminsert.extraArgs.opentsdbHTTPListenAddr }}
- name: opentsdbhttp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.opentsdbHTTPListenAddr }}
{{- end }}
{{- if .Values.vminsert.extraArgs.opentsdbListenAddr }}
- name: opentsdb-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.opentsdbListenAddr }}
{{- end }}
{{- if .Values.vminsert.extraArgs.opentsdbListenAddr }}
- name: opentsdb-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.opentsdbListenAddr }}
{{- end }}
readinessProbe:
httpGet:
{{- if index .Values.vminsert.extraArgs "http.pathPrefix" }}
path: {{ trimSuffix "/" (index .Values.vminsert.extraArgs "http.pathPrefix") }}/health
{{- else }}
path: /health
{{- end }}
port: http
initialDelaySeconds: {{ .Values.vminsert.probe.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.vminsert.probe.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.vminsert.probe.readiness.timeoutSeconds }}
failureThreshold: {{ .Values.vminsert.probe.readiness.failureThreshold }}
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: {{ .Values.vminsert.probe.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.vminsert.probe.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.vminsert.probe.liveness.timeoutSeconds }}
failureThreshold: {{ .Values.vminsert.probe.liveness.failureThreshold }}
{{- with .Values.vminsert.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
resources: {{- toYaml .Values.vminsert.resources | nindent 12 }}
{{- with .Values.vminsert.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.vminsert.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}"
{{- end }}
nodeSelector:
{{- if .Values.dedicatedValue }}
dedicated: {{ include "meesho.vminsert.dedicatedValue" . }}
{{- else }}
{{- with .Values.vminsert.nodeSelector }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
tolerations:
{{- if .Values.dedicatedValue }}
- key: "dedicated"
operator: "Equal"
value: {{ include "meesho.vminsert.dedicatedValue" . }}
effect: "NoSchedule"
{{- else }}
{{- with .Values.vminsert.tolerations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.vminsert.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.vminsert.extraVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}