k8s Calico network setup
The snippet can be accessed without any authentication.
Authored by
Adphi
Edited
#!/usr/bin/env bash
OUT=/tmp/calico.yaml
wget https://docs.projectcalico.org/manifests/calico.yaml -O "${OUT}"
# Delete the env var and value
line=$(grep -n 'CALICO_IPV4POOL_VXLAN' ${OUT}|cut -d':' -f1)
# The first one delete the name
sed -i "${line}d" "${OUT}"
# The second one delete the value
sed -i "${line}d" "${OUT}"
# Set vars to vxlan
sed -i 's|CALICO_IPV4POOL_IPIP|CALICO_IPV4POOL_VXLAN|g' "${OUT}"
sed -i 's|calico_backend: "bird"|calico_backend: "vxlan"|g' "${OUT}"
sed -i 's|- -bird-ready|# - -bird-ready|g' "${OUT}"
sed -i 's|- -bird-live|# - -bird-live|g' "${OUT}"
kubectl apply -f ${OUT}
Please register or sign in to comment