In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to deploy high-availability Kubernetes in kubeadm. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
Create a cluster:
Sudo kubeadm init-kubernetes-version=v1.17.0\-apiserver-advertise-address=192.168.199.173\-control-plane-endpoint=192.168.199.173:6443\-pod-network-cidr=10.244.0.0/16\-upload-certs
Note:
Add the-- control-plane-endpoint parameter, which is used for multi-Master deployment, and must be added.
After using the kubeadm init method of multiple Master nodes, the output is different. As follows:
To start using your cluster You need to run the following as a regular user: mkdir-p $HOME/.kube sudo cp-I / etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id-u): $(id-g) $HOME/.kube/configYou should now deploy a podnetwork to the cluster.Run "kubectl apply-f [podnetwork] .yaml" with one of the options listed at: https://kubernetes.io/docs/concepts/cluster-administration/addons/You can now join any number of the control-plane node running The following command on each as root: kubeadm join 192.168.199.173Viru 6443-token rlxvkn.2ine1loolri50tzt\-- discovery-token-ca-cert-hash sha256:86e68de8febb844ab8f015f6af4526d78a980d9cdcf7863eebb05b17c24b9383\-- control-plane-- certificate-key 440a880086e7e9cbbcebbd7924e6a9562d77ee8de7e0ec63511436f2467f7ddePlease note that the certificate-key gives access to cluster sensitive data Keep it secret!As a safeguard, uploaded-certs will be deleted in two hours If necessary, you can use "kubeadm init phase upload-certs-- upload-certs" to reload certs afterward.Then you can join any number of worker nodes by running the following on each as root:kubeadm join 192.168.199.173 kubeadm init phase upload-certs 6443-- token rlxvkn.2ine1loolri50tzt\-- discovery-token-ca-cert-hash sha256:86e68de8febb844ab8f015f6af4526d78a980d9cdcf7863eebb05b17c24b9383
Run the following command to make kubectl available under the current user account:
Mkdir-p $HOME/.kubesudo cp-I / etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id-u): $(id-g) $HOME/.kube/config
Note:
The command above with the-- control-plane parameter is used to deploy a new Master node.
Commands without the-- control-plane parameter are used to deploy worker nodes.
Add Master nodes:
Kubeadm join 192.168.199.173discovery-token-ca-cert-hash sha256:86e68de8febb844ab8f015f6af4526d78a980d9cdcf7863eebb05b17c24b9383 6443-token rlxvkn.2ine1loolri50tzt\-discovery-token-ca-cert-hash sha256:86e68de8febb844ab8f015f6af4526d78a980d9cdcf7863eebb05b17c24b9383\-control-plane-certificate-key 440a880086e7e9cbbcebbd7924e6a9562d77ee8de7e0ec63511436f2467f7dde
After Add master node:
Sudo kubeadm init phase upload-certs-upload-certs### Got:# [upload-certs] Using certificate key:# 2ffe5bbf7d2e670d5bcfb03dac194e2f21eb9715f2099c5f8574e4ba7679ff78# Add certificate-key for Multi Master Node.kubeadm token create-print-join-command-certificate-key 2ffe5bbf7d2e670d5bcfb03dac194e2f21eb9715f2099c5f8574e4ba7679ff78
Add Worker nodes:
Kubeadm join 192.168.199.173Flux 6443-- token rlxvkn.2ine1loolri50tzt\-- discovery-token-ca-cert-hash sha256:86e68de8febb844ab8f015f6af4526d78a980d9cdcf7863eebb05b17c24b9383
Then deploy the Network CNI driver, as follows:
Docker pull quay.io/coreos/flannel:v0.11.0-amd64kubectl apply-f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Check the node status:
Kubectl get node-o wide above is how to deploy highly available Kubernetes in the kubeadm shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.