├── CNAME ├── README.md └── docs ├── README.md ├── rackn-wip ├── rackn-admin-icon.png └── README.md ├── jupyter ├── jupyterlab-pvc.yaml ├── jupyterlab-service.yaml ├── jupyterlab-deployment.yaml └── README.md ├── virtualbox └── README.md ├── fedora └── README.md └── k8s └── README.md /CNAME: -------------------------------------------------------------------------------- 1 | rackn.2cld.net 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rackn.2cld.net 2 | rackn learning 3 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Documents 2 | 3 | - [Rackn WIP](./rackn-wip/README.md) 4 | -------------------------------------------------------------------------------- /docs/rackn-wip/rackn-admin-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2Cld/rackn.2cld.net/main/docs/rackn-wip/rackn-admin-icon.png -------------------------------------------------------------------------------- /docs/jupyter/jupyterlab-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: jupyterlab-pvc 5 | namespace: jlab 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | resources: 10 | requests: 11 | storage: 10Gi 12 | storageClassName: standard-gp2-retain 13 | -------------------------------------------------------------------------------- /docs/jupyter/jupyterlab-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: jupyterlab 5 | namespace: jlab 6 | labels: 7 | name: jupyterlab 8 | spec: 9 | type: LoadBalancer 10 | ports: 11 | - port: 80 12 | targetPort: 8888 13 | protocol: TCP 14 | name: http 15 | selector: 16 | name: jupyterlab 17 | -------------------------------------------------------------------------------- /docs/jupyter/jupyterlab-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: jupyterlab 5 | namespace: jlab 6 | labels: 7 | name: jupyterlab 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: jupyterlab 13 | template: 14 | metadata: 15 | labels: 16 | name: jupyterlab 17 | spec: 18 | securityContext: 19 | runAsUser: 0 20 | fsGroup: 0 21 | containers: 22 | - name: jupyterlab 23 | image: jupyter/datascience-notebook:latest 24 | imagePullPolicy: IfNotPresent 25 | ports: 26 | - containerPort: 8888 27 | command: 28 | - /bin/bash 29 | - -c 30 | - | 31 | start.sh jupyter lab --LabApp.token='password' --LabApp.ip='0.0.0.0' --LabApp.allow_root=True 32 | volumeMounts: 33 | - name: jupyterlab-data 34 | mountPath: /home/jovyan 35 | resources: 36 | requests: 37 | memory: 500Mi 38 | cpu: 250m 39 | restartPolicy: Always 40 | volumes: 41 | - name: jupyterlab-data 42 | persistentVolumeClaim: 43 | claimName: jupyterlab-pvc 44 | -------------------------------------------------------------------------------- /docs/virtualbox/README.md: -------------------------------------------------------------------------------- 1 | # VirtualBox 2 | 3 | - [https://www.virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads) 4 | 5 | 6 | - [https://superuser.com/questions/109485/virtualbox-to-use-dual-monitors](https://superuser.com/questions/109485/virtualbox-to-use-dual-monitors) 7 | 8 | VirtualBox 3.2.1 supports multiple guest monitors. The documentation was not clear on how to enable this. 9 | 10 | Basic Setup 11 | 1. Power off your virtual machine if it's on. 12 | 2. From the main VirtualBox window, select your VM and choose “Settings”. 13 | 3. Choose “Display”. 14 | 4. Below “Video Memory” is “Monitor Count”. Slide it to 2, and adjust your video memory if VirtualBox complains. 15 | 5. Start your guest and perform the standard method for your guest OS to Extend the desktop onto a second monitor. (Guest Additions need to be installed.) 16 | 17 | A second “Oracle VM VirtualBox” window will appear with the second display. You can resize it however you want. 18 | The VirtualBox “View” menu will have an entry for each “Virtual Screen”. All but the first can also be enabled/disabled from here. This seems to only work after step 5. 19 | 20 | Seamless/Fullscreen 21 | - Enter Seamless or Fullscreen. I'll assume your HostKey is the default “RightCtrl”. 22 | - If the screens are on the wrong displays, hit RightCtrl+Home. 23 | - From the View Menu, choose “Virtual Display 1” and set it to the Host display you want. The other displays will shuffle around to accommodate this. If you have more than two virtual displays, repeat with “Virtual Display 2” and so on. 24 | 25 | Headless 26 | - Set the number of monitors with VBoxManage modifyvm "vm name" --monitorcount X 27 | - Enable multiple vrdp connections with VBoxManage modifyvm "VM name" --vrdpmulticon on 28 | - Use VBoxHeadless to launch as normal. 29 | - Connect to monitor 1 with rdesktop -d \@1 ip-address-of-host and connect to monitor 2 with rdesktop -d \@2 ip-address-of-host. This is explained in lomaxx's answer. (You might be able to use @ instead of \@, depending on your shell.) 30 | -------------------------------------------------------------------------------- /docs/fedora/README.md: -------------------------------------------------------------------------------- 1 | # Fedora 2 | 3 | [https://getfedora.org/en/workstation/download/](https://getfedora.org/en/workstation/download/) 4 | 5 | [5 Things You MUST DO After Installing Fedora 35](https://www.youtube.com/watch?v=-NwWE9YFFIg) 6 | 7 | - [00:00](https://www.youtube.com/watch?v=-NwWE9YFFIg&t=0s) Fedora Introduction 8 | - [01:05](https://www.youtube.com/watch?v=-NwWE9YFFIg&t=65s) 1. Optimize DNF Config 9 | 10 | ``` 11 | sudo nano /etc/dnf/dnf.conf 12 | fastestmirror=True 13 | max_parallel_downloads=10 14 | defaultyes=True 15 | ``` 16 | 17 | - [03:20](https://www.youtube.com/watch?v=-NwWE9YFFIg&t=200s) 2. System Update 18 | 19 | ``` 20 | sudo dnf update 21 | ``` 22 | 23 | - [04:00](https://www.youtube.com/watch?v=-NwWE9YFFIg&t=240s) 3. Enable RPM [Fedora Docs RPM Update Link](https://docs.fedoraproject.org/en-US/quick-docs/setup_rpmfusion/) 24 | 25 | ``` 26 | sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm 27 | sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm 28 | ``` 29 | 30 | - [06:16](https://www.youtube.com/watch?v=-NwWE9YFFIg&t=376s) 4. Installing Media Codecs [Media plugins Link](https://docs.fedoraproject.org/en-US/quick-docs/assembly_installing-plugins-for-playing-movies-and-music/) 31 | 32 | ``` 33 | sudo dnf install gstreamer1-plugins-{bad-\*,good-\*,base} gstreamer1-plugin-openh264 gstreamer1-libav --exclude=gstreamer1-plugins-bad-free-devel 34 | sudo dnf install lame\* --exclude=lame-devel 35 | sudo dnf group upgrade --with-optional Multimedia 36 | ``` 37 | 38 | - [08:00](https://www.youtube.com/watch?v=-NwWE9YFFIg&t=480s) 5. Install Extensions, Software, etc. 39 | - [Install Chromium Link](https://docs.fedoraproject.org/en-US/quick-docs/installing-chromium-or-google-chrome-browsers/) 40 | 41 | ``` 42 | sudo dnf install chromium 43 | sudo dnf update chromium 44 | ``` 45 | 46 | - Fedora35radminsnapshot1 47 | 48 | - Install VirtualBox Guest Additions select Devices in VBox dropdown menu 49 | ## Fedora35 Snapshots 50 | - Fedora35radminsnapshot1 - Location: catmini:/Users/cat/VirtualBox VMs/Fedora35/Snapshots 51 | -------------------------------------------------------------------------------- /docs/jupyter/README.md: -------------------------------------------------------------------------------- 1 | # Jupyter 2 | 3 | - [https://www.anaconda.com/](https://www.anaconda.com/) 4 | - [https://www.anaconda.com/products/individual](https://www.anaconda.com/products/individual) 5 | - Start jupyter lab on commandline 6 | ``` 7 | cd code/jupyternotebooks/ 8 | jupyter lab 9 | ``` 10 | 11 | - Local web notebook [http://localhost:8888/lab](http://localhost:8888/lab) 12 | --- 13 | - [https://jupyter.org/](https://jupyter.org/) 14 | - [jupyterlab - ReadTheDocs](https://jupyterlab.readthedocs.io/en/latest/) 15 | - [JupyterLab Install](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html) 16 | - [youtube Demo - CM 9.1 - Jupyter Notebook: In-depth Overview](https://www.youtube.com/watch?v=JWiRLx9M2R4) 17 | --- 18 | - [https://mybinder.org/](https://mybinder.org/) 19 | - [tbd]() 20 | - [tbd]() 21 | - [FULL-FEATURED BRIGHT CLUSTER MANAGEMENT SOFTWARE FOR CLUSTERS OF UP TO 8 NODES](https://www.brightcomputing.com/easy8) 22 | - [tbd]() 23 | 24 | ## Setup [Jupyter on k8s](https://medium.com/analytics-vidhya/deploying-standalone-jupyterlab-on-kubernetes-for-early-stage-startups-7a1468fae289) 25 | 1. Create jlab namespace 26 | ``` 27 | kubectl create namespace jlab 28 | ``` 29 | 30 | - Jupyterlab install 31 | ``` 32 | kubectl apply -f jupyterlab-pvc.yaml 33 | kubectl apply -f jupyterlab-deployment.yaml 34 | kubectl apply -f jupyterlab-service.yaml 35 | 36 | # change permission of home folder in pvc 37 | # since newly created pvc don't give permission 38 | # to jupyter user (jovian) to create notebook files 39 | chmod 777 /home/jovyan 40 | 41 | # you must perform above step with `sleep infinity` in command 42 | # or can have init-container that does that for you 43 | ``` 44 | 45 | - [github raw - jupyterlab-pvc.yaml](https://raw.githubusercontent.com/2cld/rackn.2cld.net/main/docs/jupyter/jupyterlab-pvc.yaml) 46 | - [github raw - jupyterlab-deployment.yaml](https://raw.githubusercontent.com/2cld/rackn.2cld.net/main/docs/jupyter/jupyterlab-deployment.yaml) 47 | - [github raw - jupyterlab-service.yaml](https://raw.githubusercontent.com/2cld/rackn.2cld.net/main/docs/jupyter/jupyterlab-service.yaml) 48 | 49 | - Download from github using [wget and/or curl](https://gist.github.com/jwebcat/5122366) 50 | ``` 51 | wget --no-check-certificate --content-disposition https://raw.githubusercontent.com/2cld/rackn.2cld.net/main/docs/jupyter/jupyterlab-deployment.yaml 52 | # --no-check-cerftificate was necessary for me to have wget not puke about https 53 | curl -LJO https://raw.githubusercontent.com/2cld/rackn.2cld.net/main/docs/jupyter/jupyterlab-deployment.yaml 54 | 55 | ``` 56 | 57 | 2. Get external-ip of your deployed service 58 | ``` 59 | kubectl get svc -n jlab 60 | ``` 61 | 62 | 3. Navigate to the external-ip in your browser to access JupyterLab 63 | 64 | -------------------------------------------------------------------------------- /docs/rackn-wip/README.md: -------------------------------------------------------------------------------- 1 | # Rackn Work In Progress 2 | 3 | Background: 4 | - Watched Rob's Infrastucture Pipelines [tc 1:08:09](https://youtu.be/itDtelczVT4?t=4089) 5 | - Looked the current [RackN Gitlab Epics](https://gitlab.com/groups/rackn/-/epics) 6 | - [Enhance Documentation](https://gitlab.com/groups/rackn/-/epics/58) 7 | - [Official ProxMox Support](https://gitlab.com/groups/rackn/-/epics/51) 8 | - [Deploy Google Anthos](https://gitlab.com/groups/rackn/-/epics/48) 9 | - [Hardware certification / validation tests](https://gitlab.com/groups/rackn/-/epics/42) 10 | - [Clould API for empty cluster](https://gitlab.com/groups/rackn/-/epics/47) 11 | - [Disk Prep Enhancements](https://gitlab.com/groups/rackn/-/epics/40) 12 | - [Switch Integration](https://gitlab.com/groups/rackn/-/epics/33) 13 | - [Monitoring Features](https://gitlab.com/groups/rackn/-/epics/32) 14 | - [Embed Billing Plugin](https://gitlab.com/groups/rackn/-/epics/25) 15 | - [Integration Test System](https://gitlab.com/groups/rackn/-/epics/23) 16 | - [Cisco USC Support](https://gitlab.com/groups/rackn/-/epics/20) 17 | - [Add HPE ILO Reset support for hardware manipulation](https://gitlab.com/groups/rackn/-/epics/18) 18 | - [IPAM for DRP](https://gitlab.com/groups/rackn/-/epics/13) 19 | - [Handle UEFI Bootorder challenges](https://gitlab.com/groups/rackn/-/epics/6) 20 | - [OOBM Discovery](https://gitlab.com/groups/rackn/-/epics/15) 21 | - Other ADDO sessions that caught my attention 22 | - [Using Kubernetes to Manage Cloud tc:32:27](https://youtu.be/z9Grmf64bJ0?t=1947) 23 | - [From Oops to Ops: Incident Response with Jupyter Notebooks](https://youtu.be/dNNAEZEHD_c?t=10957) 24 | - [Jupyter as Incident Response Tool](https://youtu.be/fQ0N43kPz9E?t=5084) 25 | 26 | 27 | ## Proposals 28 | 1. Review and update "DRP Getting Started" to [Enhance Documentation](https://gitlab.com/groups/rackn/-/epics/58) with Jupyter notebooks and video tutorials. 29 | 2. Building a bare metal ProxMox based cloud to test [Official ProxMox Support](https://gitlab.com/groups/rackn/-/epics/51) and [Enhance Documentation](https://gitlab.com/groups/rackn/-/epics/58). 30 | 3. During cloud build use [Hardware certification / validation tests](https://gitlab.com/groups/rackn/-/epics/42), [Clould API for empty cluster](https://gitlab.com/groups/rackn/-/epics/47), [Disk Prep Enhancements](https://gitlab.com/groups/rackn/-/epics/40), [Add HPE ILO Reset support for hardware manipulation](https://gitlab.com/groups/rackn/-/epics/18) and possibly [IPAM for DRP](https://gitlab.com/groups/rackn/-/epics/13). 31 | 32 | ### ADDO index 33 | - [ADDO Track 1 Block 1: 3:00AM-8:00AM](https://youtu.be/bZT67jy-AWc) 34 | - [ADDO Channel 1: Block 4 (2:30PM-6:30Pm ET)](https://youtu.be/dNNAEZEHD_c) 35 | - [ADDO Channel 2: Block 1 (3:00AM-8:00AM ET)](https://www.youtube.com/watch?v=3a8HryO7O5w) 36 | - [ADDO Channel 2: Block 5 (6:30PM-10:30PM ET)](https://youtu.be/I5ZrHMzDEJc) 37 | - [ADDO Channel 2: Block 6 (10:30PM-3:00AM ET)](https://youtu.be/upELDDk2pLM) 38 | - [ADDO Channel 3: Block 1 (3:00AM-8:00AM ET)](https://youtu.be/vmXtOW6jo6I) 39 | - [ADDO Channel 3: Block 6 (10:30PM-3:00AM)](https://youtu.be/tt2BE7Xqk9k) 40 | - [ADDO Channel 4: Block 1 (3:00AM-8:00AM ET)](https://youtu.be/I7qTBKqUAPM) 41 | - [ADDO Track 5 Block 1](https://youtu.be/Sy1H_0psB0M) 42 | - [ADDO Channel 5: Block 6 (10:30PM-3:00AM ET)](https://youtu.be/A7nDEm0xFak) 43 | -------------------------------------------------------------------------------- /docs/k8s/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes notes 2 | 3 | ## Manual cluster on VBox 4 | - [Configure Multi-node Kubernetes Cluster on VirtualBox](https://www.youtube.com/watch?v=EHDDm_iR1Fs) 5 | 6 | ### Network 7 | - kubemaster 192.168.2.110 mac 08:00:27:66:8f:9c via https://192.168.2.1 8 | - kubework1 192.168.2.111 mac 08:00:27:e8:10:4c via https://192.168.2.1 9 | 10 | | name | if | ip | mac | user | nettype | 11 | |------|----|----|-----|------|------| 12 | | kubemaster | enp0s3 | 192.168.2.110 | 08:00:27:66:8f:9c | radmin | bridged | 13 | | | enp0s8 | 10.0.2.4 | 08:00:27:da:aa:6a | radmin | k8sNat | 14 | |------|----|----|-----|------|------| 15 | | kubework1 | enp0s3 | 192.168.2.111 | 08:00:27:e8:10:4c | radmin | bridged | 16 | | | enp0s8 | 10.0.2.5 | 08:00:27:ef:b8:8f | radmin | k8sNat | 17 | |------|----|----|-----|------|------| 18 | | kubework2 | enp0s3 | 192.168.2.112 | 08:00:27:05:96:e0 | radmin | bridged | 19 | | | enp0s8 | 10.0.2.5 | 08:00:27:a9:58:98 | radmin | k8sNat | 20 | 21 | ### Config 22 | 1. Create kubemaster and kubework1 VBox using [ubuntu-20.04.3-live-server-amd64.iso](https://ubuntu.com/download/server) 23 | 24 | 2. Configure network (see above) 25 | - Set DHCP server IP based on MAC via above table 26 | ``` 27 | radmin@kubemaster:~$ sudo hostnamectl set-hostname kubemaster 28 | ``` 29 | 30 | 3. Docker (All hosts) 31 | ``` 32 | radmin@kubemaster:~$ sudo apt-get update 33 | radmin@kubemaster:~$ sudo apt-get install docker.io -y 34 | radmin@kubemaster:~$ sudo apt-get install apt-transport-https curl -y 35 | ``` 36 | - Saved kubework1-radmin-snapshot1 on catmini://Users/cat/VirtualBox VMs/kubeWork1 37 | 38 | 4. Kubernetes (All hosts) 39 | ``` 40 | radmin@kubemaster:~$ cat < deb https://apt.kubernetes.io/ kubernetes-xenial main 42 | > EOF 43 | deb https://apt.kubernetes.io/ kubernetes-xenial main 44 | radmin@kubemaster:~$ sudo apt-get update 45 | ``` 46 | - I had to get kubernetes package key got error otherwise 47 | ``` 48 | curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - 49 | ``` 50 | 51 | 5. Kubernetes packages (All hosts) 52 | ``` 53 | radmin@kubemaster:~$ sudo apt-get install -y kubelet=1.18.1-00 54 | radmin@kubemaster:~$ sudo apt-get install -y kubeadm=1.18.1-00 55 | radmin@kubemaster:~$ sudo apt-get install -y kubectl=1.18.1-00 56 | radmin@kubemaster:~$ sudo apt-mark hold kubelet kubeadm kubectl 57 | ``` 58 | 59 | 6. Add the hosts entry (All hosts) edit the file "/etc/hosts" add "kubemaster 192.168.2.110" 60 | 61 | 7. Disable SWAP (All hosts) 62 | ``` 63 | free -m # show current swap 64 | sudo swapoff -a 65 | edit /etc/fstab to remove the swap entry comment out # /swap.img 66 | ``` 67 | 68 | 8. Initiate the Cluster(Only on Master node) 69 | ``` 70 | sudo kubeadm init --control-plane-endpoint kube-master:6443 --pod-network-cidr 10.10.0.0/16 71 | ``` 72 | - If kubeadm messes up [kubeadm reset -f](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-reset/) 73 | - Saved kubemaster-radmin-snapshot1 on catmini://Users/cat/VirtualBox VMs/kubeMaster 74 | 75 | 9. Set the kubectl context auth to connect to the cluster(Only on Master node) 76 | ``` 77 | radmin@kubemaster:~$ mkdir -p $HOME/.kube 78 | radmin@kubemaster:~$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config 79 | radmin@kubemaster:~$ sudo chown $(id -u):$(id -g) $HOME/.kube/config 80 | radmin@kubemaster:~$ kubectl cluster-info 81 | Kubernetes master is running at https://kubemaster:6443 82 | KubeDNS is running at https://kubemaster:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy 83 | 84 | To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. 85 | ``` 86 | - kubectl cluster-info 87 | 88 | 10. Pod Network Addon(Calico) (Only on Master node) [Calico Install Document](https://docs.projectcalico.org/getting-started/kubernetes/self-managed-onprem/onpremises#install-calico-with-kubernetes-api-datastore-50-nodes-or-less) 89 | ``` 90 | radmin@kubemaster:~$ curl https://docs.projectcalico.org/manifests/calico.yaml -O 91 | radmin@kubemaster:~$ vi calico.yaml 92 | ``` 93 | - Search for CALICO_IPV4POOL_CIDR and add k8s IP subnet 94 | ``` 95 | - name: CALICO_IPV4POOL_CIDR 96 | value: "10.0.0.0/16" 97 | ``` 98 | - Apply config 99 | ``` 100 | radmin@kubemaster:~$ kubectl apply -f calico.yaml 101 | ``` 102 | - Check Status of pods 103 | ``` 104 | radmin@kubemaster:~$ kubectl get pods -A 105 | NAMESPACE NAME READY STATUS RESTARTS AGE 106 | kube-system calico-kube-controllers-6c68d67746-c5xc2 1/1 Running 0 70s 107 | kube-system calico-node-7j9mx 1/1 Running 0 70s 108 | kube-system coredns-66bff467f8-z4264 1/1 Running 0 73m 109 | kube-system coredns-66bff467f8-z9n4j 1/1 Running 0 73m 110 | kube-system etcd-kubemaster 1/1 Running 1 73m 111 | kube-system kube-apiserver-kubemaster 1/1 Running 1 73m 112 | kube-system kube-controller-manager-kubemaster 1/1 Running 1 73m 113 | kube-system kube-proxy-bkpt6 1/1 Running 1 73m 114 | kube-system kube-scheduler-kubemaster 1/1 Running 1 73m 115 | radmin@kubemaster:~$ 116 | ``` 117 | - Check nodes 118 | ``` 119 | radmin@kubemaster:~$ kubectl get nodes 120 | NAME STATUS ROLES AGE VERSION 121 | kubemaster Ready master 76m v1.18.1 122 | radmin@kubemaster:~$ 123 | ``` 124 | 125 | 11. Generate Token to add worker Node(Only on Master node) 126 | 127 | ``` 128 | sudo kubeadm token create --description "kubework1 token" 129 | sudo kubeadm token list 130 | ``` 131 | - Get ssh hash 132 | ``` 133 | radmin@kubemaster:~$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | 134 | > openssl rsa -pubin -outform der 2>/dev/null | 135 | > openssl dgst -sha256 -hex | sed 's/^.* //' 136 | ``` 137 | - Single line 138 | ``` 139 | radmin@kubemaster:~$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //' 140 | ``` 141 | 142 | 12. Join Nodes (Only on Worker nodes) kubemaster:6443 143 | ``` 144 | sudo kubeadm join --token TOKEN_ID CONTROL_PLANE_HOSTNAME:CONTROL_PLANE_PORT --discovery-token-ca-cert-hash sha256:HASH 145 | ``` 146 | - Saved kubework1-radmin-snapshot2 on catmini://Users/cat/VirtualBox VMs/kubeWork1 147 | - Cloned kubework1 to kubework2 with new MAC addr 148 | - Started kubework1 149 | - Started kubework2 150 | - Update kubework2 151 | ``` 152 | radmin@kubework1:~$ sudo hostnamectl set-hostname kubework2 153 | radmin@kubework1:~$ sudo dhclient -r 154 | radmin@kubework1:~$ sudo dhclient 155 | radmin@kubework1:~$ sudo kubeadm reset -f 156 | ``` 157 | - Create new token on kubemaster 158 | ``` 159 | sudo kubeadm token create --description "kubework2 token" 160 | sudo kubeadm token list 161 | ``` 162 | - Run Join Node (above) on kubework2 163 | ``` 164 | sudo kubeadm join --token cwekvr.nwul72bin71b1wk7 kubemaster:6443 --discovery-token-ca-cert-hash sha256:a68afe46f0e77e2f533eaa8988546639fa9ba03a401ea7a8e5643706b6e743e6 165 | ``` 166 | - Verify nodes running on kubemaster 167 | ``` 168 | radmin@kubemaster:~$ kubectl get nodes 169 | NAME STATUS ROLES AGE VERSION 170 | kubemaster Ready master 5h22m v1.18.1 171 | kubework1 Ready 118m v1.18.1 172 | kubework2 Ready 28s v1.18.1 173 | radmin@kubemaster:~$ 174 | ``` 175 | - Saved kubework2-radmin-snapshot1 on catmini://Users/cat/VirtualBox VMs/kubeWork2 176 | 177 | 13. Want to run workloads on Master? (Only on Master Node) I rather not do this 178 | ``` 179 | kubectl taint nodes --all node-role.kubernetes.io/master- 180 | ``` 181 | 182 | 14. Sample Deployment file: 183 | ``` 184 | apiVersion: apps/v1 185 | kind: Deployment 186 | metadata: 187 | name: nginx-deployment 188 | labels: 189 | app: nginx 190 | spec: 191 | replicas: 1 192 | selector: 193 | matchLabels: 194 | app: nginx 195 | template: 196 | metadata: 197 | labels: 198 | app: nginx 199 | spec: 200 | containers: 201 | - name: nginx 202 | image: nginx 203 | ports: 204 | - containerPort: 80 205 | ``` 206 | 207 | 15. Apply the deployment: 208 | ``` 209 | kubectl apply -f FILE_NAME 210 | ``` 211 | --------------------------------------------------------------------------------