Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs/guides/containers/rancher_and_kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ tags:

# Working with Rancher and Kubernetes

**Kubernetes** (**K8s**) is an open source container orchestration system for managing the deployment and management of containerized applications.
**Kubernetes** (**K8s**) is an open-source container orchestration system for managing the deployment and management of containerized applications.

K8S has made a name for itself on the market, so there is really no need to introduce it anymore.
K8S has made a name for itself on the market, so there is no need to introduce it anymore.

Cloud providers have made it easy to deploy managed Kubernetes platforms, but what about setting up and managing an on-premise cluster?

How easy is it to manage multiple clusters, whether on-premise or multi-cloud?

The answer to the last two questions are: No. Setting up an on-premise cluster is not easy, and managing a multi-cloud cluster can be a real headache.
The answer to the last two questions is No. Setting up an on-premise cluster is difficult, and managing a multi-cloud cluster can be a real headache.

That is where the subject of this guide comes in: **Rancher**! Rancher is also an open source system, enabling the installation and orchestration of several multi-cloud or on-premise clusters, and providing interesting features such as an application catalog and a practical web interface for visualizing resources.
That is where the subject of this guide comes in: **Rancher**! Rancher is also an open-source system, enabling the installation and orchestration of several multi-cloud or on-premise clusters and providing interesting features such as an application catalog and a practical web interface for visualizing resources.

Rancher will enable you to deploy Kubernetes clusters managed by cloud providers, import existing Kubernetes clusters or deploy K3S (for short, it is a lighter version of K8S) or K8S clusters.
Rancher will enable you to deploy Kubernetes clusters managed by cloud providers, import existing Kubernetes clusters, or deploy K3S (for short, it is a lighter version of K8S) or K8S clusters.
Copy link
Contributor

@SergeCroise SergeCroise Feb 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


This guide will help you discover Rancher, install and start it, and then create an on-premise Kubernetes cluster deployed on Rocky Linux servers.

## Rancher deployment

Installing Rancher is quite trivial, if you have Docker installed on your server.
Installing Rancher is quite trivial if you have Docker installed on your server.

You can find the Docker installation [here in gemstones](https://docs.rockylinux.org/gemstones/docker/).

Expand Down Expand Up @@ -60,7 +60,7 @@ docker run -d --name=rancher --privileged --restart=unless-stopped -p 80:80 -p 4

!!! NOTE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


If you are curious, have a look at the new container's logs. You will see that a K3S cluster (with a single node) has just been created! This is how Rancher works in its standalone version.
If you are curious, look at the new container's logs. You will see that a K3S cluster (with a single node) has just been created! This is how Rancher works in its standalone version.

![k3s local cluster](img/rancher_k3s_local_cluster.png)

Expand All @@ -71,7 +71,7 @@ firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --zone=public --add-service=https
```

If you go to the newly deployed Rancher web interface, a message will inform you how to retrieve the admin administrator password which is present in your container logs.
If you go to the newly deployed Rancher web interface, a message will inform you how to retrieve the admin administrator password in your container logs.

To do this, launch the following command:

Expand All @@ -85,15 +85,15 @@ You are ready to connect to the Rancher's webUI.

!!! NOTE

This solution is by no means production-ready. You will need to make sure the system is highly available, but it is a good start. Consider deploying Rancher on an existing K8S cluster for optimal HA.
This solution is by no means production-ready. You will need to ensure the system is highly available, but it is a good start. Consider deploying Rancher on an existing K8S cluster for optimal HA.

## Kubernetes on Rocky Linux 9 servers

Rancher offers its own docker-based version of Kubernetes: RKE (Rancher Kubernetes Engine).
Rancher offers its docker-based version of Kubernetes: RKE (Rancher Kubernetes Engine).

All you need is several Rocky Linux servers and the [Docker engine](https://docs.rockylinux.org/gemstones/docker/) installed on them.

Do not forget that one of the requirements of Kubernetes is to have an odd number of master nodes (1 or 3, for example). For the purposes of our tests, start with 3 master nodes, and 2 additional nodes with only the worker role.
Do not forget that one of the requirements of Kubernetes is to have an odd number of master nodes (1 or 3, for example). For our tests, start with 3 master nodes and 2 additional nodes with only the worker role.

Once Docker is installed on the servers, stop `firewalld` and run `nftables` on each servers:

Expand All @@ -112,7 +112,7 @@ In the cluster management area, create a new cluster:

![create cluster](img/rancher_cluster_create.png)

You are free to create a cluster in a hosted Kubernetes provider, provision new nodes and create a cluster using RKE2/K3s, or, and that is our case, use existing nodes and create a cluster using RKE2/K3s.
You are free to create a cluster in a hosted Kubernetes provider, provision new nodes, and create a cluster using RKE2/K3s, or, in our case, use existing nodes and create a cluster using RKE2/K3s.

Choose the last option.

Expand Down