mirror of https://github.com/k3s-io/k3s
Merge pull request #71124 from Random-Liu/make-fluentd-container-runtime-service-configurable
Make fluentd container runtime service configurable.pull/58/head
commit
a19bf332de
|
@ -320,7 +320,7 @@ data:
|
|||
<source>
|
||||
@id journald-container-runtime
|
||||
@type systemd
|
||||
matches [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
|
||||
matches [{ "_SYSTEMD_UNIT": "{{ fluentd_container_runtime_service }}.service" }]
|
||||
<storage>
|
||||
@type local
|
||||
persistent true
|
||||
|
|
|
@ -251,7 +251,7 @@ data:
|
|||
|
||||
<source>
|
||||
@type systemd
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ fluentd_container_runtime_service }}.service" }]
|
||||
pos_file /var/log/gcp-journald-container-runtime.pos
|
||||
read_from_head true
|
||||
tag container-runtime
|
||||
|
@ -287,7 +287,7 @@ data:
|
|||
@type grep
|
||||
<exclude>
|
||||
key _SYSTEMD_UNIT
|
||||
pattern ^(docker|{{ container_runtime }}|kubelet|node-problem-detector)\.service$
|
||||
pattern ^(docker|{{ fluentd_container_runtime_service }}|kubelet|node-problem-detector)\.service$
|
||||
</exclude>
|
||||
</filter>
|
||||
# END_NODE_JOURNAL
|
||||
|
|
|
@ -266,7 +266,7 @@ data:
|
|||
|
||||
<source>
|
||||
@type systemd
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ fluentd_container_runtime_service }}.service" }]
|
||||
pos_file /var/log/gcp-journald-container-runtime.pos
|
||||
read_from_head true
|
||||
tag container-runtime
|
||||
|
@ -302,7 +302,7 @@ data:
|
|||
@type grep
|
||||
<exclude>
|
||||
key _SYSTEMD_UNIT
|
||||
pattern ^(docker|{{ container_runtime }}|kubelet|node-problem-detector)\.service$
|
||||
pattern ^(docker|{{ fluentd_container_runtime_service }}|kubelet|node-problem-detector)\.service$
|
||||
</exclude>
|
||||
</filter>
|
||||
# END_NODE_JOURNAL
|
||||
|
|
|
@ -2232,14 +2232,14 @@ function start-fluentd-resource-update {
|
|||
wait-for-apiserver-and-update-fluentd &
|
||||
}
|
||||
|
||||
# Update {{ container-runtime }} with actual container runtime name,
|
||||
# and {{ container-runtime-endpoint }} with actual container runtime
|
||||
# Update {{ fluentd_container_runtime_service }} with actual container runtime name,
|
||||
# and {{ container_runtime_endpoint }} with actual container runtime
|
||||
# endpoint.
|
||||
function update-container-runtime {
|
||||
local -r file="$1"
|
||||
local -r container_runtime_endpoint="${CONTAINER_RUNTIME_ENDPOINT:-unix:///var/run/dockershim.sock}"
|
||||
sed -i \
|
||||
-e "s@{{ *container_runtime *}}@${CONTAINER_RUNTIME_NAME:-docker}@g" \
|
||||
-e "s@{{ *fluentd_container_runtime_service *}}@${FLUENTD_CONTAINER_RUNTIME_SERVICE:-${CONTAINER_RUNTIME_NAME:-docker}}@g" \
|
||||
-e "s@{{ *container_runtime_endpoint *}}@${container_runtime_endpoint#unix://}@g" \
|
||||
"${file}"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue