1 Version and planning1.1 Version information:
1.2 Cluster Planning
2. Deployment
1. Turn off the firewall To shut down: Permanently disable: 2. Turn off selinux To turn off: 3. Turn off swap Temporary shutdown: Permanently disable: Verify: 4. Add the correspondence between host name and IP Add the mapping relationship in 192.168.0.114 k8s-master 192.168.0.115 k8s-node01 192.168.0.116 k8s-node02 5. Pass the bridged IPV4 traffic to the iptables chainAdd the configuration using the following command: cat > /etc/sysctl.d/k8s.conf << EOF net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF Run 6. Install docker installation:wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo yum install docker-ce Set up automatic startup systemctl start docker systemctl enable docker Check the version: Question: Use the command Solution 1: { "exec-opts": ["native.cgroupdriver=systemd"] } Solution 2: You can also modify #docker.service vi /usr/lib/systemd/system/docker.service # Add ExecStart=/usr/bin/dockerd --exec-opt native.cgroupdriver=systemd 7. Add Alibaba Cloud yum software sourcecat > /etc/yum.repos.d/kubernetes.repo << EOF [Kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF Potential pitfalls (skip here for now, come back later if you encounter them) Problem: During the installation process, it may prompt that Solution 1: After importing the public key, reinstall it again wget https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg wget https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg rpm --import yum-key.gpg rpm --import rpm-package-key.gpg Solution 2: Configure 8. Install kubeadm, kubelet, and kubectl Installation: Or install the latest version: Set to start automatically: 9. Initialize the master nodeInitialization Command kubeadm init \ --image-repository registry.aliyuncs.com/google_containers \ --kubernetes-version v1.23.0 \ --service-cidr=10.1.0.0/16 \ --pod-network-cidr=10.244.0.0/16 Parameter Description If the installation fails, you need to clean up the environment using the Pitfalls encountered: Problem: Initialization is successful If the following result appears, it means that the initialization is successful According to the prompt, execute the following command mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config # The first command: indicates the creation of a hidden folder .kube # The second command: means copying the file admin.conf to this folder # The third command: means setting the user and user group to which the file belongs After executing the above commands, you can use the 10. Install pod network plugin (CNI)GitHub address: https://github.com/flannel-io/flannel, you can also download the file directly Install the plugin: kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml Pitfalls encountered Problem: The connection to the server Check whether the deployment is successful: Check the node again and the status changes to ready 11. Node joins the cluster To add a new node to the cluster, just copy kubeadm join 192.168.0.114:6443 --token whxbm2.x70y9k1feop2604b \ --discovery-token-ca-cert-hash sha256:d4306836b7ef32fd802e559cf717bbbe3af6dd75d3cb2fa4d3db7a16cc25a657 After successfully joining, use the command This is the end of this article about the detailed introduction of centos7 system deployment of k8s cluster. For more relevant centos7 deployment of k8s cluster content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of the use of Datetime and Timestamp in MySQL
>>: 17 excellent web designs carefully crafted by startups
Detailed explanation of mysql count The count fun...
This article example shares the specific code of ...
Principle: First hide the input element, then use...
Recently, due to the increase in buttons in the b...
The large-screen digital scrolling effect comes f...
1. Usage of instanceof instanceof operator is use...
<button> tag <br />Definition and usag...
Table of contents environment: 1. Docker enables ...
When building a website, HTML language may seem un...
This article shares the specific code for impleme...
1 Introduction After "Maven deploys Springbo...
Achieve results Implementation Code html <div ...
Get the current time: select current_timestamp; O...
Traditionally, developers create properties in Ja...
Configuring Alibaba Cloud Docker Container Servic...