When a non-default pod-network-cidr is used for `kubeadm init`, the
same CIDR should be used by Calico in CALICO_IPV4POOL_CIDR.
Otherwise we will run into issues like those described in [1].
[1] https://github.com/projectcalico/calico/issues/683
Change-Id: Ifc5cd2847f12e85b23716d4b279fd635988132ef
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
set -e
CLUSTER_IP=${1:-172.16.1.136} # Align with the value in our K8s setup script
+POD_NETWORK_CIDR=${2:-192.168.0.0/16}
# Install the Etcd Database
if [ "$(uname -m)" == 'aarch64' ]; then
kubectl apply -f "${SCRIPTS_DIR}/cni/calico/rbac.yaml"
# Install Calico to system
-sed -i "s/10.96.232.136/${CLUSTER_IP}/" "${SCRIPTS_DIR}/cni/calico/calico.yaml"
+sed -i "s@10.96.232.136@${CLUSTER_IP}@; s@192.168.0.0/16@${POD_NETWORK_CIDR}@" \
+ "${SCRIPTS_DIR}/cni/calico/calico.yaml"
kubectl apply -f "${SCRIPTS_DIR}/cni/calico/calico.yaml"
# Remove the taints on master node