Add a possibility of setting GODEBUG env var for kube-apiserver binary

This commit is contained in:
Antoni Zawodny 2022-08-18 11:11:35 +02:00
parent 58c10aa6eb
commit a8fb0cab49
2 changed files with 12 additions and 0 deletions

View File

@ -343,6 +343,12 @@ function start-kube-apiserver {
fi
container_env+="{\"name\": \"KUBE_PATCH_CONVERSION_DETECTOR\", \"value\": \"${ENABLE_PATCH_CONVERSION_DETECTOR}\"}"
fi
if [[ -n "${KUBE_APISERVER_GODEBUG:-}" ]]; then
if [[ -n "${container_env}" ]]; then
container_env="${container_env}, "
fi
container_env+="{\"name\": \"GODEBUG\", \"value\": \"${KUBE_APISERVER_GODEBUG}\"}"
fi
if [[ -n "${container_env}" ]]; then
container_env="\"env\":[${container_env}],"
fi

View File

@ -1320,6 +1320,12 @@ EOF
if [ -n "${KUBE_APISERVER_REQUEST_TIMEOUT_SEC:-}" ]; then
cat >>"$file" <<EOF
KUBE_APISERVER_REQUEST_TIMEOUT_SEC: $(yaml-quote "${KUBE_APISERVER_REQUEST_TIMEOUT_SEC}")
EOF
fi
# KUBE_APISERVER_GODEBUG (if set) controls the value of GODEBUG env var for kube-apiserver.
if [ -n "${KUBE_APISERVER_GODEBUG:-}" ]; then
cat >>"$file" <<EOF
KUBE_APISERVER_GODEBUG: $(yaml-quote "${KUBE_APISERVER_GODEBUG}")
EOF
fi
# ETCD_IMAGE (if set) allows to use a custom etcd image.