mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Make fluentd container runtime service configurable.
This commit is contained in:
		@@ -320,7 +320,7 @@ data:
 | 
				
			|||||||
    <source>
 | 
					    <source>
 | 
				
			||||||
      @id journald-container-runtime
 | 
					      @id journald-container-runtime
 | 
				
			||||||
      @type systemd
 | 
					      @type systemd
 | 
				
			||||||
      matches [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
 | 
					      matches [{ "_SYSTEMD_UNIT": "{{ fluentd_container_runtime_service }}.service" }]
 | 
				
			||||||
      <storage>
 | 
					      <storage>
 | 
				
			||||||
        @type local
 | 
					        @type local
 | 
				
			||||||
        persistent true
 | 
					        persistent true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -251,7 +251,7 @@ data:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    <source>
 | 
					    <source>
 | 
				
			||||||
      @type systemd
 | 
					      @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
 | 
					      pos_file /var/log/gcp-journald-container-runtime.pos
 | 
				
			||||||
      read_from_head true
 | 
					      read_from_head true
 | 
				
			||||||
      tag container-runtime
 | 
					      tag container-runtime
 | 
				
			||||||
@@ -287,7 +287,7 @@ data:
 | 
				
			|||||||
      @type grep
 | 
					      @type grep
 | 
				
			||||||
      <exclude>
 | 
					      <exclude>
 | 
				
			||||||
        key _SYSTEMD_UNIT
 | 
					        key _SYSTEMD_UNIT
 | 
				
			||||||
        pattern ^(docker|{{ container_runtime }}|kubelet|node-problem-detector)\.service$
 | 
					        pattern ^(docker|{{ fluentd_container_runtime_service }}|kubelet|node-problem-detector)\.service$
 | 
				
			||||||
      </exclude>
 | 
					      </exclude>
 | 
				
			||||||
    </filter>
 | 
					    </filter>
 | 
				
			||||||
    # END_NODE_JOURNAL
 | 
					    # END_NODE_JOURNAL
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -266,7 +266,7 @@ data:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    <source>
 | 
					    <source>
 | 
				
			||||||
      @type systemd
 | 
					      @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
 | 
					      pos_file /var/log/gcp-journald-container-runtime.pos
 | 
				
			||||||
      read_from_head true
 | 
					      read_from_head true
 | 
				
			||||||
      tag container-runtime
 | 
					      tag container-runtime
 | 
				
			||||||
@@ -302,7 +302,7 @@ data:
 | 
				
			|||||||
      @type grep
 | 
					      @type grep
 | 
				
			||||||
      <exclude>
 | 
					      <exclude>
 | 
				
			||||||
        key _SYSTEMD_UNIT
 | 
					        key _SYSTEMD_UNIT
 | 
				
			||||||
        pattern ^(docker|{{ container_runtime }}|kubelet|node-problem-detector)\.service$
 | 
					        pattern ^(docker|{{ fluentd_container_runtime_service }}|kubelet|node-problem-detector)\.service$
 | 
				
			||||||
      </exclude>
 | 
					      </exclude>
 | 
				
			||||||
    </filter>
 | 
					    </filter>
 | 
				
			||||||
    # END_NODE_JOURNAL
 | 
					    # END_NODE_JOURNAL
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2232,14 +2232,14 @@ function start-fluentd-resource-update {
 | 
				
			|||||||
  wait-for-apiserver-and-update-fluentd &
 | 
					  wait-for-apiserver-and-update-fluentd &
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Update {{ container-runtime }} with actual container runtime name,
 | 
					# Update {{ fluentd_container_runtime_service }} with actual container runtime name,
 | 
				
			||||||
# and {{ container-runtime-endpoint }} with actual container runtime
 | 
					# and {{ container_runtime_endpoint }} with actual container runtime
 | 
				
			||||||
# endpoint.
 | 
					# endpoint.
 | 
				
			||||||
function update-container-runtime {
 | 
					function update-container-runtime {
 | 
				
			||||||
  local -r file="$1"
 | 
					  local -r file="$1"
 | 
				
			||||||
  local -r container_runtime_endpoint="${CONTAINER_RUNTIME_ENDPOINT:-unix:///var/run/dockershim.sock}"
 | 
					  local -r container_runtime_endpoint="${CONTAINER_RUNTIME_ENDPOINT:-unix:///var/run/dockershim.sock}"
 | 
				
			||||||
  sed -i \
 | 
					  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" \
 | 
					    -e "s@{{ *container_runtime_endpoint *}}@${container_runtime_endpoint#unix://}@g" \
 | 
				
			||||||
    "${file}"
 | 
					    "${file}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user