Skip to content

Commit

Permalink
[cloud-provider-azure] Support specifying CCM cluster CIDR
Browse files Browse the repository at this point in the history
Signed-off-by: Zhecheng Li <[email protected]>
  • Loading branch information
lzhecheng committed Nov 22, 2022
1 parent 9669781 commit b4f1a62
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ if [[ -n "${TEST_CCM:-}" ]]; then
fi

export CCM_LOG_VERBOSITY="${CCM_LOG_VERBOSITY:-4}"
# Get CCM cluster CIDRs from cluster config template if not set
if [[ -z "${CCM_CLUSTER_CIDR:-}" ]]; then
curl -LO https://github.com/mikefarah/yq/releases/download/v4.30.3/yq_linux_amd64 && chmod +x yq_linux_amd64
while read -r CCM_CIDR; do
if [[ "${CCM_CLUSTER_CIDR:-}" == "" ]]; then
CCM_CLUSTER_CIDR="${CCM_CIDR}"
else
CCM_CLUSTER_CIDR="${CCM_CLUSTER_CIDR:-}\,${CCM_CIDR}"
fi
done <<< "$(./yq_linux_amd64 '.spec.clusterNetwork.pods.cidrBlocks' "${CLUSTER_TEMPLATE}" --no-doc|grep -v null | awk '{print $2}')"
fi
echo "CCM cluster CIDR: ${CCM_CLUSTER_CIDR:-}"
echo "Installing cloud-provider-azure components via helm"
"${HELM}" install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name \
--set infra.clusterName="${CLUSTER_NAME}" \
Expand All @@ -225,7 +237,8 @@ if [[ -n "${TEST_CCM:-}" ]]; then
--set cloudControllerManager.enableDynamicReloading="${ENABLE_DYNAMIC_RELOADING}" \
--set cloudControllerManager.cloudConfig="${CLOUD_CONFIG}" \
--set cloudControllerManager.cloudConfigSecretName="${CONFIG_SECRET_NAME}" \
--set cloudControllerManager.logVerbosity="${CCM_LOG_VERBOSITY}"
--set cloudControllerManager.logVerbosity="${CCM_LOG_VERBOSITY}" \
--set-string cloudControllerManager.clusterCIDR="${CCM_CLUSTER_CIDR}"

echo "Waiting for all kube-system pods to be ready"
"${KUBECTL}" wait --for=condition=Ready pod -n kube-system --all --timeout=10m
Expand Down

0 comments on commit b4f1a62

Please sign in to comment.