mirror of
https://github.com/bitnami/charts.git
synced 2026-03-14 06:47:28 +08:00
174 lines
8.2 KiB
YAML
174 lines
8.2 KiB
YAML
{{- if .Values.forwarder.enabled }}
|
|
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: {{ include "fluentd.fullname" . }}
|
|
{{- if .Values.forwarder.annotations }}
|
|
annotations: {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.annotations "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
labels: {{- include "fluentd.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: forwarder
|
|
## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
|
|
app: forwarder
|
|
spec:
|
|
selector:
|
|
matchLabels: {{- include "fluentd.matchLabels" . | nindent 6 }}
|
|
app.kubernetes.io/component: forwarder
|
|
updateStrategy: {{- toYaml .Values.forwarder.updateStrategy | nindent 4 }}
|
|
template:
|
|
metadata:
|
|
labels: {{- include "fluentd.labels" . | nindent 8 }}
|
|
app.kubernetes.io/component: forwarder
|
|
app: forwarder
|
|
{{- if .Values.forwarder.podLabels }}
|
|
{{- include "fluentd.tplValue" ( dict "value" $.Values.forwarder.podLabels "context" $ ) | nindent 8 }}
|
|
{{- end }}
|
|
annotations:
|
|
checksum/config: {{ include (print $.Template.BasePath "/forwarder-configmap.yaml") . | sha256sum }}
|
|
{{- if .Values.forwarder.podAnnotations }}
|
|
{{- include "fluentd.tplValue" (dict "value" .Values.forwarder.podAnnotations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.rbac.pspEnabled }}
|
|
checksum/psp: {{ include (print $.Template.BasePath "/forwarder-psp.yaml") . | sha256sum }}
|
|
{{- end }}
|
|
spec:
|
|
{{- include "fluentd.imagePullSecrets" . | nindent 6 }}
|
|
{{- if .Values.forwarder.hostAliases }}
|
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.forwarder.hostAliases "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ template "fluentd.forwarder.serviceAccountName" . }}
|
|
priorityClassName: {{ .Values.forwarder.priorityClassName | quote }}
|
|
{{- if .Values.forwarder.affinity }}
|
|
affinity: {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.affinity "context" $) | nindent 8 }}
|
|
{{- else }}
|
|
affinity:
|
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.forwarder.podAffinityPreset "component" "forwarder" "context" $) | nindent 10 }}
|
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.forwarder.podAntiAffinityPreset "component" "forwarder" "context" $) | nindent 10 }}
|
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.forwarder.nodeAffinityPreset.type "key" .Values.forwarder.nodeAffinityPreset.key "values" .Values.forwarder.nodeAffinityPreset.values) | nindent 10 }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.nodeSelector }}
|
|
nodeSelector: {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.nodeSelector "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.tolerations }}
|
|
tolerations: {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.tolerations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.securityContext.enabled }}
|
|
securityContext: {{- omit .Values.forwarder.securityContext "enabled" | toYaml | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.initContainers }}
|
|
initContainers: {{- include "fluentd.tplValue" ( dict "value" .Values.forwarder.initContainers "context" $ ) | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: fluentd
|
|
image: {{ include "fluentd.image" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
env:
|
|
- name: FLUENTD_CONF
|
|
value: {{ .Values.forwarder.configFile }}
|
|
- name: FLUENTD_OPT
|
|
value: {{ .Values.forwarder.extraArgs | quote }}
|
|
- name: FLUENTD_DAEMON_USER
|
|
value: {{ .Values.forwarder.daemonUser | quote }}
|
|
- name: FLUENTD_DAEMON_GROUP
|
|
value: {{ .Values.forwarder.daemonGroup | quote }}
|
|
{{- if .Values.forwarder.extraEnv }}
|
|
{{- toYaml .Values.forwarder.extraEnv | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
{{- if .Values.forwarder.containerPorts }}
|
|
{{- toYaml .Values.forwarder.containerPorts | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.metrics.enabled }}
|
|
- name: tcp-metrics
|
|
containerPort: {{ .Values.metrics.service.port }}
|
|
protocol: TCP
|
|
{{- end }}
|
|
{{- if .Values.forwarder.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: {{ .Values.forwarder.livenessProbe.httpGet.path }}
|
|
port: {{ .Values.forwarder.livenessProbe.httpGet.port }}
|
|
initialDelaySeconds: {{ .Values.forwarder.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.forwarder.livenessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.forwarder.livenessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.forwarder.livenessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.forwarder.livenessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.readinessProbe.enabled }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: {{ .Values.forwarder.readinessProbe.httpGet.path }}
|
|
port: {{ .Values.forwarder.readinessProbe.httpGet.port }}
|
|
initialDelaySeconds: {{ .Values.forwarder.readinessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.forwarder.readinessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.forwarder.readinessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.forwarder.readinessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.forwarder.readinessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.resources }}
|
|
resources: {{- toYaml .Values.forwarder.resources | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.containerSecurityContext.enabled }}
|
|
# yamllint disable rule:indentation
|
|
securityContext: {{- omit .Values.forwarder.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
|
# yamllint enable rule:indentation
|
|
{{ end }}
|
|
volumeMounts:
|
|
- name: fluentd-config
|
|
mountPath: /opt/bitnami/fluentd/conf
|
|
{{- if .Values.forwarder.persistence.enabled }}
|
|
- name: fluentd-buffer
|
|
mountPath: /opt/bitnami/fluentd/logs/buffers
|
|
{{- else }}
|
|
- name: buffer
|
|
mountPath: /opt/bitnami/fluentd/logs/buffers
|
|
{{- end }}
|
|
{{- if .Values.tls.enabled }}
|
|
- name: certs
|
|
mountPath: /opt/bitnami/fluentd/certs
|
|
{{- end }}
|
|
- name: varlog
|
|
mountPath: /var/log
|
|
- name: varlibdockercontainers
|
|
mountPath: /var/lib/docker/containers
|
|
readOnly: true
|
|
{{- if .Values.forwarder.extraVolumeMounts }}
|
|
{{- toYaml .Values.forwarder.extraVolumeMounts | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.forwarder.sidecars }}
|
|
{{- include "fluentd.tplValue" ( dict "value" .Values.forwarder.sidecars "context" $ ) | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
{{- if .Values.forwarder.extraVolumes }}
|
|
{{- toYaml .Values.forwarder.extraVolumes | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.tls.enabled }}
|
|
- name: certs
|
|
secret:
|
|
secretName: {{ template "fluentd.tls.secretName" . }}
|
|
items:
|
|
- key: tls.crt
|
|
path: tls.crt
|
|
- key: tls.key
|
|
path: tls.key
|
|
{{- end }}
|
|
- name: fluentd-config
|
|
configMap:
|
|
name: {{ template "fluentd.forwarder.configMap" . }}
|
|
{{- if .Values.forwarder.persistence.enabled }}
|
|
- name: fluentd-buffer
|
|
hostPath:
|
|
path: {{ .Values.forwarder.persistence.hostPath.path }}
|
|
type: DirectoryOrCreate
|
|
{{- else }}
|
|
- name: buffer
|
|
emptyDir: {}
|
|
{{- end }}
|
|
- name: varlog
|
|
hostPath:
|
|
path: /var/log
|
|
- name: varlibdockercontainers
|
|
hostPath:
|
|
path: /var/lib/docker/containers
|
|
{{- end }}
|