In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Server role assignment role address installation components master192.168.142.220kube-apiserver kube-controller-manager kube-scheduler etcdnode1192.168.142.136kubelet kube-proxy docker flannel etcdnode2192.168.142.132kubelet kube-proxy docker flannel etcd I, Kubelet, proxy deployment preparation
All operations before the delimiter are performed in master, followed by node nodes
Mobile control command [root@master bin] # pwd/k8s/kubernetes/server/bin//node2 address [root@master bin] # scp-p kubelet kube-proxy root@192.168.142.132:/opt/kubernetes/bin///node1 address [root@master bin] # scp-p kubelet kube-proxy root@192.168.142.136:/opt/kubernetes/bin/ establish boot file to guide kubelet to automatically issue certificates
Create bootstrap.kubeconfig (must-have! )
/ / specify api entry Refer to yourself (apiserver must be installed) [root@master kubernetes] # export KUBE_APISERVER= "https://192.168.142.220:6443"// setup Cluster [root@master kubernetes] # / opt/kubernetes/bin/kubectl config set-cluster kubernetes\-- certificate-authority=/opt/kubernetes/ssl/ca.pem\-- embed-certs=true\-- server=$ {KUBE_APISERVER}\-- kubeconfig=/k8s/kubeconfig/bootstrap.kubeconfig// sets client authentication [ Root@master kubernetes] # / opt/kubernetes/bin/kubectl config set-credentials kubelet-bootstrap\-- token=$ {BOOTSTRAP_TOKEN}\-- kubeconfig=/k8s/kubeconfig/bootstrap.kubeconfig// setting context parameter [root@master kubernetes] # / opt/kubernetes/bin/kubectl config set-context default\-cluster=kubernetes\-user=kubelet-bootstrap\-kubeconfig=/k8s/kubeconfig/bootstrap.kubeconfig// setting default context [root@master kubernetes] # / opt/kubernetes/bin/ Kubectl config use-context default\-- kubeconfig=/k8s/kubeconfig/bootstrap.kubeconfig
Create a kube-proxy kubeconfig file
/ / set cluster [root@master kubernetes] # / opt/kubernetes/bin/kubectl config set-cluster kubernetes\-- certificate-authority=/opt/etcd/ssl/ca.pem\-- embed-certs=true\-- server=$ {KUBE_APISERVER}\-- kubeconfig=/k8s/kubeconfig/kube-proxy.kubeconfig// set client authentication [root@master kubernetes] # / opt/kubernetes/bin/kubectl config set-credentials kube-proxy\-- client-certificate=/opt/kubernetes/ssl/kube- Proxy.pem\-- client-key=/opt/kubernetes/ssl/kube-proxy-key.pem\-- embed-certs=true\-- kubeconfig=/k8s/kubeconfig/kube-proxy.kubeconfig// setting context parameter [root@master kubernetes] # / opt/kubernetes/bin/kubectl config set-context default\-cluster=kubernetes\-- user=kube-proxy\-- kubeconfig=/k8s/kubeconfig/kube-proxy.kubeconfig// setting default context [root@master kubernetes] # / opt/kubernetes/bin / kubectl config use-context default\-- kubeconfig=/k8s/kubeconfig/kube-proxy.kubeconfig
Push the kubeconfig file
[root@master kubeconfig] # scp bootstrap.kubeconfig kube-proxy.kubeconfig root@192.168.142.132:/opt/kubernetes/cfg/ [root@master kubeconfig] # scp bootstrap.kubeconfig kube-proxy.kubeconfig root@192.168.142.136:/opt/kubernetes/cfg/
Write kubectl to the environment variable
[root@master kubeconfig] # echo "export PATH=\ $PATH:/opt/kubernetes/bin/" > > / etc/profile [root@master kubeconfig] # source / etc/profile create bootstrap role permission for apiserver request signature
The most important thing! There is no basic end)
[root@master kubeconfig] # kubectl create clusterrolebinding kubelet-bootstrap\-- clusterrole=system:node-bootstrapper\-- user=kubelet-bootstrapnode side (all nodes have different addresses, all remaining steps are the same) install Kubelet
Specify node nodes IP and DNS as global variables (different node node variables need to be changed)
You can also change it directly in the configuration file without setting the variable.
[root@node1 bin] # export NODE_ADDRESS= "192.168.142.136" [root@node1 bin] # export DNS_SERVER_IP= "192.168.142.2"
Create a kubelet profile
[root@node1 ~] # cat
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.