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 23, 2022
1 parent 9669781 commit c25ce44
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ export ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"
# create cluster
create_cluster

# Get CCM cluster CIDRs from cluster config template if not set
if [[ -z "${CCM_CLUSTER_CIDR:-}" ]]; then
CIDR0="$(${KUBECTL} get cluster ${CLUSTER_NAME} -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[0]}')"
CCM_CLUSTER_CIDR="${CIDR0}"
CIDR1="$(${KUBECTL} get cluster ${CLUSTER_NAME} -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[1]}')"
if [[ "$(echo $?)" == "0" ]]; then
CCM_CLUSTER_CIDR="${CCM_CLUSTER_CIDR:-}\,${CIDR1}"
fi
fi
echo "CCM cluster CIDR: ${CCM_CLUSTER_CIDR:-}"

# export the target cluster KUBECONFIG if not already set
export KUBECONFIG="${KUBECONFIG:-${PWD}/kubeconfig}"

Expand Down Expand Up @@ -225,7 +236,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 c25ce44

Please sign in to comment.