-2

I'm trying to install kubernetes on Oracle Linux 9. I just can't find kubernetes packages.

Executing sudo dnf search kubelet kubectl kubeadm kubernetes-cni cri-tools returns no packages found.

1.Docker is successfuly installed

2.The Kubernetes package manager(/etc/yum.repos.d/kubernetes.repo) configured correctly and contains:

[kubernetes]
baseurl = https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled = 1
gpgcheck = 1
gpgkey = https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
name = Kubernetes Repository

3.Executing the command "sudo dnf install -y kubelet kubeadm kubectl" eturns the following errors:

Error:
 Problem 1: cannot install the best candidate for the job
  - package kubelet-1.27.3-0.x86_64 does not have a compatible architecture
  - nothing provides libpthread.so.0(GLIBC_2.2.5)(64bit) needed by kubelet-1.27.3-0.x86_64
  - nothing provides libpthread.so.0(GLIBC_2.3.2)(64bit) needed by kubelet-1.27.3-0.x86_64
  - nothing provides libc.so.6(GLIBC_2.2.5)(64bit) needed by kubelet-1.27.3-0.x86_64
  - nothing provides libresolv.so.2(GLIBC_2.2.5)(64bit) needed by kubelet-1.27.3-0.x86_64
  - nothing provides kubernetes-cni >= 1.1.1 needed by kubelet-1.27.3-0.x86_64
 Problem 2: cannot install the best candidate for the job
  - package kubeadm-1.27.3-0.x86_64 does not have a compatible architecture
  - nothing provides kubernetes-cni >= 0.8.6 needed by kubeadm-1.27.3-0.x86_64
  - nothing provides cri-tools >= 1.19.0 needed by kubeadm-1.27.3-0.x86_64
  - nothing provides kubectl >= 1.19.0 needed by kubeadm-1.27.3-0.x86_64
  - nothing provides kubelet >= 1.19.0 needed by kubeadm-1.27.3-0.x86_64
 Problem 3: cannot install the best candidate for the job
  - package kubectl-1.27.3-0.x86_64 does not have a compatible architecture

isn't https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 the right package repository? Do you see something wrong in my configuration?

soung
  • 1,411
  • 16
  • 33
  • Why are you trying to install el7 packages on el8? Or el9? Also: have you considered [kind](https://kind.sigs.k8s.io/)? If you're just starting out it's a great way to get started. – larsks Jul 12 '23 at 03:48
  • because https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 is the latest repo url available for kubernetes herer https://packages.cloud.google.com/yum/repos/. Is there another repos anywhere ? – soung Jul 12 '23 at 05:09
  • Following link has https://packages.cloud.google.com/yum/repos list which are referred in kubernetes.repo file. You can install dependency packages as shown in the error and then install kubeadm, kubectl , kubelet. for ex: libc etc. usually the installer should install the dependency packages as well which is not happening in your case. – Nataraj Medayhal Jul 12 '23 at 05:11

1 Answers1

1

There are a few reasons why installing Kubernetes on RHEL-based OSes like CentOS 8 can be difficult.

  • RHEL is a commercial OS ( Need to rely on third-party documentation or support).
  • RHEL has a number of security features that can conflict with Kubernetes
  • K8s installation process on RHEL is more complex than on other operating systems.

Let's start with installation steps for Kubernetes on CentOS 8

1. Update

Update your system. Run the following command to update your system packages:

sudo dnf update

2. Install Docker

Install Docker. Kubernetes requires Docker to run containers, so you will need to install Docker first. Run the following command to install Docker:

sudo dnf install docker

3. Add the Kubernetes repository

Add the Kubernetes repository. Kubernetes does not come pre-installed on CentOS 8, so you will need to add the Kubernetes repository to your system.

sudo dnf config-manager --add-repo https://packages.kubernetes.io/yum/repos/kubernetes-el8-x86_64

4. Install K8s

Now that you have added the Kubernetes repository, you can install Kubernetes. Run the following command to install Kubernetes:

sudo dnf install kubelet kubeadm kubectl

5. Initialise the Kubernetes cluster

Once you have installed Kubernetes, you need to initialize the Kubernetes cluster. Run the following command to initialize the Kubernetes cluster:

 sudo kubeadm init

This command will generate a token that you will need to join the worker nodes to the cluster.

6. Join the worker nodes to the cluster.

Once you have initialized the Kubernetes cluster, you need to join the worker nodes to the cluster. Run the following command on each worker node to join the cluster:

sudo kubeadm join <master_node_ip>:6443 --token <token> --discovery-token-ca-cert-hash sha256:<hash>

Replace <master_node_ip> with the IP address of the master node, and with the token that was generated when you initialized the cluster.

Verify the installation.

Once you have joined the worker nodes to the cluster, you can verify the installation by running the following command:

kubectl get nodes

This command will list all of the nodes in the cluster.

That's it! You have now successfully installed Kubernetes on CentOS 8

For reference, Installation of Kubernetes on Ubuntu [here][1]

engineerbaz
  • 91
  • 2
  • 6
  • Following your guide produces an error: Kubernetes Repository 0.0 B/s | 0 B 00:00 Errors during downloading metadata for repository 'kubernetes': - Curl error (6): Couldn't resolve host name for https://packages.kubernetes.io/yum/repos/kubernetes-el9-x86_64/repodata/repomd.xml [Could not resolve host: packages.kubernetes.io] Error: Failed to download metadata for repo 'kubernetes': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried – soung Jul 12 '23 at 04:48
  • The error message you are getting indicates that the Kubernetes repository is not accessible. This could be due to : The DNS server is not configured correctly. The Kubernetes repository is down. There is a firewall blocking access to the repository. @Soung – engineerbaz Jul 12 '23 at 06:45
  • Welcome back to Stack Overflow. It looks like it's been a while since you've posted and may not be aware of the latest policies since your answer appears likely to have been entirely or partially written by AI (e.g., ChatGPT). As a heads-up, [posting of AI-generated content is not permitted on Stack Overflow](//meta.stackoverflow.com/q/421831). If you used an AI tool to assist with any answer, I would encourage you to delete it. Thanks! – NotTheDr01ds Jul 12 '23 at 15:01