This is to create a rancher server in Hetzner Cloud so that we can build the Kubernetes cluster.
In Hetzner cloud, create a new network, we'll call it devops
- Create an RSA Key Pair
ssh-keygen -b 1024 -t rsa -f id_rsa
Enter a passphrase
This will create id_rsa and id_rsa.pub
-
Add the identify to your host
ssh-add id_rsa -
Add the id_rsa.pub contents to the SSH keys in Hetzner.
Rancher via Docker requires 4GB RAM minimum. This is CX21 for €4.90/m. Choose Nuremberg as the datacenter for the lowest ping.
- Select Nuremberg
- Select Ubuntu (latest LTS)
- Standard type
- Select CX21 - 4GB for €4.90/m
- Select
devopsnetwork - Select the ssh key
- Call it
rancher
In this case, we'll point rancher.commersive.dev to the IP address of the rancher server.
- SSH to the server using root@rancher.commersive.dev and accept the fingerprint. You should access immediately as the keys have been set up.
- Install docker
apt update
apt upgrade
apt install -y docker.io open-iscsi
systemctl start docker
hostnamectl set-hostname workerx- Install Rancher as an automatically restarting docker container.
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
-v /root/rancher:/var/lib/rancher \
--name rancher-server \
rancher/rancher:latest \
--acme-domain rancher.xxxx-
Access rancher at: https://rancher.xxx
-
Set up an account with a STRONG password. The username is
admin. -
Store the password in Keypass