Skip to content

Commit d1f2133

Browse files
authored
Merge pull request kubernetes#87359 from chendotjs/hack-patch
hack/local-up-cluster.sh: unify --cluster-cidr in KCM and CCM
2 parents 073da15 + 2afe0da commit d1f2133

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hack/local-up-cluster.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ NET_PLUGIN=${NET_PLUGIN:-""}
4040
# eg: "/etc/cni/net.d" for config files, and "/opt/cni/bin" for binaries.
4141
CNI_CONF_DIR=${CNI_CONF_DIR:-""}
4242
CNI_BIN_DIR=${CNI_BIN_DIR:-""}
43+
CLUSTER_CIDR=${CLUSTER_CIDR:-10.1.0.0/16}
4344
SERVICE_CLUSTER_IP_RANGE=${SERVICE_CLUSTER_IP_RANGE:-10.0.0.0/24}
4445
FIRST_SERVICE_CLUSTER_IP=${FIRST_SERVICE_CLUSTER_IP:-10.0.0.1}
4546
# if enabled, must set CGROUP_ROOT
@@ -614,7 +615,7 @@ EOF
614615
function start_controller_manager {
615616
node_cidr_args=()
616617
if [[ "${NET_PLUGIN}" == "kubenet" ]]; then
617-
node_cidr_args=("--allocate-node-cidrs=true" "--cluster-cidr=10.1.0.0/16")
618+
node_cidr_args=("--allocate-node-cidrs=true" "--cluster-cidr=${CLUSTER_CIDR}")
618619
fi
619620

620621
cloud_config_arg=("--cloud-provider=${CLOUD_PROVIDER}" "--cloud-config=${CLOUD_CONFIG}")
@@ -658,7 +659,7 @@ function start_cloud_controller_manager {
658659

659660
node_cidr_args=()
660661
if [[ "${NET_PLUGIN}" == "kubenet" ]]; then
661-
node_cidr_args=("--allocate-node-cidrs=true" "--cluster-cidr=10.1.0.0/16")
662+
node_cidr_args=("--allocate-node-cidrs=true" "--cluster-cidr=${CLUSTER_CIDR}")
662663
fi
663664

664665
CLOUD_CTLRMGR_LOG=${LOG_DIR}/cloud-controller-manager.log

0 commit comments

Comments
 (0)