1. Install Kubernetes

Follow the official Kubernetes documentation and configure an appropriate package mirror. In China, you can use the Tsinghua mirror configuration. Be sure to configure the GPG key as well. Otherwise, the installer will still need to download the key and may time out.

[kubernetes]
name=kubernetes
baseurl=https://mirrors.tuna.tsinghua.edu.cn/kubernetes/yum/repos/kubernetes-el7-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///rpm-package-key.gpg
exclude=kubelet kubeadm kubectl

rpm-package-key.gpg is an absolute path. Download the file from the external source, then install the packages with sudo dnf install -y kubelet kubeadm kubectl --disableexcludes=kubernetes.

The installation is now complete.