mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Update GCP fluentd configmap for GKE node journal logging
This commit is contained in:
parent
ba535d57f6
commit
d5c2cdcbbb
@ -282,6 +282,25 @@ data:
|
|||||||
read_from_head true
|
read_from_head true
|
||||||
tag node-problem-detector
|
tag node-problem-detector
|
||||||
</source>
|
</source>
|
||||||
|
|
||||||
|
# BEGIN_NODE_JOURNAL
|
||||||
|
# Whether to include node-journal or not is determined when starting the
|
||||||
|
# cluster. It is not changed when the cluster is already running.
|
||||||
|
<source>
|
||||||
|
@type systemd
|
||||||
|
pos_file /var/log/gcp-journald.pos
|
||||||
|
read_from_head true
|
||||||
|
tag node-journal
|
||||||
|
</source>
|
||||||
|
|
||||||
|
<filter node-journal>
|
||||||
|
@type grep
|
||||||
|
<exclude>
|
||||||
|
key _SYSTEMD_UNIT
|
||||||
|
pattern ^(docker|{{ container_runtime }}|kubelet|node-problem-detector)\.service$
|
||||||
|
</exclude>
|
||||||
|
</filter>
|
||||||
|
# END_NODE_JOURNAL
|
||||||
monitoring.conf: |-
|
monitoring.conf: |-
|
||||||
# This source is used to acquire approximate process start timestamp,
|
# This source is used to acquire approximate process start timestamp,
|
||||||
# which purpose is explained before the corresponding output plugin.
|
# which purpose is explained before the corresponding output plugin.
|
||||||
|
@ -376,6 +376,9 @@ HEAPSTER_GCP_CPU_PER_NODE="${HEAPSTER_GCP_CPU_PER_NODE:-0.5}"
|
|||||||
# Adding to PROVIDER_VARS, since this is GCP-specific.
|
# Adding to PROVIDER_VARS, since this is GCP-specific.
|
||||||
PROVIDER_VARS="${PROVIDER_VARS:-} FLUENTD_GCP_VERSION FLUENTD_GCP_MEMORY_LIMIT FLUENTD_GCP_CPU_REQUEST FLUENTD_GCP_MEMORY_REQUEST HEAPSTER_GCP_BASE_MEMORY HEAPSTER_GCP_MEMORY_PER_NODE HEAPSTER_GCP_BASE_CPU HEAPSTER_GCP_CPU_PER_NODE CUSTOM_KUBE_DASHBOARD_BANNER"
|
PROVIDER_VARS="${PROVIDER_VARS:-} FLUENTD_GCP_VERSION FLUENTD_GCP_MEMORY_LIMIT FLUENTD_GCP_CPU_REQUEST FLUENTD_GCP_MEMORY_REQUEST HEAPSTER_GCP_BASE_MEMORY HEAPSTER_GCP_MEMORY_PER_NODE HEAPSTER_GCP_BASE_CPU HEAPSTER_GCP_CPU_PER_NODE CUSTOM_KUBE_DASHBOARD_BANNER"
|
||||||
|
|
||||||
|
# Fluentd configuration for node-journal
|
||||||
|
ENABLE_NODE_JOURNAL="${ENABLE_NODE_JOURNAL:-false}"
|
||||||
|
|
||||||
# prometheus-to-sd configuration
|
# prometheus-to-sd configuration
|
||||||
PROMETHEUS_TO_SD_ENDPOINT="${PROMETHEUS_TO_SD_ENDPOINT:-https://monitoring.googleapis.com/}"
|
PROMETHEUS_TO_SD_ENDPOINT="${PROMETHEUS_TO_SD_ENDPOINT:-https://monitoring.googleapis.com/}"
|
||||||
PROMETHEUS_TO_SD_PREFIX="${PROMETHEUS_TO_SD_PREFIX:-custom.googleapis.com}"
|
PROMETHEUS_TO_SD_PREFIX="${PROMETHEUS_TO_SD_PREFIX:-custom.googleapis.com}"
|
||||||
|
@ -407,6 +407,9 @@ HEAPSTER_GCP_CPU_PER_NODE="${HEAPSTER_GCP_CPU_PER_NODE:-0.5}"
|
|||||||
# Adding to PROVIDER_VARS, since this is GCP-specific.
|
# Adding to PROVIDER_VARS, since this is GCP-specific.
|
||||||
PROVIDER_VARS="${PROVIDER_VARS:-} FLUENTD_GCP_VERSION FLUENTD_GCP_MEMORY_LIMIT FLUENTD_GCP_CPU_REQUEST FLUENTD_GCP_MEMORY_REQUEST HEAPSTER_GCP_BASE_MEMORY HEAPSTER_GCP_MEMORY_PER_NODE HEAPSTER_GCP_BASE_CPU HEAPSTER_GCP_CPU_PER_NODE CUSTOM_KUBE_DASHBOARD_BANNER"
|
PROVIDER_VARS="${PROVIDER_VARS:-} FLUENTD_GCP_VERSION FLUENTD_GCP_MEMORY_LIMIT FLUENTD_GCP_CPU_REQUEST FLUENTD_GCP_MEMORY_REQUEST HEAPSTER_GCP_BASE_MEMORY HEAPSTER_GCP_MEMORY_PER_NODE HEAPSTER_GCP_BASE_CPU HEAPSTER_GCP_CPU_PER_NODE CUSTOM_KUBE_DASHBOARD_BANNER"
|
||||||
|
|
||||||
|
# Fluentd configuration for node-journal
|
||||||
|
ENABLE_NODE_JOURNAL="${ENABLE_NODE_JOURNAL:-false}"
|
||||||
|
|
||||||
# prometheus-to-sd configuration
|
# prometheus-to-sd configuration
|
||||||
PROMETHEUS_TO_SD_ENDPOINT="${PROMETHEUS_TO_SD_ENDPOINT:-https://monitoring.googleapis.com/}"
|
PROMETHEUS_TO_SD_ENDPOINT="${PROMETHEUS_TO_SD_ENDPOINT:-https://monitoring.googleapis.com/}"
|
||||||
PROMETHEUS_TO_SD_PREFIX="${PROMETHEUS_TO_SD_PREFIX:-custom.googleapis.com}"
|
PROMETHEUS_TO_SD_PREFIX="${PROMETHEUS_TO_SD_PREFIX:-custom.googleapis.com}"
|
||||||
|
@ -2008,6 +2008,15 @@ function update-container-runtime {
|
|||||||
sed -i -e "s@{{ *container_runtime *}}@${CONTAINER_RUNTIME_NAME:-docker}@g" "${configmap_yaml}"
|
sed -i -e "s@{{ *container_runtime *}}@${CONTAINER_RUNTIME_NAME:-docker}@g" "${configmap_yaml}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Remove configuration in yaml file if node journal is not enabled.
|
||||||
|
function update-node-journal {
|
||||||
|
local -r configmap_yaml="$1"
|
||||||
|
if [[ "${ENABLE_NODE_JOURNAL:-}" != "true" ]]; then
|
||||||
|
# Removes all lines between two patterns (throws away node-journal)
|
||||||
|
sed -i -e "/# BEGIN_NODE_JOURNAL/,/# END_NODE_JOURNAL/d" "${configmap_yaml}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Updates parameters in yaml file for prometheus-to-sd configuration, or
|
# Updates parameters in yaml file for prometheus-to-sd configuration, or
|
||||||
# removes component if it is disabled.
|
# removes component if it is disabled.
|
||||||
function update-prometheus-to-sd-parameters {
|
function update-prometheus-to-sd-parameters {
|
||||||
@ -2187,6 +2196,7 @@ EOF
|
|||||||
update-prometheus-to-sd-parameters ${fluentd_gcp_yaml}
|
update-prometheus-to-sd-parameters ${fluentd_gcp_yaml}
|
||||||
start-fluentd-resource-update ${fluentd_gcp_yaml}
|
start-fluentd-resource-update ${fluentd_gcp_yaml}
|
||||||
update-container-runtime ${fluentd_gcp_configmap_yaml}
|
update-container-runtime ${fluentd_gcp_configmap_yaml}
|
||||||
|
update-node-journal ${fluentd_gcp_configmap_yaml}
|
||||||
fi
|
fi
|
||||||
if [[ "${ENABLE_CLUSTER_UI:-}" == "true" ]]; then
|
if [[ "${ENABLE_CLUSTER_UI:-}" == "true" ]]; then
|
||||||
setup-addon-manifests "addons" "dashboard"
|
setup-addon-manifests "addons" "dashboard"
|
||||||
|
@ -732,6 +732,7 @@ ADVANCED_AUDIT_WEBHOOK_THROTTLE_BURST: $(yaml-quote ${ADVANCED_AUDIT_WEBHOOK_THR
|
|||||||
ADVANCED_AUDIT_WEBHOOK_INITIAL_BACKOFF: $(yaml-quote ${ADVANCED_AUDIT_WEBHOOK_INITIAL_BACKOFF:-})
|
ADVANCED_AUDIT_WEBHOOK_INITIAL_BACKOFF: $(yaml-quote ${ADVANCED_AUDIT_WEBHOOK_INITIAL_BACKOFF:-})
|
||||||
GCE_API_ENDPOINT: $(yaml-quote ${GCE_API_ENDPOINT:-})
|
GCE_API_ENDPOINT: $(yaml-quote ${GCE_API_ENDPOINT:-})
|
||||||
GCE_GLBC_IMAGE: $(yaml-quote ${GCE_GLBC_IMAGE:-})
|
GCE_GLBC_IMAGE: $(yaml-quote ${GCE_GLBC_IMAGE:-})
|
||||||
|
ENABLE_NODE_JOURNAL: $(yaml-quote ${ENABLE_NODE_JOURNAL:-false})
|
||||||
PROMETHEUS_TO_SD_ENDPOINT: $(yaml-quote ${PROMETHEUS_TO_SD_ENDPOINT:-})
|
PROMETHEUS_TO_SD_ENDPOINT: $(yaml-quote ${PROMETHEUS_TO_SD_ENDPOINT:-})
|
||||||
PROMETHEUS_TO_SD_PREFIX: $(yaml-quote ${PROMETHEUS_TO_SD_PREFIX:-})
|
PROMETHEUS_TO_SD_PREFIX: $(yaml-quote ${PROMETHEUS_TO_SD_PREFIX:-})
|
||||||
ENABLE_PROMETHEUS_TO_SD: $(yaml-quote ${ENABLE_PROMETHEUS_TO_SD:-false})
|
ENABLE_PROMETHEUS_TO_SD: $(yaml-quote ${ENABLE_PROMETHEUS_TO_SD:-false})
|
||||||
|
Loading…
Reference in New Issue
Block a user