ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Rancher] Installation on Ubuntu 16.04 - 1
    Cloud/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.

    rancher.com/quick-start

     

    <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

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    terry@ubuntu:~$ sudo docker run --privileged ---restart=unless-stopped -80:80 -443:443 rancher/rancher
    Unable to find image 'rancher/rancher:latest' locally
    latest: Pulling from rancher/rancher
    92dc2a97ff99: Pull complete
    be13a9d27eb8: Pull complete
    c8299583700a: Pull complete
    ae230727f130: Pull complete
    e2a418ceec64: Pull complete
    41c75955621d: Pull complete
    a25218d04df4: Pull complete
    64cf9593a3b1: Pull complete
    7f2a7535acb4: Pull complete
    2a47ce145a9a: Pull complete
    c70b3a16811c: Pull complete
    2e96fb0520ed: Pull complete
    1994015c7fb0: Pull complete
    51f27cd739d1: Pull complete
    71a5f7388eaf: Pull complete
    5b5f2e14777f: Pull complete
    01c27c5d80ce: Pull complete
    e345527b0efa: Pull complete
    6100bdb86846: Pull complete
    Digest: sha256:736b2357df459f53a97ec8e31d3d8400575671a72faa232e61f222a1e09969f2
    Status: Downloaded newer image for rancher/rancher:latest
    98715f22e3baf4e9223e80b40bc5946184653ffb7b062e6c5746944d0f21cf48
    terry@ubuntu:~$
     
    cs

     

    2. Check

    Rancher container is running.

    1
    2
    3
    terry@ubuntu:~$ sudo docker ps
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                      NAMES
    98715f22e3ba        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_bartik
    cs

     

    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.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    jslab@ubuntu:~$ sudo docker run ---privileged --restart=unless-stopped --net=host -/etc/kubernetes:/etc/kubernetes -/var/run:/var/run  rancher/rancher-agent:v2.5.6 --server https://192.168.1.106 --token slk79x5p982gc72w5vrbcnstqdxx5p6bph5fnjbwb5j2n59zjqpxbq --ca-checksum d8dac9f33c1f0089e8960bd81aa47592522c73915159d82fe8b9b2425e1cbb47 --etcd --controlplane --worker
    Unable to find image 'rancher/rancher-agent:v2.5.6' locally
    v2.5.6: Pulling from rancher/rancher-agent
    92dc2a97ff99: Pull complete
    be13a9d27eb8: Pull complete
    c8299583700a: Pull complete
    6c4617fff611: Pull complete
    1a1a90b6ccfa: Pull complete
    ab7dedc984d5: Pull complete
    b808c0893715: Pull complete
    a6df9ab129a6: Pull complete
    ae8c5c35a8a8: Pull complete
    e6fc5f6b9112: Pull complete
    Digest: sha256:5b91fcbb8dfee8b70cd7161184ebb980e7626dbab1eb0b15912ebb25c54e0148
    Status: Downloaded newer image for rancher/rancher-agent:v2.5.6
    110e9c07dbc8120356d9b54d050c3dfa688441d282fd0a9efd1675f653281f11
    jslab@ubuntu:~$
    cs

     

    11. Rancher is initiating containers more and more. this stage takes long time for few minutes.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    jslab@ubuntu:~$ sudo su -
    root@ubuntu:~# docker ps
    CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS               NAMES
    110e9c07dbc8        rancher/rancher-agent:v2.5.6   "run.sh --server htt…"   2 minutes ago       Up 2 minutes                            stoic_lovelace
    root@ubuntu:~#
    root@ubuntu:~# docker ps
    CONTAINER ID        IMAGE                                  COMMAND                  CREATED              STATUS              PORTS               NAMES
    5e7b23392d83        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   23 seconds ago       Up 22 seconds                           kube-proxy
    034a6c3159ff        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   35 seconds ago       Up 34 seconds                           kubelet
    add1b5ea48df        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   42 seconds ago       Up 40 seconds                           kube-scheduler
    e1fb65bdbf5f        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   48 seconds ago       Up 47 seconds                           kube-controller-manager
    d887e83a28ba        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   About a minute ago   Up About a minute                       kube-apiserver
    0845b4539b15        rancher/coreos-etcd:v3.4.14-rancher1   "/usr/local/bin/etcd…"   About a minute ago   Up About a minute                       etcd
    110e9c07dbc8        rancher/rancher-agent:v2.5.6           "run.sh --server htt…"   3 minutes ago        Up 3 minutes                            stoic_lovelace
    root@ubuntu:~#
    root@ubuntu:~#
    root@ubuntu:~# docker ps
    CONTAINER ID        IMAGE                                  COMMAND                  CREATED              STATUS                  PORTS               NAMES
    85fa2b472f81        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_7
    99814d8850a0        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_13
    61a1e0da5763        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_0
    b0a34e2ff0ee        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_0
    9a883427b096        4cd72bf2d36b                           "run.sh"                 29 seconds ago       Up 27 seconds                               k8s_agent_cattle-node-agent-gcl5v_cattle-system_5e5596bc-dc33-48b1-8942-879b0546dee4_0
    7d0e2d24b821        rancher/pause:3.2                      "/pause"                 29 seconds ago       Up 28 seconds                               k8s_POD_kube-api-auth-jf66t_cattle-system_41384742-3d9f-4d07-ad5a-2fee6dd03c4e_0
    a2d7cc3091a1        rancher/pause:3.2                      "/pause"                 30 seconds ago       Up 28 seconds                               k8s_POD_cattle-node-agent-gcl5v_cattle-system_5e5596bc-dc33-48b1-8942-879b0546dee4_0
    7eca6c7ac1ab        rancher/pause:3.2                      "/pause"                 46 seconds ago       Up 46 seconds                               k8s_POD_nginx-ingress-controller-n52v5_ingress-nginx_dbbaba32-8f14-4ccf-8658-16ffbdda54d2_0
    bba6b34c9c24        rancher/pause:3.2                      "/pause"                 About a minute ago   Up About a minute                           k8s_POD_canal-tl9r5_kube-system_d56c387c-fe64-43e2-af97-a31826da2a5e_0
    5e7b23392d83        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   About a minute ago   Up About a minute                           kube-proxy
    034a6c3159ff        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   About a minute ago   Up About a minute                           kubelet
    add1b5ea48df        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   About a minute ago   Up About a minute                           kube-scheduler
    e1fb65bdbf5f        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   About a minute ago   Up About a minute                           kube-controller-manager
    d887e83a28ba        rancher/hyperkube:v1.20.4-rancher1     "/opt/rke-tools/entr…"   2 minutes ago        Up 2 minutes                                kube-apiserver
    0845b4539b15        rancher/coreos-etcd:v3.4.14-rancher1   "/usr/local/bin/etcd…"   2 minutes ago        Up 2 minutes                                etcd
    root@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.

     

    댓글

Designed by Tistory.