Skip to content

Commit

Permalink
Re-enable kubeadm portion of presub (#361)
Browse files Browse the repository at this point in the history
* Reenable multinode test in presub

* pin cri-dockerd to known good tag
  • Loading branch information
alexmasi authored Apr 19, 2023
1 parent 101c672 commit ba4c420
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cloudbuild/external.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild/internal.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
21 changes: 10 additions & 11 deletions cloudbuild/kne_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions docs/multinode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 \
Expand All @@ -135,7 +135,6 @@ ssh -i /tmp/multinode-key user@<EXTERNAL IP OF VM>
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
Expand All @@ -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 \
Expand All @@ -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} \
Expand Down

0 comments on commit ba4c420

Please sign in to comment.