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

# Get CCM cluster CIDRs from Cluster object 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}"
if CIDR1=$(${KUBECTL} get cluster "${CLUSTER_NAME}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[1]}'); 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 +235,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 1918079

Please sign in to comment.