/
vmselect-deployment.yaml
105 lines (105 loc) · 3.8 KB
/
vmselect-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{{- if and .Values.vmselect.enabled (not .Values.vmselect.statefulSet.enabled) -}}
apiVersion: apps/v1
kind: Deployment
metadata:
{{- with .Values.vmselect.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
{{- with .Values.vmselect.extraLabels }}
{{ toYaml . | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
{{- include "victoria-metrics.vmselect.matchLabels" . | nindent 6 }}
replicas: {{ .Values.vmselect.replicaCount }}
template:
metadata:
{{- if .Values.vmselect.podAnnotations }}
annotations:
{{ toYaml .Values.vmselect.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 8 }}
{{- with .Values.vmselect.extraLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
spec:
{{- if .Values.vmselect.priorityClassName }}
priorityClassName: "{{ .Values.vmselect.priorityClassName }}"
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.vmselect.name }}
image: "{{ .Values.vmselect.image.repository }}:{{ .Values.vmselect.image.tag }}"
imagePullPolicy: "{{ .Values.vmselect.image.pullPolicy }}"
securityContext:
{{- toYaml .Values.vmselect.podSecurityContext | nindent 12 }}
args:
- {{ printf "%s=%s" "--cacheDataPath" .Values.vmselect.cacheMountPath | quote}}
{{- if not .Values.vmselect.suppresStorageFQDNsRender }}
{{- include "victoria-metrics.vmselect.vmstorage-pod-fqdn" . | nindent 12 }}
{{- end }}
{{- range $key, $value := .Values.vmselect.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- with .Values.vmselect.env }}
env: {{ toYaml . | nindent 10 }}
{{- end }}
ports:
- name: http
containerPort: 8481
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 15
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
volumeMounts:
- mountPath: {{ .Values.vmselect.cacheMountPath }}
name: cache-volume
resources:
{{ toYaml .Values.vmselect.resources | indent 12 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.vmselect.nodeSelector }}
nodeSelector:
{{ toYaml .Values.vmselect.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vmselect.securityContext }}
securityContext:
{{ toYaml .Values.vmselect.securityContext | indent 8 }}
{{- end }}
{{- if .Values.serviceAccount.create }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- end }}
{{- if .Values.vmselect.tolerations }}
tolerations:
{{ toYaml .Values.vmselect.tolerations | indent 8 }}
{{- end }}
{{- if .Values.vmselect.affinity }}
affinity:
{{ toYaml .Values.vmselect.affinity | indent 8 }}
{{- end }}
volumes:
- name: cache-volume
{{- if .Values.vmselect.persistentVolume.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.vmselect.persistentVolume.existingClaim }}{{ .Values.vmselect.persistentVolume.existingClaim }}{{- else }}{{ template "victoria-metrics.vmselect.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- end }}