Last active
January 4, 2022 22:27
-
-
Save jmarhee/bb99adef85db20c3c0237038f4e72286 to your computer and use it in GitHub Desktop.
[Installing Canal](https://projectcalico.docs.tigera.io/getting-started/kubernetes/flannel/flannel) requires updating a `CALICO_IPV4POOL_CIDR` environment variable in the installation manifest for use with K3s, which has a default Pod CIDR of "10.44.0.0/24"-- this will modify the manifest to reflect the current Pod CIDR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Applies the modified manifest to K3s, which automatically applies the contents of /var/lib/rancher/k3s/server/manifests | |
curl -s https://docs.projectcalico.org/manifests/canal.yaml | sed -e 's| # - name: CALICO_IPV4POOL_CIDR| - name: CALICO_IPV4POOL_CIDR|g' -e "s| # value: \"192.168.0.0/16\"| value: \"$(kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}')\"|g" | \ | |
tee -a /var/lib/rancher/k3s/server/manifests/canal.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s https://docs.projectcalico.org/manifests/canal.yaml | \ | |
sed \ | |
-e 's| # - name: CALICO_IPV4POOL_CIDR| - name: CALICO_IPV4POOL_CIDR|g' \ | |
-e "s| # value: \"192.168.0.0/16\"| value: \"$(kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}')\"|g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment