diff --git a/cloudbuild/external.pkr.hcl b/cloudbuild/external.pkr.hcl index cd61c69d..5df030dc 100644 --- a/cloudbuild/external.pkr.hcl +++ b/cloudbuild/external.pkr.hcl @@ -102,7 +102,7 @@ build { "echo Installing multinode cluster dependencies...", "git clone https://github.com/flannel-io/flannel.git", "curl --create-dirs -o third_party/licenses/flannel/LICENSE https://raw.githubusercontent.com/flannel-io/flannel/master/LICENSE", - "git clone https://github.com/Mirantis/cri-dockerd.git", + "git clone https://github.com/Mirantis/cri-dockerd.git --branch v0.3.1", "cd cri-dockerd", "PATH=$PATH:/usr/local/go/bin", "/home/$USER/go/bin/go-licenses check github.com/Mirantis/cri-dockerd", diff --git a/cloudbuild/internal.pkr.hcl b/cloudbuild/internal.pkr.hcl index 1d1af1f2..cbc4760c 100644 --- a/cloudbuild/internal.pkr.hcl +++ b/cloudbuild/internal.pkr.hcl @@ -101,7 +101,7 @@ build { inline = [ "echo Installing multinode cluster dependencies...", "git clone https://github.com/flannel-io/flannel.git", - "git clone https://github.com/Mirantis/cri-dockerd.git", + "git clone https://github.com/Mirantis/cri-dockerd.git --branch v0.3.1", "cd cri-dockerd", "/usr/local/go/bin/go build", "sudo cp cri-dockerd /usr/local/bin/", diff --git a/cloudbuild/kne_test.sh b/cloudbuild/kne_test.sh index 066ee465..1f21deea 100644 --- a/cloudbuild/kne_test.sh +++ b/cloudbuild/kne_test.sh @@ -84,17 +84,16 @@ fi kind delete cluster --name kne ## Create a kubeadm single node cluster -#sudo kubeadm init --cri-socket unix:///var/run/cri-dockerd.sock --pod-network-cidr 10.244.0.0/16 -#mkdir -p "$HOME"/.kube -#sudo cp /etc/kubernetes/admin.conf "$HOME"/.kube/config -#sudo chown "$(id -u)":"$(id -g)" "$HOME"/.kube/config -#kubectl taint nodes --all node-role.kubernetes.io/control-plane- # allows pods to be scheduled on control plane node -#kubectl apply -f "$HOME"/flannel/Documentation/kube-flannel.yml -#docker network create multinode -# -## Deploy an external cluster -#$cli deploy kne/deploy/kne/external-multinode.yaml -$cli deploy kne/deploy/kne/kind-bridge.yaml +sudo kubeadm init --cri-socket unix:///var/run/cri-dockerd.sock --pod-network-cidr 10.244.0.0/16 +mkdir -p "$HOME"/.kube +sudo cp /etc/kubernetes/admin.conf "$HOME"/.kube/config +sudo chown "$(id -u)":"$(id -g)" "$HOME"/.kube/config +kubectl taint nodes --all node-role.kubernetes.io/control-plane- # allows pods to be scheduled on control plane node +kubectl apply -f "$HOME"/flannel/Documentation/kube-flannel.yml +docker network create multinode + +# Deploy an external cluster +$cli deploy kne/deploy/kne/external-multinode.yaml kubectl get pods -A diff --git a/docs/multinode.md b/docs/multinode.md index 6ab50afc..7e56ac3f 100644 --- a/docs/multinode.md +++ b/docs/multinode.md @@ -96,9 +96,9 @@ required. Import the KNE VM image: ```shell -gcloud compute images import kne-f109f429-0573-4b9c-a75a-b6603f6830ae \ +gcloud compute images import kne-cb8d6252-14aa-4f68-bbd9-a97d9443d795 \ --os=ubuntu-2004 \ - --source-file=gs://kne-vm-image/f109f429-0573-4b9c-a75a-b6603f6830ae.tar.gz + --source-file=gs://kne-vm-image/cb8d6252-14aa-4f68-bbd9-a97d9443d795.tar.gz ``` Create an SSH key pair to use for all of the VMs created below: @@ -116,7 +116,7 @@ assigned the internal IP address `10.240.0.11` in the custom VPC. ```shell gcloud compute instances create controller \ --zone=us-central1-a \ - --image=kne-f109f429-0573-4b9c-a75a-b6603f6830ae \ + --image=kne-cb8d6252-14aa-4f68-bbd9-a97d9443d795 \ --machine-type=n2-standard-8 \ --enable-nested-virtualization \ --scopes=https://www.googleapis.com/auth/cloud-platform \ @@ -135,7 +135,6 @@ ssh -i /tmp/multinode-key user@ Now run the following commands to setup the cluster: ```shell -sudo apt install kubelet=1.25.0-00 kubectl=1.25.0-00 kubeadm=1.25.0-00 --allow-downgrades -y sudo kubeadm init --cri-socket unix:///var/run/cri-dockerd.sock --pod-network-cidr 10.244.0.0/16 mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config @@ -156,7 +155,7 @@ replacing `{n}` with `1` and `2`. ```shell gcloud compute instances create worker-{n} \ --zone=us-central1-a \ - --image=kne-f109f429-0573-4b9c-a75a-b6603f6830ae \ + --image=kne-cb8d6252-14aa-4f68-bbd9-a97d9443d795 \ --machine-type=n2-standard-64 \ --enable-nested-virtualization \ --scopes=https://www.googleapis.com/auth/cloud-platform \ @@ -176,7 +175,6 @@ And run the following command, using the token and SHA output from cluster setup on the controller VM: ```shell -sudo apt install kubelet=1.25.0-00 kubectl=1.25.0-00 kubeadm=1.25.0-00 --allow-downgrades -y sudo kubeadm join 10.240.0.11:6443 \ --token {token} \ --discovery-token-ca-cert-hash sha256:{sha} \