Installation of Apinizer on Red Hat OS
This document explains the installation of Kubernetes version 1.31.0 on a server with the RHEL (Red Hat Enterprise Linux) 8.x / 9.x operating system. It is recommended to have Red Hat 8.6 operating system.
Pre-Installation Checks to be Performed Before Starting the Installation
Very Important
Before starting the installations, make sure that the hostname of the server is not "localhost.localdomain" and that each one is unique (with the hostname command). If this is the case, change it before starting the operations.
# (If necessary) Change Hostname
hostnamectl set-hostname your-new-hostname
There should be an input as 127.0.1.1 in /etc/hosts file.
There should be no "nameserver 127.0.1.1" entry in the /etc/resolv.conf file.
Very Important
If a proxy is required to access the internet, the following codes should be run.
# Run the following on the Linux shell:
export http_proxy=http://proxyIp:port/
export https_proxy=http://proxyIp:port/
export no_proxy=localhost,127.0.0.1,SERVERIP,*.hostname
# Add the codes below to the following files:
sudo vi /etc/apt/apt.conf
Acquire::http::Proxy "http://username:password@proxyIp:port";
Acquire::https::Proxy "https://username:password@proxyIp:port";
sudo vi /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxyIp:port"
Environment="HTTPS_PROXY=https://proxyIp:port"
Environment="NO_PROXY="localhost,127.0.0.1,::1,SERVERIP,*.hostname"
#1) Operating System Configurations (All Servers)
POWERSHELL
|
#2) Kubernetes Installation
#2.1) Container Installation (Will be Done on All Kubernetes Servers)
Before proceeding to Kubernetes installation, the following steps are followed to prepare the system and install containerd.
POWERSHELL
The first three lines here are mandatory, and the others can be changed according to the need.
YML
Install the required modules.
POWERSHELL
|
Note
# package runc-1:1.1.4-1.module+el8.7.0+16520+2db5507d.x86_64 is filtered out by modular filtering If errors are encountered, the following command line is executed.
sudo yum remove containerd.io | sudo yum remove runc
#2.2) Kubernetes Installation (On Master and Worker servers)
Kubernetes keys and repository addresses are uploaded to the system, kubernetes is installed and started.
POWERSHELL
POWERSHELL
POWERSHELL
|
#2.2.1) Bash Auto-Completion (İsteğe Bağlı, Herhangi Bir Kubernetes Master Sunucusunda)
This process can speed up the writing of Kubernetes commands.
POWERSHELL
|
#2.2.2) Creating Kubernetes Master Server(On Kubernetes Master Servers)
The following command is run to make Multi-Master Kubernetes
POWERSHELL
To use the Multi-Master structure, the other nodes that will be Master should be connected with the following code
BASH
Very Important # If the connection command is to be re-created, the output of the second command below should be added to the first one:
# The result should look something like this:
#If the code is intended to be generated manually, the following is used: for XXX → for YYY → for ZZZ → |
#2.2.3) Setting User Configuration of Kubectl Command on Kubernetes Master Server (On Kubernetes Master Servers)
Definitions are made for the user who will run the kubectl commands:
POWERSHELL
Execute the following command to set the KUBECONFIG variable for all sessions.
POWERSHELL
|
#2.2.4) Install Kubernetes Network Plugin (On Kubernetes Master Servers)
In this guide, we will use the Flannel network add-on. You can choose other supported network add-ons. Flannel is a simple and easy way to configure a layer 3 network architecture for Kubernetes. o
POWERSHELL
YML
Important If you did not use the value 10.244.0.0/16 as podCIDR while initializing the Master, you should download the above yaml file and edit the network settings here as well.
POWERSHELL
|
#2.2.5) If the Master Server is Wanted to be Used as a Worker at the Same Time (Optional)
It is not recommended for production environments. To add the worker role from to Master
POWERSHELL
To remove the worker role from the Master
POWERSHELL
|
#2.2.6) Registering Kubernetes Worker Servers to the Master (On Kubernetes Worker Servers)
A token information is required to connect the worker server to the Master. This will be written down during the setup phase on the master node. But if it is missed or you want to view it again, the following command can be used.
Master Node üzerinde
POWERSHELL
Worker olacak Node(lar) üzerinde
BASH
|
#2.2.7) Installation Check (On Any Kubernetes Master Server )
If the Node created in addition to the Master can be seen when the following code is run on the Master, the installation has been completed successfully.
If it does not transition from NotReady to Ready status within two minutes, the problem should be investigated with the command 'kubectl describe node <NODE_NAME>'.
BASH
|
#2.3) DNS Test (Optional, On Any Kubernetes Master Server)
POWERSHELL
|