Local Kubernetes cluster on openEuler OS
openEuler OS is the open source community edition of Huawei’s EulerOS — a Linux distribution based on CentOS.
What is specific about openEuler OS is that it is tailored for ARM64 CPU architecture and especially for server/cloud deployments! As a bonus it also provides an AI based performance optimization tool — A-Tune!
In a series of articles I am going to explore how easy/hard it to install and use different modern server side technologies and how to tune them with A-Tune!
Series of related articles
In this article we will try to setup a local Kubernetes cluster!
Local Kubernetes cluster is useful for development and Continuous Integration needs where a full-blown cluster setup would be an overkill.
There are several well known Kubernetes implementations that are made exactly for this purpose:
Let’s start with K3S!
K3S is a lightweight Kubernetes distribution built for IoT & Edge computing
The installation is as simple as
curl -sfL https://get.k3s.io | sh -
The command above will add k3s
service to SystemD and start it.
To add more agents/nodes you should:
- export K3S_URL environment variable with a value the url to the server, which you could get with
sudo k3s kubectl config view
- read the content of
/var/lib/rancher/k3s/server/node-token
on the server machine and export it asK3S_TOKEN
environment variable on the agent machine - execute
curl -sfL https://get.k3s.io | sh -
that will do the SystemD setup of the agent
The installation process finishes successfully for both the server and the agent but unfortunately there is a problem for RedHat based Linux-es like openEuler and Fedora that does not setup properly iptables and the Kubernetes cluster does not really work.
So, K3S does not work at the moment on openEuler! You could uninstall it with sudo k3s-uninstall.sh
!
How about Minikube ?!
At the start page we are happy to see that Linux ARM64 is a supported platform!
To install the stable version we should execute:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-arm64
sudo install minikube-linux-arm64 /usr/local/bin/minikube
There is one prerequisite though — we need to install a driver / container runtime like Docker/Podman if it is not yet installed! I am most familiar with Docker so I will install it with sudo yum install docker-engine.aarch64
.
Minikube uses the containers as Kubernetes nodes!
Side note: openEuler also provides its own container runtime named iSulad. At the moment it is not listed as supported driver at https://minikube.sigs.k8s.io/docs/drivers/ but in a follow-up article I will try to find out what would be needed to use it as a driver for Minikube!
After starting Minikube with minikube start
we could actually use it with minikube kubectl ...
commands!
Success!
Kind!
Kind is a tool originally designed for testing Kubernetes itself. Just like Minikube it uses Docker containers as Kubernetes nodes.
There are two ways to install it:
- if Golang is installed on the machine then just issue
GO111MODULE="on" go get sigs.k8s.io/kind@v0.12.0
- alternatively just download the ARM64 binary and put it in
$PATH
, e.g.
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.12.0/kind-linux-arm64
chmod +x ./kind
sudo install ./kind /usr/local/bin/kind
To create a Kubernetes cluster with at least one worked node you need to create a config like
then execute kind create cluster --config kind-cluster.yaml
To interact with the cluster you need to set it as the currently active one with kubectl config set-context my-kind-cluster-name
.
For more information consult with the documentation.
Another success!
From the four local Kubernetes tools we tried we have two working ones, one failing and one unavailable for our operating system of choice.
In the next article we will see how to run Apache Spark jobs on it! Stay tuned!