Last active
November 17, 2023 13:30
-
-
Save neoaggelos/029b7f9b6e9eecd29d3db72b671130e5 to your computer and use it in GitHub Desktop.
k8s cilium v0
This file contains 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
# Configure cluster CIDR | |
IPv4_CLUSTER_CIDR="10.1.0.0/16" | |
IPv6_CLUSTER_CIDR="" | |
# Require cgroup2 to be mounted | |
cgroup_hostroot="$(mount -t cgroup2 | head -1 | cut -d' ' -f3)" | |
if [ -z "$cgroup_hostroot" ]; then | |
echo "cgroup2 mount not found, fail" | |
exit 1 | |
fi | |
# Require bpf to be mounted | |
bpf_root="$(mount -t bpf | head -1 | cut -d' ' -f3)" | |
if [ -z "$bpf_root" ]; then | |
echo "/sys/fs/bpf not found, fail" | |
exit 1 | |
else | |
sudo mount -t bpf bpf /sys/fs/bpf | |
bpf_root=/sys/fs/bpf | |
fi | |
mkdir -p ~/.kube | |
sudo k8s config > ~/.kube/config | |
/snap/k8s/current/bin/helm install cilium -n kube-system cilium \ | |
--repo https://helm.cilium.io --version v1.14.3 \ | |
--set cni.confPath=/etc/cni/net.d \ | |
--set cni.binPath=/opt/cni/bin \ | |
--set daemon.runPath=/var/run/cilium \ | |
--set operator.replicas=1 \ | |
--set ipam.operator.clusterPoolIPv4PodCIDRList="${IPv4_CLUSTER_CIDR}" \ | |
--set ipam.operator.clusterPoolIPv6PodCIDRList="${IPv6_CLUSTER_CIDR}" \ | |
--set nodePort.enabled=true \ | |
--set bpf.autoMount.enabled=false \ | |
--set bpf.root="${bpf_root}" \ | |
--set cgroup.autoMount.enabled=false \ | |
--set cgroup.hostRoot="${cgroup_hostroot}" \ | |
--set l2announcements.enabled=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minor note: Run
sudo k8s config > ~/.kube/config
before executing.