Kubernetes
Kubernetes installation guide
Last updated
Was this helpful?
Kubernetes installation guide
Last updated
Was this helpful?
OpenG2P modules and components are recommended to be run on (K8s), because of ease-of-use, management, and security features that K8s provides.
K8s cluster may be installed on the following infrastructures:
Cloud-native (like EKS on AWS, or AKS on Azure)
Non-cloud native, or on-prem (resources provisioned on a cloud or local data centre).
Here we provide instructions to set up K8s cluster on-prem.
Broadly, the steps to install are as follows:
using Rancher's tool .
Provide access to users
Provision for virtual machines (VMs) as per configuration mentioned in . Make sure you have root privileges to the machines and have secure access to them.
Install the following tools on all machines including the one you are using to connect to the VMs.
wget
, curl
, kubectl
, istioctl
, helm
, jq
If you have SSH access to the VMs, and root privileges, you are the Super Admin. Make sure very limited access is given to the machines.
The following setup has to be done on each node on the cluster.
SSH into the node. Execute all the below commands as root user.
Create the rke2 config directory
Create a config.yaml
file in the above directory, using one of the following config file templates:
Edit the above config.yaml
file with the appropriate names, IPs, and tokens
Run this to download rke2.
Run this to start rke2:
On the control-plane node, run:
On the worker node, run:
To export KUBECONFIG, run (only on control-plane nodes):
Download the Kubeconfig file rke2.yaml
and keep it securely shared with only Super Admins. Rename it so that it can be identified with the cluster. This file will be used if cluster control via Rancher is unavailable.
This installation only applies if Longhorn is used as storage. This may be skipped if you are using NFS.
Navigate to the Cluster Management section in Rancher
Click on Import Existing Cluster. Follow the steps to import the new OpenG2P cluster
After importing, download kubeconfig
file for the new cluster from rancher (top right on the main page), to access the cluster through kubectl from the user's machine (client), without SSH
Your cluster may hold critical data that needs to be backed up. The following minimal backups are highly recommended:
NFS data
Persistent Volumes (PVs)
The PVs on NFS are stored as folders that are hard to associate with original application/pod. Download the YAML of critical PVs - like Postgres, Minio etc and keep it safely. This will be required in case a cluster has to be recreated, in which case, the corresponding PVs may be mounted back from the storage provided the name of the PV is known. On Rancher the PV YAMLs are available under Storage -> PersistentVolumes of a cluster. Alternatively, you may download PVs using command line utility kubectl
.
Refer guide .
The following section uses to set up the K8s cluster.
Decide on the number of control-planes (RKE2 server). For high availability the minimum of nodes running control-plane should 3. If your cluster is < 3 nodes, run only 1 control-plane (odd number). Refer . The rest of the nodes are Kubernetes workers (RKE2 agent).
For the first control-plane node, use . The token can be any arbitrary string.
For subsequent control-plane nodes, use . (Make sure the token defined in the first node's control plane is used here too.)
For worker nodes, use . (Make sure the token defined in the first node's control plane is used here too.)
Run the following to set the RKE2 version after referring to .
Additional Reference:
This section assumes an has already been set up. Install NFS client provisioner on the cluster as follows:
Clone .
From directory, run: (Make sure to replace the <NFS Node Internal IP>
and <cluster name>
parameters appropriately below)
Refer guide .
This step assumes that a has already been set up and operational.
Users may be given access to the cluster using .
Refer .