3# DaemonSet, Deployment or StatefulSet
5# azureblob, cloudwatch, elasticsearch7, elasticsearch8, gcs, graylog , kafka, kafka2, kinesis, opensearch
7# # Only applicable for Deployment or StatefulSet
11 repository: cgr.dev/chainguard-private/fluentd-kubernetes-daemonset
12 pullPolicy: "IfNotPresent"
13 tag: latest@sha256:84326576b43e9ba97b9e48600e87f87d0fdf2e7318519b122d89c3c41ccf1da9
14## Optional array of imagePullSecrets containing private registry credentials
15## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
23# from Kubernetes 1.25, PSP is deprecated
24# See: https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes
25# We automatically disable PSP if Kubernetes version is 1.25 or higher
29## Security Context policies for controller pods
30## See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ for
31## notes on enabling and using sysctls
41# readOnlyRootFilesystem: true
45# Configure the livecycle
46# Ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/
50# command: ["/bin/sh", "-c", "sleep 20"]
52# Configure the livenessProbe
53# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
58 # initialDelaySeconds: 0
63# Configure the readinessProbe
64# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
69 # initialDelaySeconds: 0
81## only available if kind is Deployment
86 targetCPUUtilizationPercentage: 80
87 # targetMemoryUtilizationPercentage: 80
88 ## see https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics
93 # name: packets-per-second
97 ## see https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior
107# priorityClassName: "system-node-critical"
109## Node tolerations for server scheduling to nodes with taints
110## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
115# effect: "NoSchedule"
117## Affinity and anti-affinity
118## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
121## Annotations to be added to fluentd DaemonSet/Deployment
124## Labels to be added to fluentd DaemonSet/Deployment
127## Annotations to be added to fluentd pods
130## Labels to be added to fluentd pods
133## How long (in seconds) a pods needs to be stable before progressing the deployment
136## How long (in seconds) a pod may take to exit (useful with lifecycle hooks to ensure lb deregistration is done)
138terminationGracePeriodSeconds:
139## Deployment strategy / DaemonSet updateStrategy
146## Additional environment variables to set for fluentd pods
148# - name: "FLUENTD_CONF"
149# value: "../../../etc/fluent/fluent.conf"
150# - name: FLUENT_ELASTICSEARCH_HOST
151# value: "elasticsearch-master"
152# - name: FLUENT_ELASTICSEARCH_PORT
157## Name of the configMap containing a custom fluentd.conf configuration file to use instead of the default.
158# mainConfigMapNameOverride: ""
160## Name of the configMap containing files to be placed under /etc/fluent/config.d/
161## NOTE: This will replace ALL default files in the aforementioned path!
162# extraFilesConfigMapNameOverride: ""
163mountVarLogDirectory: true
164mountDockerContainersDirectory: true
167## Only available if kind is StatefulSet
168## Fluentd persistence
173 accessMode: ReadWriteOnce
182 # externalTrafficPolicy: Local
184 # - name: "forwarder"
186 # containerPort: 24224
187## Prometheus Monitoring
193 release: prometheus-operator
195 namespaceSelector: {}
196 ## metric relabel configs to apply to samples before ingestion.
198 metricRelabelings: []
199 # - sourceLabels: [__name__]
201 # regex: ^fluentd_output_status_buffer_(oldest|newest)_.+
204 ## relabel configs to apply to samples after ingestion.
207 # - sourceLabels: [__meta_kubernetes_pod_node_name]
210 # targetLabel: nodename
213 ## Additional serviceMonitor config
216 # scrapeInterval: 30s
224 # - alert: FluentdDown
225 # expr: up{job="fluentd"} == 0
231 # summary: "Fluentd Down"
232 # description: "{{ $labels.pod }} on {{ $labels.nodename }} is down"
233 # - alert: FluentdScrapeMissing
234 # expr: absent(up{job="fluentd"} == 1)
240 # summary: "Fluentd Scrape Missing"
241 # description: "Fluentd instance has disappeared from Prometheus target discovery"
242## Grafana Monitoring Dashboard
248 grafana_dashboard: '"1"'
249## Fluentd list of plugins to install
252# - fluent-plugin-out-http
254## Add fluentd config files from K8s configMaps
257# - fluentd-prometheus-conf
258# - fluentd-systemd-conf
260## Fluentd configurations:
267 @id in_tail_container_logs
269 path /var/log/containers/*.log
270 pos_file /var/log/fluentd-containers.log.pos
279 time_format "%Y-%m-%dT%H:%M:%S.%NZ"
284 expression /^(?<time>.+) (?<stream>stdout|stderr)( (.))? (?<log>.*)$/
285 time_format '%Y-%m-%dT%H:%M:%S.%NZ'
289 emit_unmatched_lines true
292 # expose metrics in prometheus format
297 metrics_path /metrics
301 <match kubernetes.var.log.containers.fluentd**>
306 # <match kubernetes.var.log.containers.**_kube-system_**>
308 # @id ignore_kube_system_logs
311 <filter kubernetes.**>
312 @type kubernetes_metadata
313 @id filter_kube_metadata
315 skip_container_metadata false
316 skip_namespace_metadata true
330 name fluentd_input_status_num_records_total
332 desc The total number of incoming records
349 host "elasticsearch-master"
354 # Don't wait for elastic to start up.
355 verify_es_version_at_startup false
361 # kubernetes.io/ingress.class: nginx
362 # kubernetes.io/tls-acme: "true"
364 # - host: fluentd.example.tld
367 # - secretName: fluentd-tls
369 # - fluentd.example.tld