Cyber Deals - Get up to 65% off on CKA, CKAD, CKS, KCNA, KCSA exams and courses!

rancher

1. Introduction to Rancher & RKE

1.1. Rancher Architecture

1.2. Disocvering RKE

  • RKE deploys Kubernetes components as docker containers
  • SSH is used to orchestrate RKE across servers
  • Cluster.yml contains all the information RKE needs to provision a Kubernetes cluster
  • You can supply your own certificates that Rancher will serve for its UI/API
  • RKE will support the Latest patch releases from the three most recent minor releases correct

1.2.1. Node Preparation

Installation Requirements

  • SSH user in docker group
  • Disable swap on workers

Install docker curl https://releases.rancher.com/install-docker/19.03.sh | sh

~$ rke --version
rke version v1.0.6

1.2.2. Creating the Cluster Configuration File

$ rke config

Answer questions and create cluster.yaml

$ rke up --ssh-agent-auth

Creating the Cluster Configuration File

1.2.3. Certificate Options

1.3. Day Two Operations For RKE

1.3.1. Secure the Installation Files

Save kube_config_cluster.yaml and cluster.rkestate

1.3.2. Backups and DR

  • Snapshot every 6 hours and keep it for 24 hours
  • or take manual snaphort rke etcd snapshort-save, which will save snapshot in /opt/rke/etcd-snapshots/ directory
  • minio to keep snapshots
  • rke etcd snapshot-restore --name BACKUP_FILE to restore

1.3.3. Upgrade an RKE Cluster

  • Use rke config to list the versions of Kubernetes supported by this version of rke
  • modify config to new version - Ref

1.3.4. Certificate Management

  • Automatic Certificate Rotation - rke cert rotate

1.3.5. Adding and Removing Nodes

  • amend the cluster.yaml and do rke up

2. Installing Rancher

$ docker run -d --restart=unless-stopped -p 80:80 -p 443:443 -v \
  /opt/rancher:/var/lib/rancher rancher/rancher:v2.4.1

or rancher/rancher:stable

  • persistent data at /var/lib/rancher (a docker volume)

  • -d daemonize

  • -p 80:80 -p 443:443 to pass throufh ports 80 and 443

  • --restart=undelss-stopped

  • Option A: Default Rancher-generated Self-signed Certificate

docker run -d --restart=unless-stopped \
  -p 80:80 -p 443:443 \
  --privileged \
  rancher/rancher:latest
  • Option B: Bring Your Own Certificate, Self-signed
docker run -d --restart=unless-stopped \
  -p 80:80 -p 443:443 \
  -v /<CERT_DIRECTORY>/<FULL_CHAIN.pem>:/etc/rancher/ssl/cert.pem \
  -v /<CERT_DIRECTORY>/<PRIVATE_KEY.pem>:/etc/rancher/ssl/key.pem \
  -v /<CERT_DIRECTORY>/<CA_CERTS.pem>:/etc/rancher/ssl/cacerts.pem \
  --privileged \
  rancher/rancher:latest
  • Option C: Bring Your Own Certificate, Signed by a Recognized CA
docker run -d --restart=unless-stopped \
  -p 80:80 -p 443:443 \
  -v /<CERT_DIRECTORY>/<FULL_CHAIN.pem>:/etc/rancher/ssl/cert.pem \
  -v /<CERT_DIRECTORY>/<PRIVATE_KEY.pem>:/etc/rancher/ssl/key.pem \
  --privileged \
  rancher/rancher:latest \
  --no-cacert
  • Option D: Let’s Encrypt Certificate
docker run -d --restart=unless-stopped \
  -p 80:80 -p 443:443 \
  --privileged \
  rancher/rancher:latest \
  --acme-domain <YOUR.DNS.NAME>

Open the url(IP) in a browser and set admin password

Upgrading Rancher

Installing and Managing Rancher With Kubernetes - Deploying Into RKE

3. References

Disclaimer: Views expressed in articles are those of the respective authors and do not necessarily reflect the views of their employers or this site. While we aim for accuracy, please verify information before relying on it, and let us know if you spot an error.
Tags:
Share:

Related Posts

Ansible for Infoblox

Ansible for Infoblox

Configure Ansible for Infoblox Install Python3 on RHEL Instal Python3 on Centos Setup Python VirtualEnv (venv) DONOT Upgrade pip to Latest !!! …

Red hat

Red Hat Knowledge Base

Reference Documents for Red Hat Products Red Hat Subscription Management Cheatsheet sosreport methods Subscription Reference Troubleshooting Failed to …

Ansible

Ansible Collections

Installing collections Using Collection on Tower References Installing collections ansible-galaxy collection install my_namespace.my_collection or

Ansible

Ansible for Windows

Checkout the Ansible Automation for Windows guides. WinRM vs OpenSSH – Pros & Cons WinRM (Default) ✔️ Pros ❌ Cons 🆕 OpenSSH ✔️ Pros ❌ Cons 💡 Use …

Ansible

Ansible awx cli

Note: This notes are based on the AAP 2.5 Installation # On Red Hat Enterprise Linux 8, the Controller CLI can be installed via dnf: dnf install …

Ansible

Install Ansible AWX using AWX Operator (on Kubernetes)

Install Ansible AWX using AWX Operator (on Kubernetes) Setup a Kubernete s Cluster Deploy AWX Operator Create AWX Deployment Get Admin Password Get …