-
Notifications
You must be signed in to change notification settings - Fork 307
Description
Describe the issue
When using docker as the container-engine, fluent-operator-deployment.yaml makes an "init" container using the community docker image and executes this:
echo CONTAINER_ROOT_DIR=$(docker info -f '{{`{{.DockerRootDir}}`}}' 2> /dev/null) > /fluent-operator/fluent-bit.env
However, when the container-engine is not docker it still uses the "init" container and runs commands like:
echo CONTAINER_ROOT_DIR={{ .Values.operator.logPath.containerd }} > /fluent-operator/fluent-bit.env
echo CONTAINER_ROOT_DIR={{ .Values.operator.logPath.crio }} > /fluent-operator/fluent-bit.env
PROBLEM: The use of the community docker image introduces a lot of maintenance overhead, security risk and confusion. Also, there is just no reason for yet another container to be running, since it can be done via ConfigMap with Volume.
To Reproduce
See the init containers in https://github.com/fluent/fluent-operator/blob/master/charts/fluent-operator/templates/fluent-operator-deployment.yaml.
Expected behavior
For containerd & crio, use a configMap with volume, which eliminates need for an init container.
For example (or to an existing configMap):
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit.env
data:
## TODO: with logic here or elsewhere to choose between the container engines
fluent-bit.env: |
CONTAINER_ROOT_DIR={{ .Values.operator.logPath.containerd }}
And deployment spec containing:
volumeMounts:
- name: env
mountPath: /fluent-operator
volumes:
- name: env
configMap:
name: fluent-bit.env
items:
- key: fluent-bit.env
path: fluent-bit.env
Your Environment
- Fluent Operator version: v3.4.0
- Container Runtime: containerd
- Operating system: n/a
- Kernel version: n/aHow did you install fluent operator?
Helm
Additional context
No response