github.com/looshlee/cilium@v1.6.12/examples/demo/demo5.sh (about) 1 #!/usr/bin/env bash 2 3 . $(dirname ${BASH_SOURCE})/../../contrib/shell/util.sh 4 5 NETWORK="cilium" 6 7 function cleanup { 8 tmux kill-session -t my-session >/dev/null 2>&1 9 sudo killall -9 etcd 2> /dev/null || true 10 sudo killall -9 kubelet 2> /dev/null || true 11 sudo killall -9 hyperkube 2> /dev/null || true 12 sudo killall -9 kube-scheduler 2> /dev/null || true 13 sudo killall -9 kube-controller-manager 2> /dev/null || true 14 sudo killall -9 kube-proxy 2> /dev/null || true 15 sudo killall -9 kube-apiserver 2> /dev/null || true 16 docker rm -f `docker ps -aq --filter=name=k8s` 2> /dev/null || true 17 cilium policy delete --all 18 } 19 20 trap cleanup EXIT 21 22 docker network rm $NETWORK > /dev/null 2>&1 23 docker network create --ipv6 --subnet ::1/112 --driver cilium --ipam-driver cilium $NETWORK > /dev/null 24 cilium policy delete --all 25 #Clean old kubernetes certificates 26 sudo rm -fr /run/kubernetes 27 28 desc "Demo: Start kubernetes, import k8s network policy, test connections" 29 run "" 30 31 tmux new -d -s my-session \ 32 "$(dirname ${BASH_SOURCE})/demo5_top.sh" \; \ 33 split-window -v -d "$(dirname $BASH_SOURCE)/demo5_bottom.sh" \; \ 34 attach \; 35 36 desc "Clean up"