kubernetes-3 binary install k8s

Install kubernetes in binary

xxxxxxxxxxxxxxxxxx is omitted here, the blogger is still testing the installation notes. Flannel encounters some problems, please make up if you solve it

Comparison of kubeadm and binary mode

Here is a comparison of different installation methods of k8s on a single node

Install k8s cluster in kubeadm mode

1 Install virtual machines, 3 virtual machines with Linux operating system
2 Initialize the operating system and build the environment
3 Install Docker, kubeadm, kubelet, kubectl on all nodes (master and node)

  • 1) Modify the docker warehouse address, and modify the yum source address to the Alibaba Cloud address;
  • 2) Install docker, use yum to install, and install the latest docker version by default if the version is not specified;
  • 3) Install kubeadm, kubelet and kubectl
    • k8s has released the latest version, you can specify to install the latest version
    • yum -y install kubelet-xxx kubectl-xxx kubadm-xxx

4Execute the initialization command on the master node

  • kubeadm init
  • The mirror address k8s.gcr.io is pulled by default and needs to be modified to use the domestic address

5 On all the node nodes, use the join command to add the node to the master node.
6 Install the network plug-in (CNI)

  • kubectl apply -f kube-flannel.yml

7 Test kubernetes cluster

  • kubectl get node
  • kubectl get pod -n kube-system

Install K8s cluster in binary mode

1 Install the virtual machine, install 3 Linux operating system virtual machines
2 Initialize the operating system and deploy the basic environment
3 Generate the cfssl self-signed certificate and copy it to the corresponding node

  • ca.pem、ca-key.pem、admin.pem、admin-key.pem、kubelet-key.pem、kubelet.pem、kube-controller-manager-key.pem、kube-controller-manager.pem、kube-proxy.pem、kube-proxy-key.pem、scheduler.pem、scheduler-key.pem、kube-apiserver.pem、kube-apiserver-key.pem、service-account-key.pem
    service-account.pem
  • Download the kubectl binary package, and generate kubelet.kubeconfig, kube-proxy.kubeconfig, kube-controller-manager.kubeconfig, kube-scheduler.kubeconfig, admin.kubeconfig through kubectl

4 Deploy etcd cluster

  • The essence of deployment is to hand over the etcd cluster to systemd management
  • Create etcd.service file, start, set boot

5 Set up encryption configuration for cluster communication through base64 algorithm
6 Deploy the master component, authorize kubelet, and bind roles

  • kube-apiserver, controller-manager, scheduler are handed over to systemd for management, and set to boot
  • Check the status of each component
    kubectl get componentstatuses --kubeconfig admin.kubeconfig

7 Deploy node components

  • Docker, kubelet, and kube-proxy are handed over to systemd for management, and set to boot

8 Deploy and install CNI plug-in

  • The common ones are flannel calico weave

9 Test kubernetes cluster

  • Install nginx test access

Friends who have seen more are welcome to leave their valuable comments! Yuanchao must be very grateful! ! !

Guess you like

Origin blog.csdn.net/qq_51574197/article/details/115192066