Skip to content

Commit

Permalink
Enable per-zone logexporter pods creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tosi3k committed Sep 25, 2020
1 parent d19aec8 commit e453a1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cluster/log-dump/log-dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,17 @@ function dump_nodes_with_logexporter() {
local -r cloud_provider="${KUBERNETES_PROVIDER}"
local -r enable_hollow_node_logs="${ENABLE_HOLLOW_NODE_LOGS:-false}"
local -r logexport_sleep_seconds="$(( 90 + NUM_NODES / 3 ))"
if [[ -z "${ZONE_NODE_SELECTOR_DISABLED:-}" ]]; then
local -r node_selector="${ZONE_NODE_SELECTOR_LABEL:-topology.kubernetes.io/zone}: ${ZONE}"
fi

# Fill in the parameters in the logexporter daemonset template.
local -r tmp="${KUBE_TEMP}/logexporter"
local -r manifest_yaml="${tmp}/logexporter-daemonset.yaml"
mkdir -p "${tmp}"
cp "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml" "${manifest_yaml}"

sed -i'' -e "s@{{.NodeSelector}}@${node_selector:-}@g" "${manifest_yaml}"
sed -i'' -e "s@{{.LogexporterNamespace}}@${logexporter_namespace}@g" "${manifest_yaml}"
sed -i'' -e "s@{{.ServiceAccountCredentials}}@${service_account_credentials}@g" "${manifest_yaml}"
sed -i'' -e "s@{{.CloudProvider}}@${cloud_provider}@g" "${manifest_yaml}"
Expand Down
2 changes: 2 additions & 0 deletions cluster/log-dump/logexporter-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ spec:
requests:
cpu: 10m
memory: 10Mi
nodeSelector:
{{.NodeSelector}}
volumes:
- name: service
secret:
Expand Down

0 comments on commit e453a1f

Please sign in to comment.