I deployed my first cluster and... it didn't quite work, because etcd couldn't bind to its port. Drat.
Likely this is because I deployed Rancher to k8s-1, then attempted to deploy a cluster to k8s-1/2/3. So, let's try again, but with a new machine called k8s-deployer (10.1.1.100).
wings@k8s-deployer:~$ curl https://releases.rancher.com/install-docker/20.10.sh | sh
Add our current user to the docker group
wings@k8s-deployer:~$ sudo usermod -aG docker $USER
Log out, log in, then...
wings@k8s-deployer:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Now, deploy Rancher again:
wings@k8s-deployer:~$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher [sudo] password for wings: Unable to find image 'rancher/rancher:latest' locally latest: Pulling from rancher/rancher af637d9f9908: Downloading 12.96MB/45.71MB f9224574abce: Downloading 15.06MB/31.13MB ebae3352c76e: Download complete 7b21d0842057: Downloading 486.6kB/47.78MB 88a4b8d1c9ea: Waiting 068e40008a4a: Waiting af8d478ed359: Waiting 0570bed5c15a: Waiting f7dfd304c929: Waiting e0f5d341d113: Waiting bd89a58c597d: Waiting c03c718eef46: Waiting 5e1f456cdbf8: Waiting e55dca76e75f: Waiting c9a821480bc3: Waiting c6e3491b680d: Waiting 9d7c10a11f0f: Waiting
After a short while:
wings@k8s-deployer:~$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher [sudo] password for wings: Unable to find image 'rancher/rancher:latest' locally latest: Pulling from rancher/rancher af637d9f9908: Pull complete f9224574abce: Pull complete ebae3352c76e: Pull complete 7b21d0842057: Pull complete 88a4b8d1c9ea: Pull complete 068e40008a4a: Pull complete af8d478ed359: Pull complete 0570bed5c15a: Pull complete f7dfd304c929: Pull complete e0f5d341d113: Pull complete bd89a58c597d: Pull complete c03c718eef46: Pull complete 5e1f456cdbf8: Pull complete e55dca76e75f: Pull complete c9a821480bc3: Pull complete c6e3491b680d: Pull complete 9d7c10a11f0f: Pull complete Digest: sha256:51658639bf2b28f4796e7daa04b0434e29fcf69ce062bf649462be77ae76cd2c Status: Downloaded newer image for rancher/rancher:latest 41fe967e7f4adea91d202882027bced882f1ec3ebdadd901e2ed3165257329f6
Perform the same incantations as in the previous posts to get an admin password set (hint: store it somewhere safe!)
Go to Cluster Management, and we'll create our first cluster.
Name the cluster "sandbox", then scroll to the bottom and set the endpoint to k8s.windowpa.in.
Clean up the hosts and delete the previous failed deployment (plus delete Rancher from k8s-1, not shown here).
wings@k8s-2:~$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d11e30f45c8f rancher/mirrored-coreos-etcd:v3.4.16-rancher1 "/usr/local/bin/etcd…" 40 seconds ago Restarting (1) 13 seconds ago etcd 4ff62afa35d8 rancher/rancher-agent:v2.6.2 "run.sh --server htt…" About a minute ago Up About a minute strange_lichterman c2e61a39a248 rancher/rancher-agent:v2.6.2 "run.sh --server htt…" About an hour ago Up About an hour distracted_burnell wings@k8s-2:~$ docker stop d11e30f45c8f 4ff62afa35d8 c2e61a39a248 d11e30f45c8f 4ff62afa35d8 c2e61a39a248 wings@k8s-2:~$ docker container prune WARNING! This will remove all stopped containers. Are you sure you want to continue? [y/N] y Deleted Containers: d11e30f45c8fd56623d33292d03ebd0cbaf9ff6a6bf66767752ec9217d5c7482 4ff62afa35d88de5ac489b5da9d9f2cea38965bc8e8e0efd7ba046bc01187fda c2e61a39a2480dde401d6ebf05ce350ee95e179cbad1efa065ef3956118feab1 Total reclaimed space: 1.27kB wings@k8s-2:~$ docker volume prune WARNING! This will remove all local volumes not used by at least one container. Are you sure you want to continue? [y/N] y Total reclaimed space: 0B
Now that we're all cleaned up, let's create our cluster. In Rancher, go to Cluster Options for the new cluster and check the etcd and Control Plane roles. We'll install all roles on all nodes in this lab.
Run the command listed on each node, then notice the helpful green note at the bottom... "4 new nodes have registered".
Hit Done and wait a few minutes for the cluster to deploy. You can watch its progress by clicking Conditions.
That's it for today, as I had some etcd teething problems.