With CentOS 8 out, the installation of Kubernetes has changed. Learn how to make this happen.
CentOS 8 has arrived, and along with it a number of changes have been discovered. One such change is how the installation of the Docker engine and Kubernetes is taken care of. I've already covered the, and now I want to walk you through the process of installing Kubernetes on the same CentOS 8 server.
SEE: Hybrid cloud: A guide for IT pros (TechRepublic download)
What you'll need
To make this work, you'll need the following:
- A running instance of CentOS 8
- Docker CE installed and running
- A user with sudo privileges
- Access to the root user
How to install Kubernetes
Remember, it's crucial that you have Docker CE installed, before starting this process. Once you have the Docker engine up and running, here's how to add Kubernetes to the server.
The first thing to be done is the addition of the Kubernetes repository. To do this, open a terminal window on the CentOS 8 server and issue the command:
sudo nano /etc/yum.repos.d/kubernetes.repo
In this new file, paste the following contents:
[kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
Save and close the file.
Next, install the necessary packages with the command:
sudo dnf install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
Enable the kubelet daemon with the command:
sudo systemctl enable --now kubelet
For the next task, you must su to the root user. Once you've done that, issue the command:
In this new file, add the following two lines:
net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1
Save and close the file.
Reload the configuration with the command:
Exit out of the root user with the command:
How to disable swap
Finally, before you initialize your Kubernetes cluster, you must disable swap. For this, issue the command:
sudo swapoff -a
To make this permanent, issue the command:
sudo nano /etc/fstab
Comment out the line that starts with /dev/mapper/cl-swap swap. Save and close the file.
You can now initialize your Kubernetes cluster and add nodes. Your CentOS 8 Kubernetes server is ready to start deploying.
- Multicloud: A cheat sheet (TechRepublic)
- Serverless computing: A guide for IT leaders (TechRepublic Premium)
- How to enable automatic updates with Cockpit on CentOS 8 (TechRepublic)
- How to enable SSH session recording in CentOS 8 (TechRepublic)
- How to enable Cockpit on CentOS 8 (TechRepublic)
- CentOS 8 is finally here (TechRepublic)
- Red Hat's CentOS 8 arrives: Here's what you get with it (ZDNet)
- Best cloud services for small businesses (CNET)
- Microsoft Office vs Google Docs Suite vs LibreOffice (Download.com)
- Cloud computing: More must-read coverage (TechRepublic on Flipboard)