Thispage discusses third-party software sources not officially affiliated with or endorsed by the Fedora Project.Use them at your own discretion.Fedora recommends the use of free and open source software and avoidance of software encumbered by patents.
This how-to provides an overview of the Kubernetes (K8s) rpms in the Fedora repositories, how to use them in a few scenarios and a short cluster creation guide using kubeadm on a single Fedora machine.The guide also touches on an alternative source for Kubernetes rpms available in COPR and potential benefits.
Kubernetes is an "open-source system for automating deployment, scaling, and management of containerized applications" on one or more machines.Kubernetes had its genesis in the concepts and principles used at Google to run container-base workloads at scale and with resilience.Kubernetes is now at the center of a vast ecosystem of products and services (Cloud Native Computing Foundation) that help organizations create, install, run, manage and secure container-based applications and services at any possible scale.
There are numerous ways to install and configure Kubernetes depending on purpose and target environment.Is this for a home lab on a single machine, a small cluster for home or business automation, edge-based services and applications in remote offices or enterprise scale production workloads in the cloud?This guide is narrowly focused on the Kubernetes rpms available from Fedora and using dnf and the command line to install these rpms on Fedora and create a basic cluster using kubeadm.
Kubernetes is complex and like many complex systems has its own terminology.The terminology used in this guide are defined here.The Kubernetes teams maintains a comprehensive glossary which is used in the subset below.
containerized applications are deployed and managed in Kubernetes as pods.A pod is the base object managed by Kubernetes in a cluster.A pod typically has a single primary container but may include more capabilities including multiple containers.
The number, name, and organization of content in Fedora Kubernetes rpms depends on the Fedora release.Fedora 40 and newer releases (starting with Kubernetes v1.29) have one set of rpms.Fedora 39 and older releases have the legacy set of rpms.
For most modern kubernetes clusters install kubernetes-node, kubernetes-kubeadm, and kubernetes-client on each machine in the cluster.If disk space is a constraint only install kubernetes-client on control-plane machines.
Kubernetes rpms have been reorganized starting with Kubernetes version 1.29 in Fedora 40.Rawhide for Fedora 40 initially started with Kubernetes v1.28 and the legacy package organization but these have been superseded by Kubernetes v1.29 starting in late January 2024.The table below lists the available Kubernetes rpms, what the rpm contains, and notes on purpose and any cautions or restrictions.
For most modern kubernetes clusters install kubernetes, kubernetes-kubeadm, and kubernetes-client on each machine in the cluster.If disk space is a constraint only install kubernetes-client on control-plane machines.
Each Fedora release has a corresponding version of Kubernetes available as listed below.The goal is to provide the most current Kubernetes release available when a Fedora release reaches General Availability (GA).This is not always possible resulting in skipped Kubernetes releases.Skipping a release causes problems for Kubernetes cluster administrators given the Kubernetes cluster upgrade process.Alternative ways to package Kubernetes for Fedora are being explored.
1 Rawhide for Fedora 40 was initialized with Kubernetes v1.28. Kubernetes v1.29 went live while Fedora 40 was still in rawhide and superseded v1.28. Since Fedora 39 has Kubernetes v1.27 and changing to v1.28 would be problematic for existing clusters, Kubernetes v1.28 was moved to a COPR project.
Below is a guide to creating a functional Kubernetes cluster on a single Fedora machine that is suitable as a learning and exploring environment.This guide is not intended for production environments.
Each Fedora release has a corresponding Kubernetes release as documented at the Fedora Package Sources repository for Kubernetes.Fedora 39, for example, has rpms for Kubernetes 1.27.The cluster initialization is the same for all current Fedora releases.These instructions have been tested on Fedora 38 and Fedora 39 virtual machines and on Raspberry Pi 4 hardware running Fedora 38 and Fedora 39 minimal.The guide below generally follows the Creating a cluster with kubeadm guide.
Disable the firewall.Kubeadm will generate an installation warning if the firewall is running.Disabling the firewall removes one source of complexity in a learning environment.Modern Fedora systems use firewalld.See -security/#use-firewalld for an alternative solution that retains the firewall and opens necessary ports.The current list of ports and protocols used by a Kubernetes cluster can be found at -and-protocols/.
Verify that the net.bridge.bridge-nf-call-iptables, net.bridge.bridge-nf-call-ip6tables, and net.ipv4.ip_forward system variables are set to 1 in your sysctl configuration by running the following command:
Install a container runtime.CRI-O is installed in this example.Containerd is also an option.Note: If using cri-o, verify that the major:minor version of cri-o is the same as the version of Kubernetes (installed below).
Install Kubernetes.In this example, all three Kubernetes applications (kubectl, kubelet, and kubeadm) are installed on this single node machine.Please see the notes above on recommended packages for control plane or worker nodes if the cluster will have both types of machines.
kubeadm will generate output to the terminal tracking initialization steps.If successful, the output below is displayed.At this point there is a cluster running on this single machine.After kubeadm finishes you should see:
Display list of running pods in the cluster.All pods should display a status of Running.A status of CrashLoopBackOff may show up for the coredns pod.This happens commonly when installing Kubernetes on a virtual machine and the DNS service in the cluster may not select the proper network.Use your favorite internet search engine to find possible solutions.
The DNF Versionlock plugin is useful in blocking unplanned updates to Kubernetes rpms.Occasionally, the Kubernetes version in a Fedora release reaches end-of-life and a new version of Kubernetes is added to the repositories.Or, an upgrade to Fedora on a cluster machine will also result in a different version of Kubernetes.Once DNF Versionlock is installed, the following command will hold kubernetes rpms and the cri-o rpm at the 1.28 major:minor version but still allow patch updates to occur:
The Versioned Kubernetes Packages project is an experimental project exploring the use of versioned Kubernetes packages.A versioned package has a version number as part of the name such as kubernetes1.28 or kubernetes1.28-client.The goal is to have multiple versions of Kubernetes available for a given Fedora release.This uncouples Fedora versions from Kubernetes versions allowing version upgrades to either Fedora or Kubernetes.A cluster manager can update the Fedora machines while maintaining the cluster version constant.Or the cluster manager can update Kubernetes while retaining the same Fedora release.All Kubernetes releases in this repository use the new package structure.
The Kubernetes 1.26 project provides Kubernetes 1.26 rpms for all current Fedora releases that provide Go language 1.21 or newer.Kubernetes 1.26 is the default version available in Fedora 38.This project uses the legacy package structure.
The Kubernetes 1.27 project provides Kubernetes 1.27 rpms for all current Fedora releases that provide Go language 1.21 or newer.Kubernetes 1.27 is the default version available in Fedora 39.This project uses the legacy package structure.
The Kubernetes 1.28 project provides Kubernetes 1.28 rpms for all current Fedora releases that provide Go language 1.21 or newer.Kubernetes 1.28 is not otherwise available in official Fedora repositories.This project uses the legacy package structure.
The Kubernetes 1.29 project provides Kubernetes 1.29 rpms in the new package structure.Kubernetes v1.29 requires Go language 1.21 or newer.Kubernetes 1.29 is the default version for Fedora 40.This project uses the new package structure.
The Kubernetes 1.30 project provides Kubernetes 1.30 rpms in the new package structure.This is an alpha level release from the Kubernetes team.Kubernetes v1.30 requires Go language 1.22 or newer which is only available in Fedora 40 and 41 (rawhide).This project uses the new package structure.
In addition to the pre-built binary + package manager installation options listedabove you can install kind from source with go install
sigs.k8s.io/ki...@v0.23.0 or clone this repoand run make build from the repository.
NOTE: The following are community supported efforts. The kind maintainers are not involved in the creationof these packages, and the upstream community makes no claims on the validity, safety, or content of them.
If you want the create cluster command to block until the control planereaches a ready status, you can use the --wait flag and specify a timeout.To use --wait you must specify the units of the time to wait. For example, towait for 30 seconds, do --wait 30s, for 5 minutes do --wait 5m, etc.
The kind can auto-detect the docker, podman, or nerdctl installed and choose the available one. If you want to turn off the auto-detect, use the environment variable KIND_EXPERIMENTAL_PROVIDER=docker, KIND_EXPERIMENTAL_PROVIDER=podman or KIND_EXPERIMENTAL_PROVIDER=nerdctl toselect the runtime.
If $KUBECONFIG environment variable is set, then it is used as a list of paths(normal path delimiting rules for your system). These paths are merged. When a valueis modified, it is modified in the file that defines the stanza. When a value is created,it is created in the first file that exists. If no files in the chain exist,then it creates the last file in the list.
3a8082e126