Comment out F40 related content

Comment out F40 related content pending submission of updated src
package with revised structure and rpm names
This commit is contained in:
Bradley G Smith 2023-10-23 13:26:56 -07:00 committed by Ankur Sinha (Ankur Sinha Gmail)
parent 20dfab7660
commit 4e5cb29eda
No known key found for this signature in database
GPG key ID: F8D8C0BEBAC898BD

View file

@ -3,19 +3,20 @@ Bradley G Smith
:revnumber: F37,F38,F39,rawhide
:revdate: 2023-09-19
:category: Installation
:tags: How-to kubernetes dnf rpm containers
:tags: How-to, kubernetes, dnf, rpm, containers
// Optional free form useful additional information as comment
//include::{partialsdir}/3rdparty-message.adoc[]
include::partial$3rdparty-message.adoc[]
[[sect-overview]]
== Overview
This how-to provides an overview of the link:https://kubernetes.io[Kubernetes] rpms in the Fedora repositories, how to use them in a few scenarios and a short installation guide using kubeadm on a Fedora machine.
This how-to provides an overview of the link:https://kubernetes.io[Kubernetes] rpms in the Fedora repositories, how to use them in a few scenarios and a short cluster creation guide using kubeadm on a Fedora machine.
The guide also touches on an alternative source for Kubernetes rpms available in COPR and potential benefits.
This guide concludes with a brief overview of a few alternative installation methods applicable to Fedora users.
[[sect-what-is-kubernetes]]
=== What is Kubernetes?
link:https:/kubernetes.io[Kubernetes] is an "open-source system for automating deployment, scaling, and management of containerized applications" on one or more machines.
@ -26,6 +27,7 @@ There are numerous ways to install and configure Kubernetes depending on purpose
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.
[[sect-terminology]]
=== Terminology
Kubernetes is complex and like many complex systems has it's own terminology.
@ -43,13 +45,14 @@ pods:: 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.
[[sect-kubernetes-rpms]]
== Kubernetes rpms in Fedora
The number, name, and organization of content in Fedora Kubernetes rpms depends on the Fedora release.
Fedora 40 and newer releases will have one set of rpms.
Fedora 39 and older releases have the legacy set of rpms.
[[sect-fedora-39-and-older]]
=== Fedora 39 and older releases
The table below lists the available Kubernetes rpms in Fedora 39 and older releases, what the rpm contains, and notes on purpose and any restrictions or cautions.
@ -86,24 +89,25 @@ Also installs kubernetes-client.
Required on each node.
|===
[[sect-fedora-39-recommendations]]
==== Fedora 39 (and older) Installation recommendations
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.
[,bash]
[source,bash]
----
sudo dnf install kubernetes-kubeadm kubernetes-node kubernetes-client
----
If conducting a manual installation of Kubernetes (see link:https://github.com/kelseyhightower/kubernetes-the-hard-way[Kubernetes The Hard Way]) then install kubernetes-master and kubernetes-kubeadm.
[,bash]
[source,bash]
----
sudo dnf install kubernetes-master kubernetes-kubeadm
----
////
[[sect-fedora40-and-newer]]
=== Fedora 40 and newer releases
Kubernetes rpms have been reorganized starting with Fedora 40 (rawhide in Sept 2023).
@ -134,23 +138,25 @@ Use systemctl to enable kube-proxy on all nodes. Enable kube-apiserver, kube-con
|===
[[sect-fedora-40-recommendations]]
==== Fedora 40 (and newer) installation recommendations
For most modern kubernetes clusters install kubernetes, and kubernetes-client on each machine in the cluster.
If disk space is a constraint only install kubernetes-client on control-plane machines.
[,bash]
[source,bash]
----
sudo dnf install kubernetes kubernetes-client
----
If conducting a manual installation of Kubernetes (see link:https://github.com/kelseyhightower/kubernetes-the-hard-way[Kubernetes The Hard Way]) then install all kubernetes rpms.
[,bash]
[source,bash]
----
sudo dnf install kubernetes kubernetes-kubeadm kubernetes-control-plane-services kubernetes-node-services kubernetes-client
----
////
[[sect-kubernetes-fedora-crosswalk]]
== Kubernetes and Fedora version crosswalk
Each Fedora release has a corresponding version of Kubernetes available as listed below.
@ -199,6 +205,7 @@ This guide follows the steps in the link:https://kubernetes.io/docs/setup/produc
. Update system with DNF.
Reboot if necessary, although a reboot can be deferred until after the next step.
+
[source,bash]
----
sudo dnf update
----
@ -208,6 +215,7 @@ Kubernetes is configured to generate an installation error if swap is detected.
Modern Fedora systems use zram by default.
Reboot after disabling swap.
+
[source,bash]
----
sudo systemctl stop swap-create@zram0
sudo dnf remove zram-generator-defaults
@ -219,6 +227,7 @@ Kubernetes is configured to generate an installation error if the firewall is ru
Modern Fedora systems use firewalld.
See link:https://devopstales.github.io/kubernetes/k8s-security[https://devopstales.github.io/kubernetes/k8s-security] for an alternative solution that retains the firewall and opens necessary ports.
+
[source,bash]
----
sudo systemctl stop firewalld.system
sudo systemctl disable firewalld.system
@ -226,6 +235,7 @@ sudo systemctl disable firewalld.system
. Install iptables and iproute-tc.
+
[source,bash]
----
sudo dnf install iptables iproute-tc
----
@ -233,6 +243,7 @@ sudo dnf install iptables iproute-tc
. Configure IPv4 forwarding and bridge filters.
Below copied from link:https://kubernetes.io/docs/setup/production-environment/container-runtimes/[https://kubernetes.io/docs/setup/production-environment/container-runtimes/]
+
[source,bash]
----
sudo cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
@ -242,6 +253,7 @@ EOF
. Load the overlay and bridge filter modules.
+
[source,bash]
----
sudo modprobe overlay
sudo modprobe br_netfilter
@ -249,6 +261,7 @@ sudo modprobe br_netfilter
. Add required sysctl parameters and persist.
+
[source,bash]
----
# sysctl params required by setup, params persist across reboots
sudo cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
@ -260,12 +273,14 @@ EOF
. Apply sysctl parameters without a reboot.
+
[source,bash]
----
sudo sysctl --system
----
. Verify br_filter and overlay modules are loaded.
+
[source,bash]
----
lsmod | grep br_netfilter
lsmod | grep overlay
@ -273,6 +288,7 @@ lsmod | grep overlay
. 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:
+
[source,bash]
----
sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward
----
@ -283,24 +299,38 @@ Containerd is also an option.
Note: verify that the major:minor version of cri-o is the same as the version of Kubernetes (installed below).
On Fedora 38, for example you will need to install cri-o-0:1.26.1-1.fc38.x86_64 to avoid the 1.28 version that is also available.
+
[source,bash]
----
sudo dnf install cri-o containernetworking-plugins
----
. Install Kubernetes. This installs the three necessary Kubernetes applications (kubectl, kubelet, and kubeadm) that need to be on each machine in the cluster.
+
[source,bash]
----
# fedora 39 earlier use:
sudo dnf install kubernetes-client kubernetes-node kubernetes-kubeadm
----
////
[source,bash]
----
# fedora 39 earlier use:
sudo dnf install kubernetes-client kubernetes-node kubernetes-kubeadm
#fedora 40 and later use:
sudo dnf install kubernetes kubernetes-client
----
////
. Start and enable cri-o.
+
[source,bash]
----
sudo systemctl enable --now crio
----
. Pull needed system container images for Kubernetes.
+
[source,bash]
----
sudo kubeadm config images pull
----
@ -308,12 +338,14 @@ sudo kubeadm config images pull
. Start and enable kubelet.
Kubelet will be in a crash loop until the cluster is initialized in the next step.
+
[source,bash]
----
sudo systemctl enable --now kubelet
----
. Initialize the cluster.
+
[source,bash]
----
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
----
@ -339,6 +371,7 @@ Alternatively, if you are the root user, you can run:
. The steps listed above allow a non-root user to use kubectl, the Kubernetes command line tool. Run these commands now.
+
[source,bash]
----
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
@ -348,6 +381,7 @@ sudo chown $(id -u):$(id -g) $HOME/.kube/config
. Allow the control plane machine to also run pods for applications.
Otherwise more than one machine is needed in the cluster.
+
[source,bash]
----
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
----
@ -356,6 +390,7 @@ kubectl taint nodes --all node-role.kubernetes.io/control-plane-
There are many other networking solutions besides flannel.
Flannel is straightforward and suitable for this guide.
+
[source,bash]
----
kubectl apply -f https://github.com/coreos/flannel/raw/master/Documentation/kube-flannel.yml
----
@ -366,6 +401,7 @@ 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.
+
[source,bash]
----
kubectl get pods --all-namespaces
----
@ -379,40 +415,39 @@ The xref:dnf.adoc#sect-using-dnf-plugin[DNF Versionlock plugin] is useful in blo
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:
[source,bash]
----
sudo dnf versionlock add kubernetes*-1.28.* cri-o-1.28.*
----
[copr]
[[sect-kubernetes-projects-in-copr]]
== Kubernetes projects in COPR
// UNVERIFIED
There are Kubernetes projects in link:https://copr.fedorainfracloud.org/[COPR] that might be useful.
For this method, please refer to the link:https://github.com/leamas/lpf[`lpf GitHub Page`]
requirements.
[[sect-versioned-kubernetes-rpms]]
=== Versioned Kubernetes RPMS
. xref:rpmfusion-setup.adoc[Enable the RPMFusion repositories].
. Install the `lpf-spotify-client` package:
+
----
sudo dnf install lpf-spotify-client
----
The link:https://copr.fedorainfracloud.org/coprs/buckaroogeek/copr-k8s-versioned/[Versioned Kubernetes Packages] project is an experiment 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.
. Install Spotify:
.. Click the "lpf-spotify-client" icon in the application list.
.. or use the following command in a terminal:
+
----
lpf update
----
[[sect-kubernetes-1.27]]
=== Kubernetes 1.27 RPMS
The link:https://copr.fedorainfracloud.org/coprs/buckaroogeek/copr-k8s-1.27/[Kubernetes 1.27] project provides Kubernetes 1.27 rpms for all current Fedora releases that provide Go language 1.20 or newer.
This includes Fedora 38, Fedora 39, and Fedora 40 (rawhide).
[alternatives]
== Alternatives
[[sect-kubernetes-1.25]]
=== Kubernetes 1.25 RPMS
There are many ways to install Kubernetes on Fedora. Below are a few alternatives that might be useful. This list is far from exhaustive.
minikube
openshift and okr
ansible-based installs such as typhoon
The link:https://copr.fedorainfracloud.org/coprs/buckaroogeek/copr-k8s-1.25/[Kubernetes 1.25] project provides rpms for all Fedora releases.
Kubernetes 1.25 part of the Fedora 37 release along with Go language version 1.19.
The upstream Kubernetes team recently updated Kubernetes 1.25 to use Go language version 1.20.
Kubernetes 1.25 can no longer be built on standard Fedora 37.
This project uses a custom version of Go available in COPR to continue to provide this version of Kubernetes for Fedora 37 as well as for newer Fedora releases. Both Fedora 37 and Kubernetes 1.25 will reach end of life in the October-November 2023 time frame.
[references]
== References