-
[Rancher] Installation on Ubuntu 16.04 - 1Cloud/Openstack_K8s_Docker 2021. 3. 10. 17:12
<Purpose>
This blog illustrates how to install Rancher.
you can also refer to the below link for installation. it's the official site.
<Pre-requirement>
1. Oracle VirtualBox installation
2. Two Linux host VM with 64-bit Ubuntu 16.04
3. Minimum : two CPU cores / 4GB RAM
<My Oracle VirtualBox setting>
CPU : Four Cores
RAM : 8GB
NIU : Bridge / NAT
<My Topology>
<Installation Step>
1. Even though host is restarted, Rancher will not stop. Rancher WebGUI 80/443 will use 80/443 port.
This command was executed on VM1
123456789101112131415161718192021222324252627terry@ubuntu:~$ sudo docker run --privileged -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancherUnable to find image 'rancher/rancher:latest' locallylatest: Pulling from rancher/rancher92dc2a97ff99: Pull completebe13a9d27eb8: Pull completec8299583700a: Pull completeae230727f130: Pull completee2a418ceec64: Pull complete41c75955621d: Pull completea25218d04df4: Pull complete64cf9593a3b1: Pull complete7f2a7535acb4: Pull complete2a47ce145a9a: Pull completec70b3a16811c: Pull complete2e96fb0520ed: Pull complete1994015c7fb0: Pull complete51f27cd739d1: Pull complete71a5f7388eaf: Pull complete5b5f2e14777f: Pull complete01c27c5d80ce: Pull completee345527b0efa: Pull complete6100bdb86846: Pull completeDigest: sha256:736b2357df459f53a97ec8e31d3d8400575671a72faa232e61f222a1e09969f2Status: Downloaded newer image for rancher/rancher:latest98715f22e3baf4e9223e80b40bc5946184653ffb7b062e6c5746944d0f21cf48terry@ubuntu:~$cs 2. Check
Rancher container is running.
123terry@ubuntu:~$ sudo docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES98715f22e3ba rancher/rancher "entrypoint.sh" 12 minutes ago Up 11 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp silly_bartikcs 3. Access 192.168.1.106:80 by Web Browser. Set your password.
4. Save URL
5. This is first page of Rancher. For clustering of K8s, Click 'Add Cluster'
6. We are going to create a cluster on VMs of Oracle VirtualBox. Go to 'Existing nodes'.
7. Set a name of Cluster Name.
I pick the latest version currently.
8. Go 'Next'
9. I will give a manager role to VM1. I checked all.
Click the copy button.
10. Go and Access to VM2 by SSH.
Run the copied command. Download does not take long time.
12345678910111213141516171819jslab@ubuntu:~$ sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.5.6 --server https://192.168.1.106 --token slk79x5p982gc72w5vrbcnstqdxx5p6bph5fnjbwb5j2n59zjqpxbq --ca-checksum d8dac9f33c1f0089e8960bd81aa47592522c73915159d82fe8b9b2425e1cbb47 --etcd --controlplane --workerUnable to find image 'rancher/rancher-agent:v2.5.6' locallyv2.5.6: Pulling from rancher/rancher-agent92dc2a97ff99: Pull completebe13a9d27eb8: Pull completec8299583700a: Pull complete6c4617fff611: Pull complete1a1a90b6ccfa: Pull completeab7dedc984d5: Pull completeb808c0893715: Pull completea6df9ab129a6: Pull completeae8c5c35a8a8: Pull completee6fc5f6b9112: Pull completeDigest: sha256:5b91fcbb8dfee8b70cd7161184ebb980e7626dbab1eb0b15912ebb25c54e0148Status: Downloaded newer image for rancher/rancher-agent:v2.5.6110e9c07dbc8120356d9b54d050c3dfa688441d282fd0a9efd1675f653281f11jslab@ubuntu:~$cs 11. Rancher is initiating containers more and more. this stage takes long time for few minutes.
123456789101112131415161718192021222324252627282930313233343536jslab@ubuntu:~$ sudo su -root@ubuntu:~# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES110e9c07dbc8 rancher/rancher-agent:v2.5.6 "run.sh --server htt…" 2 minutes ago Up 2 minutes stoic_lovelaceroot@ubuntu:~#root@ubuntu:~# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES5e7b23392d83 rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" 23 seconds ago Up 22 seconds kube-proxy034a6c3159ff rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" 35 seconds ago Up 34 seconds kubeletadd1b5ea48df rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" 42 seconds ago Up 40 seconds kube-schedulere1fb65bdbf5f rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" 48 seconds ago Up 47 seconds kube-controller-managerd887e83a28ba rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" About a minute ago Up About a minute kube-apiserver0845b4539b15 rancher/coreos-etcd:v3.4.14-rancher1 "/usr/local/bin/etcd…" About a minute ago Up About a minute etcd110e9c07dbc8 rancher/rancher-agent:v2.5.6 "run.sh --server htt…" 3 minutes ago Up 3 minutes stoic_lovelaceroot@ubuntu:~#root@ubuntu:~#root@ubuntu:~# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES85fa2b472f81 rancher/pause:3.2 "/pause" 1 second ago Up Less than a second k8s_POD_fleet-agent-77774d8bfc-nms5r_fleet-system_33b92562-a9f9-4b08-9b16-5173735e627a_799814d8850a0 rancher/pause:3.2 "/pause" 1 second ago Up Less than a second k8s_POD_calico-kube-controllers-6c8ddcb6cd-t726r_kube-system_27334927-9a40-485f-9bdb-1af7cab0bb69_1361a1e0da5763 rancher/kube-api-auth "/bin/sh -c 'kube-ap…" 3 seconds ago Up 2 seconds k8s_kube-api-auth_kube-api-auth-jf66t_cattle-system_41384742-3d9f-4d07-ad5a-2fee6dd03c4e_0b0a34e2ff0ee rancher/nginx-ingress-controller "/usr/bin/dumb-init …" 20 seconds ago Up 19 seconds k8s_nginx-ingress-controller_nginx-ingress-controller-n52v5_ingress-nginx_dbbaba32-8f14-4ccf-8658-16ffbdda54d2_09a883427b096 4cd72bf2d36b "run.sh" 29 seconds ago Up 27 seconds k8s_agent_cattle-node-agent-gcl5v_cattle-system_5e5596bc-dc33-48b1-8942-879b0546dee4_07d0e2d24b821 rancher/pause:3.2 "/pause" 29 seconds ago Up 28 seconds k8s_POD_kube-api-auth-jf66t_cattle-system_41384742-3d9f-4d07-ad5a-2fee6dd03c4e_0a2d7cc3091a1 rancher/pause:3.2 "/pause" 30 seconds ago Up 28 seconds k8s_POD_cattle-node-agent-gcl5v_cattle-system_5e5596bc-dc33-48b1-8942-879b0546dee4_07eca6c7ac1ab rancher/pause:3.2 "/pause" 46 seconds ago Up 46 seconds k8s_POD_nginx-ingress-controller-n52v5_ingress-nginx_dbbaba32-8f14-4ccf-8658-16ffbdda54d2_0bba6b34c9c24 rancher/pause:3.2 "/pause" About a minute ago Up About a minute k8s_POD_canal-tl9r5_kube-system_d56c387c-fe64-43e2-af97-a31826da2a5e_05e7b23392d83 rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" About a minute ago Up About a minute kube-proxy034a6c3159ff rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" About a minute ago Up About a minute kubeletadd1b5ea48df rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" About a minute ago Up About a minute kube-schedulere1fb65bdbf5f rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" About a minute ago Up About a minute kube-controller-managerd887e83a28ba rancher/hyperkube:v1.20.4-rancher1 "/opt/rke-tools/entr…" 2 minutes ago Up 2 minutes kube-apiserver0845b4539b15 rancher/coreos-etcd:v3.4.14-rancher1 "/usr/local/bin/etcd…" 2 minutes ago Up 2 minutes etcdroot@ubuntu:~#cs 12. If it is done, you can see that k8s Cluster is Active
13. if you click the k8s name, you can see k8s cluster's Dashboard.
'Cloud > Openstack_K8s_Docker' 카테고리의 다른 글
[Docker] Docker Networking (0) 2021.02.24 [ONOS] Connecting ONOS to OvS (0) 2021.02.24 [ONOS] Installation on Ubuntu16 (0) 2021.02.24 [Docker] Connecting two containers via OVS (0) 2021.02.24 [Docker] installation on Ubuntu 16.04.7 LTS (0) 2021.02.24