Creating a K8s Cluster
Perform operations in Installing and Configuring K8s on the primary and compute nodes. For details about how to install components and create a cluster, see Configuring the Deployment Environment and Deploying the Cluster Manually in the Kubernetes 1.18.20 Deployment Guide (CentOS & openEuler).
- When you run the kubeadm init command to initialize the primary node, the value of --pod-network-cidr must be the same as that of POD_CIDR in the install.sh file in Deploying Kube-OVN. The default value is 10.16.0.0/16. In this document, the command for initializing the primary node is as follows:
1kubeadm init --pod-network-cidr=10.16.0.0/16 --control-plane-endpoint=192.168.200.10:6443
In the preceding command, 192.168.200.10 is the IP address of the physical network port on the primary node. Replace it with the actual IP address.
- To install the K8s environment, run the following command to set ip_forward to 1:
1echo 1 > /proc/sys/net/ipv4/ip_forward
- Currently, the kubernetes.repo repository used in Kubernetes Deployment Guide is not supported by K8s 1.18 or later. In this document, another repository is used. The repository information is as follows:
cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://mirrors.huaweicloud.com/kubernetes/yum/repos/kubernetes-el7-aarch64/ enabled=1 gpgcheck=1 repo_gpgcheck=0 gpgkey=https://mirrors.huaweicloud.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.huaweicloud.com/kubernetes/yum/doc/rpm-package-key.gpg EOF
- Before installing K8s, configure the local Yum image source. For details, see Configuring the Local Yum Source and the Installation Tool.
- In this document, the K8s components are installed in default mode (without specifying the K8s version). By default, the latest K8s version 1.18.5 is installed. If you need to install the specified version 1.18.2, specify the version number in the installation command.
yum install -y kubelet-1.18.2 kubeadm-1.18.2 kubectl-1.18.2
Parent topic: MGR Deployment Guide