local-up-cluster: fix kube-proxy featureGates configuration

Commit 43cb024402 replaced command line parameters with a .yaml
configuration file. But feature gates must be configured with a map in
.yaml, not with a comma-separated string as in the command line
parameters. As a result, kube-proxy failed to start and networking was
broken in the cluster.

Commit c339fc0c4f tried to fix that by moving feature gates back to
the command line, but later it was found out that the command line
parameter gets ignored when also specifying a config.

Therefore now the feature gates variable gets converted into a proper
map in the config.
pull/8/head
Patrick Ohly 2018-03-01 10:01:50 +01:00
parent 9cf35f355b
commit 731c92896b
1 changed files with 9 additions and 1 deletions

View File

@ -837,10 +837,18 @@ clientConnection:
hostnameOverride: ${HOSTNAME_OVERRIDE}
mode: ${KUBE_PROXY_MODE}
EOF
if [[ -n ${FEATURE_GATES} ]]; then
echo "featureGates:"
# Convert from foo=true,bar=false to
# foo: true
# bar: false
for gate in $(echo ${FEATURE_GATES} | tr ',' ' '); do
echo $gate | sed -e 's/\(.*\)=\(.*\)/ \1: \2/'
done
fi >>/tmp/kube-proxy.yaml
sudo "${GO_OUT}/hyperkube" proxy \
--v=${LOG_LEVEL} \
--feature-gates="${FEATURE_GATES}" \
--config=/tmp/kube-proxy.yaml \
--master="https://${API_HOST}:${API_SECURE_PORT}" >"${PROXY_LOG}" 2>&1 &
PROXY_PID=$!