CentaurusInfra / mizar

Mizar – Experimental, High Scale and High Performance Cloud Network https://mizar.readthedocs.io
https://mizar.readthedocs.io
GNU General Public License v2.0
111 stars 50 forks source link

Refactor bootstrap, kernelupdate, and C code to work for Ubuntu 18.04 as well as Ubuntu 20.04 #604

Closed vinaykul closed 2 years ago

vinaykul commented 2 years ago

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind design /kind feature /kind bug /kind cleanup /kind documentation

What this PR does / why we need it: This fixes known issues in bootstrap, kernelupdate, and Mizar code and enables it to work for Ubuntu 18.04 as well as Ubuntu 20.04 for creating dev cluster with kind.

Which issue(s) this PR fixes:

Fixes #507

Special notes for your reviewer: Tested by deploying fresh ubuntu 18.04 and 20.04 VMs in AWS and running ./bootstrap ; make all ; kind-setup.sh dev 2 and testing pings.

ubuntu@ip-192-168-1-85:~/vmizar$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
ubuntu@ip-192-168-1-85:~/vmizar$ uname -a
Linux ip-192-168-1-85 5.11.0-1022-aws #23~20.04.1-Ubuntu SMP Mon Nov 15 14:03:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ip-192-168-1-85:~/vmizar$ 
ubuntu@ip-192-168-1-85:~/vmizar$ kubectl get no -owide
NAME                 STATUS   ROLES    AGE     VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE           KERNEL-VERSION    CONTAINER-RUNTIME
kind-control-plane   Ready    master   10m     v1.18.2   172.18.0.3    <none>        Ubuntu 20.04 LTS   5.11.0-1022-aws   containerd://1.3.3-14-g449e9269
kind-worker          Ready    <none>   9m56s   v1.18.2   172.18.0.2    <none>        Ubuntu 20.04 LTS   5.11.0-1022-aws   containerd://1.3.3-14-g449e9269
kind-worker2         Ready    <none>   9m56s   v1.18.2   172.18.0.4    <none>        Ubuntu 20.04 LTS   5.11.0-1022-aws   containerd://1.3.3-14-g449e9269
ubuntu@ip-192-168-1-85:~/vmizar$ kubectl get po --all-namespaces -owide
NAMESPACE            NAME                                         READY   STATUS    RESTARTS   AGE     IP           NODE                 NOMINATED NODE   READINESS GATES
default              mizar-daemon-c5vxx                           1/1     Running   0          8m26s   172.18.0.4   kind-worker2         <none>           <none>
default              mizar-daemon-l6d28                           1/1     Running   0          8m26s   172.18.0.2   kind-worker          <none>           <none>
default              mizar-daemon-xxx9c                           1/1     Running   0          8m26s   172.18.0.3   kind-control-plane   <none>           <none>
default              mizar-operator-7775fcc5f4-hm26b              1/1     Running   0          7m54s   172.18.0.3   kind-control-plane   <none>           <none>
kube-system          coredns-66bff467f8-5jddn                     1/1     Running   0          10m     20.0.0.2     kind-control-plane   <none>           <none>
kube-system          coredns-66bff467f8-tz6fc                     1/1     Running   0          10m     20.0.0.3     kind-control-plane   <none>           <none>
kube-system          etcd-kind-control-plane                      1/1     Running   0          10m     172.18.0.3   kind-control-plane   <none>           <none>
kube-system          kube-apiserver-kind-control-plane            1/1     Running   0          10m     172.18.0.3   kind-control-plane   <none>           <none>
kube-system          kube-controller-manager-kind-control-plane   1/1     Running   0          10m     172.18.0.3   kind-control-plane   <none>           <none>
kube-system          kube-proxy-4nfwt                             1/1     Running   0          10m     172.18.0.4   kind-worker2         <none>           <none>
kube-system          kube-proxy-6w4cp                             1/1     Running   0          10m     172.18.0.3   kind-control-plane   <none>           <none>
kube-system          kube-proxy-l9whz                             1/1     Running   0          10m     172.18.0.2   kind-worker          <none>           <none>
kube-system          kube-scheduler-kind-control-plane            1/1     Running   0          10m     172.18.0.3   kind-control-plane   <none>           <none>
local-path-storage   local-path-provisioner-bd4bb6b75-2684n       1/1     Running   0          10m     20.0.0.4     kind-control-plane   <none>           <none>
ubuntu@ip-192-168-1-85:~/vmizar$ kubectl get vpcs
NAME   IP         PREFIX   VNI   DIVIDERS   STATUS        CREATETIME                   PROVISIONDELAY
vpc0   20.0.0.0   8        1     1          Provisioned   2022-02-01T16:58:25.605412   22.003923
ubuntu@ip-192-168-1-85:~/vmizar$ kubectl get subnets
NAME   IP         PREFIX   VNI   VPC    STATUS        BOUNCERS   CREATETIME                   PROVISIONDELAY
net0   20.0.0.0   8        1     vpc0   Provisioned   1          2022-02-01T16:58:25.683057   42.258779
ubuntu@ip-192-168-1-85:~/vmizar$ kubectl get dividers
NAME                                          VPC    IP           MAC                 DROPLET              STATUS        CREATETIME                   PROVISIONDELAY
vpc0-d-8ea9e02c-26ab-4550-83b6-c60c9c38ae6f   vpc0   172.18.0.3   02:42:ac:12:00:03   kind-control-plane   Provisioned   2022-02-01T16:58:47.592746   0.386164
ubuntu@ip-192-168-1-85:~/vmizar$ kubectl get bouncers
NAME                                          VPC    NET    IP           MAC                 DROPLET       STATUS        CREATETIME                   PROVISIONDELAY
net0-b-ce30f3f0-206b-4b1f-a234-aa80974a915e   vpc0   net0   172.18.0.2   02:42:ac:12:00:02   kind-worker   Provisioned   2022-02-01T16:59:07.923458   1.865405
ubuntu@ip-192-168-1-85:~/vmizar$ kubectl get droplets
NAME                 MAC                 IP           STATUS        INTERFACE   CREATETIME                   PROVISIONDELAY   MAINIP
kind-control-plane   02:42:ac:12:00:03   172.18.0.3   Provisioned   eth0        2022-02-01T16:58:27.060014   0.578656         
kind-worker          02:42:ac:12:00:02   172.18.0.2   Provisioned   eth0        2022-02-01T16:58:27.017288   0.589353         
kind-worker2         02:42:ac:12:00:04   172.18.0.4   Provisioned   eth0        2022-02-01T16:58:27.107147   0.564198         
ubuntu@ip-192-168-1-85:~/vmizar$ 

Does this PR introduce a user-facing change?: No.

vinaykul commented 2 years ago

I just finished testing on GCE ubuntu 18.04 and 20.04 as well to ensure it's not AWS specific.