Skip to content

Instantly share code, notes, and snippets.

@bschimke95
Last active November 17, 2023 14:36
Show Gist options
  • Save bschimke95/69bf88e3e1fc9b8cb396f4646876eaf8 to your computer and use it in GitHub Desktop.
Save bschimke95/69bf88e3e1fc9b8cb396f4646876eaf8 to your computer and use it in GitHub Desktop.
Cilium with ingress Controller
# 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 \
--set ingressController.enabled=true \
--set ingressController.loadbalancerMode=dedicated
@bschimke95
Copy link
Author

bschimke95 commented Nov 17, 2023

Install cilium cli with

sudo snap install go --classic
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
curl -L --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-${GOOS}-${GOARCH}.tar.gz{,.sha256sum}
sha256sum --check cilium-${GOOS}-${GOARCH}.tar.gz.sha256sum
sudo tar -C /usr/local/bin -xzvf cilium-${GOOS}-${GOARCH}.tar.gz
rm cilium-${GOOS}-${GOARCH}.tar.gz{,.sha256sum}

then verify that ingress is set with

cilium config view | grep ingressController

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment