wget https://gist.github.com/ypelud/f16115b678606a9ea41cfdb869a1e39e/raw/master-cloud-init.yaml
multipass launch -n master --cloud-init master-cloud-init.yaml -c 2 -m 4G
You can take a smaller vm but be careful with kubeadm
multipass launch -n master --cloud-init master-cloud-init.yaml
multipass shell master
I have chosen 10.1.0.0/16 cidr because multipass use 192.168.xx.xx, so...
sudo kubeadm init --pod-network-cidr=10.1.0.0/16
If you have chosen smaller vm you must ignore some pre-flight checks
sudo kubeadm init --pod-network-cidr=10.1.0.0/16 --ignore-preflight-errors=NumCPU --ignore-preflight-errors=Mem
Configure kubeconfig
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
-
Install operator
kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
-
Install component
kubectl create -f- <<EOF apiVersion: operator.tigera.io/v1 kind: Installation metadata: name: default spec: # Configures Calico networking. calicoNetwork: # Note: The ipPools section cannot be modified post-install. ipPools: - blockSize: 26 cidr: 10.1.0.0/16 encapsulation: VXLANCrossSubnet natOutgoing: Enabled nodeSelector: all() --- apiVersion: operator.tigera.io/v1 kind: APIServer metadata: name: default spec: {} EOF
-
Wait until each pod has the STATUS of Running
watch kubectl get pods -n calico-system
-
Allow control plane to schedule pod
kubectl taint nodes --all node-role.kubernetes.io/master-
-
Wait until master node has the STATUS of Ready
kubectl get nodes -o wide