How to install and use Kubernetes on Fedora?

Hi Fedora community,
I am trying to learn how to use Kubernetes on Fedora for automation.
Any help is much appreciated.

There’s a few way you can go about it.

Option 1: You can install the official K8s repo:

Install the tools following their documentation, or you can install the MiniKube package from them if you just wanna learn K8s. Here’s their way of adding the repo:

cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\$basearch
enabled=1
gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
EOF

and you can find this information all right here:

Option 2: OKD with Fedora Core OS

If you want a full scale K8s cluster, you can use OKD which is the community supported version of OpenShift. It uses Fedora CoreOS as the OS image that’s basically K8s ready. You can learn all about it from here:

4 Likes

Option 3: just sudo dnf install cri-o kubernetes-kubeadm kubernetes-node kubernetes-client cri-tools iproutetc, and follow the kubernetes.io installation steps. Containerd is an alternative to cri-o. From the normal installation path, you’ll probably be one release behind the kubernetes.io latest version. I did my cluster installations that way, using the Fedora Server edition, but I also run with scissors. I’d recommend Option 1 that @alys suggests, but for just learning the basics, the Minikube path is really the easy path and is used in many online tutorials. Have fun and keep learning.

3 Likes

Thank you both, for helping me learn.

2 Likes

I realize that this is an older thread but thought it useful to add a note about the Kubernetes rpms in Fedora F37, F38, and F39 (potential change in F40).

The kubernetes-node rpm installs kubelet.
The kubernetes-kubeadm rpm installs kubeadm.
The kubernetes-client rpm installs kubectl.

The kubernetes-master rpm installs as systemd units kube-proxy, kube-apiserver, and kube-scheduler. This rpm and these systemd units are only needed if you are following the Kubernetes The Hard Way tutorial (GitHub - kelseyhightower/kubernetes-the-hard-way: Bootstrap Kubernetes the hard way on Google Cloud Platform. No scripts.). Otherwise this rpm is not needed.

If using kubeadm to initialize a cluster, these services are installed as static pods on the control plane so the systemd units are not needed.

At this time the kubernetes-node rpm also will require either cri-o or containerd be installed.

2 Likes

I have installed the kubectl just by dnf install kubernetes-client

1 Like