helm-charts
helm-charts copied to clipboard
Why are clusterroles needed?
Hi,
I am thinking of using FluentD in a secure cluster to consume messages from kafka and ship them to elasticsearch after some parsing and i am a bit curious why this clusterrole is needed, why does fluentd need to get/list/watch pods and namespaces?
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "fluentd.fullname" . }}
labels:
{{- include "fluentd.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- pods
- namespaces
verbs:
- get
- list
- watch
{{- if and .Values.podSecurityPolicy.enabled (semverCompare "<1.25-0" .Capabilities.KubeVersion.GitVersion) }}
- apiGroups:
- policy
resourceNames:
- {{ include "fluentd.fullname" . }}
resources:
- podsecuritypolicies
verbs:
- use
{{- end }}
{{- end -}}
https://docs.fluentbit.io/manual/pipeline/filters/kubernetes - see under Query Kubernetes API Server to obtain extra metadata for the POD in question
...