|
| 1 | +{{- /* |
| 2 | +Copyright Drycc Community. |
| 3 | +SPDX-License-Identifier: APACHE-2.0 |
| 4 | +*/}} |
| 5 | + |
| 6 | +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} |
| 7 | +kind: Deployment |
| 8 | +metadata: |
| 9 | + name: {{ include "fluentbit.deployment.fullname" . }} |
| 10 | + namespace: {{ include "common.names.namespace" . | quote }} |
| 11 | + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 12 | + {{- if or .Values.deployment.deploymentAnnotations .Values.commonAnnotations }} |
| 13 | + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.deployment.deploymentAnnotations .Values.commonAnnotations) "context" .) }} |
| 14 | + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} |
| 15 | + {{- end }} |
| 16 | +spec: |
| 17 | + replicas: 1 |
| 18 | + {{- if .Values.deployment.updateStrategy }} |
| 19 | + strategy: {{- toYaml .Values.deployment.updateStrategy | nindent 4 }} |
| 20 | + {{- end }} |
| 21 | + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.deployment.podLabels .Values.commonLabels) "context" .) }} |
| 22 | + selector: |
| 23 | + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} |
| 24 | + template: |
| 25 | + metadata: |
| 26 | + {{- if .Values.deployment.podAnnotations }} |
| 27 | + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.deployment.podAnnotations "context" $) | nindent 8 }} |
| 28 | + {{- end }} |
| 29 | + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} |
| 30 | + spec: |
| 31 | + serviceAccountName: {{ template "fluentbit.serviceAccountName" . }} |
| 32 | + {{- include "fluentbit.imagePullSecrets" . | nindent 6 }} |
| 33 | + {{- if .Values.deployment.hostAliases }} |
| 34 | + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.deployment.hostAliases "context" $) | nindent 8 }} |
| 35 | + {{- end }} |
| 36 | + {{- if .Values.deployment.affinity }} |
| 37 | + affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.deployment.affinity "context" $) | nindent 8 }} |
| 38 | + {{- else }} |
| 39 | + affinity: |
| 40 | + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.deployment.podAffinityPreset "component" "deployment" "customLabels" $podLabels "context" $) | nindent 10 }} |
| 41 | + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.deployment.podAntiAffinityPreset "component" "deployment" "customLabels" $podLabels "context" $) | nindent 10 }} |
| 42 | + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.deployment.nodeAffinityPreset.type "key" .Values.deployment.nodeAffinityPreset.key "values" .Values.deployment.nodeAffinityPreset.values) | nindent 10 }} |
| 43 | + {{- end }} |
| 44 | + {{- if .Values.deployment.nodeSelector }} |
| 45 | + nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.deployment.nodeSelector "context" $) | nindent 8 }} |
| 46 | + {{- end }} |
| 47 | + {{- if .Values.deployment.tolerations }} |
| 48 | + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.deployment.tolerations "context" .) | nindent 8 }} |
| 49 | + {{- end }} |
| 50 | + {{- if .Values.deployment.priorityClassName }} |
| 51 | + priorityClassName: {{ .Values.deployment.priorityClassName | quote }} |
| 52 | + {{- end }} |
| 53 | + {{- if .Values.deployment.schedulerName }} |
| 54 | + schedulerName: {{ .Values.deployment.schedulerName | quote }} |
| 55 | + {{- end }} |
| 56 | + {{- if .Values.deployment.topologySpreadConstraints }} |
| 57 | + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.deployment.topologySpreadConstraints "context" .) | nindent 8 }} |
| 58 | + {{- end }} |
| 59 | + {{- if .Values.deployment.podSecurityContext.enabled }} |
| 60 | + securityContext: {{- omit .Values.deployment.podSecurityContext "enabled" | toYaml | nindent 8 }} |
| 61 | + {{- end }} |
| 62 | + {{- if .Values.deployment.terminationGracePeriodSeconds }} |
| 63 | + terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }} |
| 64 | + {{- end }} |
| 65 | + containers: |
| 66 | + - name: controller |
| 67 | + image: {{ include "fluentbit.image" . }} |
| 68 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 69 | + {{- if .Values.deployment.containerSecurityContext.enabled }} |
| 70 | + securityContext: {{- omit .Values.deployment.containerSecurityContext "enabled" | toYaml | nindent 10 }} |
| 71 | + {{- end }} |
| 72 | + {{- if .Values.diagnosticMode.enabled }} |
| 73 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 10 }} |
| 74 | + {{- else if .Values.deployment.command }} |
| 75 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.deployment.command "context" $) | nindent 10 }} |
| 76 | + {{- end }} |
| 77 | + {{- if .Values.diagnosticMode.enabled }} |
| 78 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 10 }} |
| 79 | + {{- else if .Values.deployment.args }} |
| 80 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.deployment.args "context" $) | nindent 10 }} |
| 81 | + {{- end }} |
| 82 | + env: |
| 83 | + - name: FLUENTBIT_EXTRA_ARGS |
| 84 | + value: --namespace {{ .Release.Namespace }} --daemonset-name {{ include "fluentbit.daemonset.fullname" . }} --retry-interval {{ .Values.deployment.retryInterval }} |
| 85 | + - name: DRYCC_DEBUG |
| 86 | + value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} |
| 87 | + {{- if .Values.deployment.extraEnvVars }} |
| 88 | + {{- include "common.tplvalues.render" (dict "value" .Values.deployment.extraEnvVars "context" $) | nindent 10 }} |
| 89 | + {{- end }} |
| 90 | + envFrom: |
| 91 | + {{- if .Values.deployment.extraEnvVarsCM }} |
| 92 | + - configMapRef: |
| 93 | + name: {{ include "common.tplvalues.render" (dict "value" .Values.deployment.extraEnvVarsCM "context" $) }} |
| 94 | + {{- end }} |
| 95 | + {{- if .Values.deployment.extraEnvVarsSecret }} |
| 96 | + - secretRef: |
| 97 | + name: {{ include "common.tplvalues.render" (dict "value" .Values.deployment.extraEnvVarsSecret "context" $) }} |
| 98 | + {{- end }} |
| 99 | + {{- if .Values.deployment.resources }} |
| 100 | + resources: {{- toYaml .Values.deployment.resources | nindent 12 }} |
| 101 | + {{- end }} |
| 102 | + {{- if .Values.deployment.sidecars }} |
| 103 | + {{- include "common.tplvalues.render" ( dict "value" .Values.deployment.sidecars "context" $) | nindent 8 }} |
| 104 | + {{- end }} |
0 commit comments