diff --git a/tools/deployment/install-k8s.sh b/tools/deployment/install-k8s.sh index 1b7461f..7d27610 100755 --- a/tools/deployment/install-k8s.sh +++ b/tools/deployment/install-k8s.sh @@ -1,10 +1,13 @@ #!/bin/bash + set -ex : ${KUBE_VERSION:="v1.19.2"} : ${MINIKUBE_VERSION:="v1.16.0"} : ${UPSTREAM_DNS_SERVER:="8.8.4.4"} : ${DNS_DOMAIN:="cluster.local"} +: ${CALICO_VERSION:="v3.17"} +: ${CNI_MANIFEST_PATH:="/tmp/calico.yaml"} export DEBCONF_NONINTERACTIVE_SEEN=true export DEBIAN_FRONTEND=noninteractive @@ -34,6 +37,11 @@ sudo -E apt-get install -y \ sudo mkdir -p /data sudo mount -t tmpfs -o size=512m tmpfs /data +# Download calico manifest +if [ ! -f "$CNI_MANIFEST_PATH" ]; then + curl -Ss https://docs.projectcalico.org/"${CALICO_VERSION}"/manifests/calico.yaml -o ${CNI_MANIFEST_PATH} +fi + # Install minikube and kubectl URL="https://storage.googleapis.com" sudo -E curl -sSLo /usr/local/bin/minikube "${URL}"/minikube/releases/"${MINIKUBE_VERSION}"/minikube-linux-amd64 @@ -51,11 +59,17 @@ sudo -E minikube start \ --driver=none \ --wait=apiserver,system_pods,node_ready \ --wait-timeout=6m0s \ + --network-plugin=cni \ + --cni=${CNI_MANIFEST_PATH} \ --extra-config=kube-proxy.mode=ipvs \ --extra-config=controller-manager.allocate-node-cidrs=true \ --extra-config=controller-manager.cluster-cidr=192.168.0.0/16 \ + --extra-config=kubeadm.pod-network-cidr=192.168.0.0/16 \ --extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf +kubectl get nodes -o wide +kubectl get pod -A + cat <