In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Kubernetes collaborates with each component through the watch mechanism, and the design between each component is decoupled. Scheduling method nodeName is used to schedule a Pod to the specified Node name, skipping the scheduler and directly assigning it. nodeSelector is used to schedule a Pod to a Node matching the Label, provided that the node has a label.
The operation and maintenance personnel in the upper left corner of the diagram create an nginx resource in the node.API Server and etcd and Scheduler are master.Kubelet and Docker are node nodes.API Server is the only entry point, and the attribute information of the created resource is written into etcd.(Attribute information: name, mirror name, constraint), etcd perfect discovery mechanism (watch) to Scheduler scheduler (Check which node is suitable), then bind the network information of the relevant pod and feed it back to the API Server. After receiving the information, the API writes it into the etcd. At this time, the etcd stores the network information (IP) of the pod. Kubelet in node1 and will manage the pod resources and trigger the container creation command. After the installation is completed, docker will feed back the status information to the API Server. When API Server receives the status information and writes it to etcd.API Server is equivalent to the administrator in the platform, responsible for recording relevant information. etcd is equivalent to the administrator's notepad, in which relevant information is written. If API Server hangs, then k8s is basically paralyzed. Example Demo-nodeName Edit yaml file vim pod5.yamlapiVersion: v1kind: Podmetadata: name: pod-example labels: app: nginxspec: nodeName: 192.168.142.131 #Assign to node1 node containers: - name: nginx image: nginx:1.15 #Verify that nginx creates yaml file kubectl create -f pod5.yamlkubectl get pods View detailed events, kubectl describe pod pod-example Empty pod resources kubectl delete -f .kubectl get pods Example Demo-nodeSelector Get labels Help kubectl label --help Need to get the NAME name on the node kubectl get node set the label for the corresponding node as kgc=a and kgc=bkubectl label nodes 192.168.142.131 kgc=akubectl label nodes www.example.com kgc=b View label kubectl l get nodes --show-labelsvim pod5.yamlapiVersion: v1kind: Podmetadata: name: pod-example labels: 192.168.142.130 app: nginxspec: nodeSelector: kgc: b containers: - name: nginx image: nginx:1.15kubectl apply -f pod5.yaml View detailed events, through which you can observe the pod events kubectl describe pod pod-example Troubleshooting viewing pod events kubectl describe NAME_PREFIX viewing pod logs (Failed state) kubectl logs POD_NAME entering pod (state running, but service not provided) kubectl exec -it POD_NAME bash
Thanks for reading!
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.