249 lines
10 KiB
YAML
249 lines
10 KiB
YAML
{{- if .Values.vmstorage.enabled -}}
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
{{- with .Values.vmstorage.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "victoria-metrics.vmstorage.labels" . | nindent 4 }}
|
|
{{- with .Values.vmstorage.extraLabels }}
|
|
{{ toYaml . | indent 4 }}
|
|
{{- end }}
|
|
name: {{ template "victoria-metrics.vmstorage.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
spec:
|
|
serviceName: {{ template "victoria-metrics.vmstorage.fullname" . }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "victoria-metrics.vmstorage.matchLabels" . | nindent 6 }}
|
|
replicas: {{ .Values.vmstorage.replicaCount }}
|
|
podManagementPolicy: {{ .Values.vmstorage.podManagementPolicy }}
|
|
template:
|
|
metadata:
|
|
{{- if .Values.vmstorage.podAnnotations }}
|
|
annotations:
|
|
{{ toYaml .Values.vmstorage.podAnnotations | indent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "victoria-metrics.vmstorage.labels" . | nindent 8 }}
|
|
{{- with .Values.vmstorage.extraLabels }}
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.vmstorage.topologySpreadConstraints }}
|
|
topologySpreadConstraints:
|
|
{{ toYaml .Values.vmstorage.topologySpreadConstraints | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.vmstorage.priorityClassName }}
|
|
priorityClassName: "{{ .Values.vmstorage.priorityClassName }}"
|
|
{{- end }}
|
|
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
|
|
{{- if eq (include "victoria-metrics.storage.hasInitContainer" . ) "true" }}
|
|
initContainers:
|
|
{{- include "victoria-metrics.storage.initContiners" . | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.vmstorage.name }}
|
|
image: "{{ .Values.vmstorage.image.repository }}:{{ .Values.vmstorage.image.tag }}"
|
|
imagePullPolicy: "{{ .Values.vmstorage.image.pullPolicy }}"
|
|
{{- if .Values.vmstorage.containerWorkingDir }}
|
|
workingDir: {{ .Values.vmstorage.containerWorkingDir }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.vmstorage.podSecurityContext | nindent 12 }}
|
|
args:
|
|
- {{ printf "%s=%s" "--retentionPeriod" (toString .Values.vmstorage.retentionPeriod) | quote}}
|
|
- {{ printf "%s=%s" "--storageDataPath" .Values.vmstorage.persistentVolume.mountPath | quote}}
|
|
{{- range $key, $value := .Values.vmstorage.extraArgs }}
|
|
- --{{ $key }}={{ $value }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8482
|
|
- name: vminsert
|
|
containerPort: 8400
|
|
- name: vmselect
|
|
containerPort: 8401
|
|
env:
|
|
- name: TZ
|
|
value: Asia/Kolkata
|
|
{{- with .Values.vmstorage.env }}
|
|
{{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with $.Values.vmstorage.probe.liveness }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with $.Values.vmstorage.probe.readiness }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
resources: {{ toYaml .Values.vmstorage.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: vmstorage-volume
|
|
mountPath: {{ .Values.vmstorage.persistentVolume.mountPath }}
|
|
subPath: {{ .Values.vmstorage.persistentVolume.subPath }}
|
|
{{- range .Values.vmstorage.extraHostPathMounts }}
|
|
- name: {{ .name }}
|
|
mountPath: {{ .mountPath }}
|
|
subPath: {{ .subPath }}
|
|
readOnly: {{ .readOnly }}
|
|
{{- end }}
|
|
{{- range .Values.vmstorage.extraConfigmapMounts }}
|
|
- name: {{ $.Values.vmstorage.name }}-{{ .name }}
|
|
mountPath: {{ .mountPath }}
|
|
subPath: {{ .subPath }}
|
|
readOnly: {{ .readOnly }}
|
|
{{- end }}
|
|
{{- range .Values.vmstorage.extraSecretMounts }}
|
|
- name: {{ .name }}
|
|
mountPath: {{ .mountPath }}
|
|
subPath: {{ .subPath }}
|
|
readOnly: {{ .readOnly }}
|
|
{{- end }}
|
|
{{- with .Values.vmstorage.extraVolumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.vmstorage.vmbackupmanager.enable }}
|
|
- name: {{ template "victoria-metrics.name" . }}-vmbackupmanager
|
|
image: "{{ .Values.vmstorage.vmbackupmanager.image.repository }}:{{ .Values.vmstorage.vmbackupmanager.image.tag }}"
|
|
imagePullPolicy: "{{ .Values.vmstorage.image.pullPolicy }}"
|
|
{{- with .Values.vmstorage.podSecurityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
args:
|
|
- {{ printf "%s=%t" "--eula" .Values.vmstorage.vmbackupmanager.eula | quote}}
|
|
- {{ printf "%s=%t" "--disableHourly" .Values.vmstorage.vmbackupmanager.disableHourly | quote}}
|
|
- {{ printf "%s=%t" "--disableDaily" .Values.vmstorage.vmbackupmanager.disableDaily | quote}}
|
|
- {{ printf "%s=%t" "--disableWeekly" .Values.vmstorage.vmbackupmanager.disableWeekly | quote}}
|
|
- {{ printf "%s=%t" "--disableMonthly" .Values.vmstorage.vmbackupmanager.disableMonthly | quote}}
|
|
- {{ printf "%s=%d" "--keepLastHourly" (int .Values.vmstorage.vmbackupmanager.retention.keepLastHourly) | quote}}
|
|
- {{ printf "%s=%d" "--keepLastDaily" (int .Values.vmstorage.vmbackupmanager.retention.keepLastDaily) | quote}}
|
|
- {{ printf "%s=%d" "--keepLastWeekly" (int .Values.vmstorage.vmbackupmanager.retention.keepLastWeekly) | quote}}
|
|
- {{ printf "%s=%d" "--keepLastMonthly" (int .Values.vmstorage.vmbackupmanager.retention.keepLastMonthly) | quote}}
|
|
- {{ printf "%s=%s" "--storageDataPath" .Values.vmstorage.persistentVolume.mountPath | quote}}
|
|
- "--dst={{ .Values.vmstorage.vmbackupmanager.destination }}/$(POD_NAME)"
|
|
- "--snapshot.createURL=http://localhost:8482/snapshot/create"
|
|
- "--snapshot.deleteURL=http://localhost:8482/snapshot/delete"
|
|
{{- range $key, $value := .Values.vmstorage.vmbackupmanager.extraArgs }}
|
|
- --{{ $key }}={{ $value }}
|
|
{{- end }}
|
|
{{- with .Values.vmstorage.vmbackupmanager.resources }}
|
|
resources: {{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with $.Values.vmstorage.vmbackupmanager.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with $.Values.vmstorage.vmbackupmanager.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: TZ
|
|
value: Asia/Kolkata
|
|
- name: POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
{{- with .Values.vmstorage.vmbackupmanager.env }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: manager-http
|
|
containerPort: 8300
|
|
volumeMounts:
|
|
- name: vmstorage-volume
|
|
mountPath: {{ .Values.vmstorage.persistentVolume.mountPath }}
|
|
subPath: {{ .Values.vmstorage.persistentVolume.subPath }}
|
|
{{- range .Values.vmstorage.vmbackupmanager.extraSecretMounts }}
|
|
- name: {{ .name }}
|
|
mountPath: {{ .mountPath }}
|
|
subPath: {{ .subPath }}
|
|
readOnly: {{ .readOnly }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- with .Values.vmstorage.extraContainers }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{ toYaml .Values.imagePullSecrets | indent 2 }}
|
|
{{- end }}
|
|
{{- if .Values.vmstorage.securityContext }}
|
|
securityContext:
|
|
{{ toYaml .Values.vmstorage.securityContext | indent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
|
|
{{- if .Values.schedulerName }}
|
|
schedulerName: "{{ .Values.schedulerName }}"
|
|
{{- end }}
|
|
nodeSelector:
|
|
{{- if .Values.dedicatedValue }}
|
|
dedicated: {{ include "meesho.vmstorage.dedicatedValue" . }}
|
|
{{- else }}
|
|
{{- with .Values.vmstorage.nodeSelector }}
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
tolerations:
|
|
{{- if .Values.dedicatedValue }}
|
|
- key: "dedicated"
|
|
operator: "Equal"
|
|
value: {{ include "meesho.vmstorage.dedicatedValue" . }}
|
|
effect: "NoSchedule"
|
|
{{- else }}
|
|
{{- with .Values.vmstorage.tolerations }}
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.vmstorage.affinity }}
|
|
affinity:
|
|
{{ toYaml .Values.vmstorage.affinity | indent 8 }}
|
|
{{- end }}
|
|
terminationGracePeriodSeconds: {{ .Values.vmstorage.terminationGracePeriodSeconds }}
|
|
volumes:
|
|
{{- with .Values.vmstorage.extraVolumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- if not .Values.vmstorage.persistentVolume.enabled }}
|
|
- name: vmstorage-volume
|
|
emptyDir: {}
|
|
{{- else }}
|
|
{{- if .Values.vmstorage.persistentVolume.existingClaim }}
|
|
- name: vmstorage-volume
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Values.vmstorage.persistentVolume.existingClaim }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if and .Values.vmstorage.persistentVolume.enabled (not .Values.vmstorage.persistentVolume.existingClaim) }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: vmstorage-volume
|
|
{{- if .Values.vmstorage.persistentVolume.annotations }}
|
|
annotations:
|
|
{{ toYaml .Values.vmstorage.persistentVolume.annotations | indent 10 }}
|
|
{{- end }}
|
|
{{- if .Values.vmstorage.persistentVolume.labels }}
|
|
labels:
|
|
{{ toYaml .Values.vmstorage.persistentVolume.labels | indent 10 }}
|
|
{{- end }}
|
|
spec:
|
|
accessModes:
|
|
{{ toYaml .Values.vmstorage.persistentVolume.accessModes | indent 10 }}
|
|
resources:
|
|
requests:
|
|
storage: "{{ .Values.vmstorage.persistentVolume.size }}"
|
|
{{- if .Values.vmstorage.persistentVolume.storageClass }}
|
|
{{- if (eq "-" .Values.vmstorage.persistentVolume.storageClass) }}
|
|
storageClassName: ""
|
|
{{- else }}
|
|
storageClassName: "{{ .Values.vmstorage.persistentVolume.storageClass }}"
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|