123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- {{- $app := .Values.vminsert -}}
- {{- if $app.enabled -}}
- {{- $ctx := dict "helm" . "appKey" "vminsert" }}
- {{- $fullname := include "vm.plain.fullname" $ctx }}
- {{- $sa := include "vm.fullname" $ctx }}
- {{- $ns := include "vm.namespace" $ctx }}
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- {{- with $app.annotations }}
- annotations: {{ toYaml . | nindent 4 }}
- {{- end }}
- {{- $_ := set $ctx "extraLabels" $app.extraLabels }}
- labels: {{ include "vm.labels" $ctx | nindent 4 }}
- {{- $_ := unset $ctx "extraLabels" }}
- name: {{ $fullname }}
- namespace: {{ $ns }}
- spec:
- selector:
- matchLabels: {{ include "vm.selectorLabels" $ctx | nindent 6 }}
- {{- if not $app.horizontalPodAutoscaler.enabled }}
- replicas: {{ $app.replicaCount }}
- {{- end }}
- {{- with $app.strategy }}
- strategy: {{ toYaml . | nindent 4 }}
- {{- end }}
- template:
- metadata:
- {{- with $app.podAnnotations }}
- annotations: {{ toYaml . | nindent 8 }}
- {{- end }}
- {{- $_ := set $ctx "extraLabels" $app.podLabels }}
- labels: {{ include "vm.podLabels" $ctx | nindent 8 }}
- spec:
- {{- with $app.priorityClassName }}
- priorityClassName: {{ . }}
- {{- end }}
- {{- with $app.initContainers }}
- initContainers: {{ toYaml . | nindent 8 }}
- {{- end }}
- {{- with ($app.imagePullSecrets | default .Values.global.imagePullSecrets) }}
- imagePullSecrets: {{ toYaml . | nindent 8 }}
- {{- end }}
- containers:
- - name: vminsert
- {{- $_ := set $ctx "app" $app }}
- image: {{ include "vm.image" $ctx }}
- imagePullPolicy: {{ $app.image.pullPolicy }}
- {{- with $app.containerWorkingDir }}
- workingDir: {{ . }}
- {{- end }}
- {{- if $app.securityContext.enabled }}
- securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.securityContext "helm" .) | nindent 12 }}
- {{- end }}
- args: {{ include "vminsert.args" . | nindent 12 }}
- {{- with $app.envFrom }}
- envFrom: {{ toYaml . | nindent 12 }}
- {{- end }}
- {{- with $app.env }}
- env: {{ toYaml . | nindent 12 }}
- {{- end }}
- ports:
- - name: {{ $app.ports.name | default "http" }}
- containerPort: {{ include "vm.port.from.flag" (dict "flag" $app.extraArgs.httpListenAddr "default" "8480") }}
- {{- with $app.extraArgs.clusternativeListenAddr }}
- - name: cluster-tcp
- protocol: TCP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- {{- end }}
- {{- with $app.extraArgs.graphiteListenAddr }}
- - name: graphite-tcp
- protocol: TCP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- - name: graphite-udp
- protocol: UDP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- {{- end }}
- {{- with $app.extraArgs.influxListenAddr }}
- - name: influx-tcp
- protocol: TCP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- - name: influx-udp
- protocol: UDP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- {{- end }}
- {{- with $app.extraArgs.opentsdbHTTPListenAddr }}
- - name: opentsdbhttp
- protocol: TCP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- {{- end }}
- {{- with $app.extraArgs.opentsdbListenAddr }}
- - name: opentsdb-tcp
- protocol: TCP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- - name: opentsdb-udp
- protocol: UDP
- containerPort: {{ include "vm.port.from.flag" (dict "flag" .) }}
- {{- end }}
- {{- with (fromYaml (include "vm.probe" (dict "app" $app "type" "readiness"))) }}
- readinessProbe: {{ toYaml . | nindent 12 }}
- {{- end }}
- {{- with (fromYaml (include "vm.probe" (dict "app" $app "type" "liveness"))) }}
- livenessProbe: {{ toYaml . | nindent 12 }}
- {{- end }}
- {{- with (fromYaml (include "vm.probe" (dict "app" $app "type" "startup"))) }}
- startupProbe: {{ toYaml . | nindent 12 }}
- {{- end }}
- {{- if or $app.extraVolumeMounts (include "vm.license.mount" .) }}
- volumeMounts:
- {{- with $app.extraVolumeMounts }}
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- include "vm.license.mount" . | nindent 12 }}
- {{- end }}
- {{- with $app.resources }}
- resources: {{ toYaml . | nindent 12 }}
- {{- end }}
- {{- with $app.extraContainers }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with $app.nodeSelector }}
- nodeSelector: {{ toYaml . | nindent 8 }}
- {{- end }}
- {{- if $app.podSecurityContext.enabled }}
- securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
- {{- end }}
- {{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
- automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
- serviceAccountName: {{ (.Values.serviceAccount).name | default $sa }}
- {{- end }}
- {{- with $app.tolerations }}
- tolerations: {{ toYaml . | nindent 8 }}
- {{- end }}
- {{- with $app.affinity }}
- affinity: {{ toYaml . | nindent 8 }}
- {{- end }}
- {{- with $app.topologySpreadConstraints }}
- topologySpreadConstraints: {{ toYaml . | nindent 8 }}
- {{- end }}
- {{- if or (and (include "vm.license.secret.key" .) (include "vm.license.secret.name" .)) $app.extraVolumes }}
- volumes:
- {{- with $app.extraVolumes }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- include "vm.license.volume" . | nindent 8 }}
- {{- end }}
- {{- end }}
|