Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up the Master node of Kubernetes to run the application pod

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to set Kubernetes's Master node to run the application pod", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to set Kubernetes's Master node to run the application pod" this article.

Using kubeadm to deploy highly available Kubernetes 1.17.0 set up three Master nodes, and then during the deployment of Heketi, it was found that Daemonset did not start the corresponding pod. Originally, you need to set the Master node of Kubernetes to participate in the application scheduling (the default installation of the Master node does not run the application). There are two ways:

Change the attributes of the node for a long time to allow Master to run the application and execute:

Kubectl taint nodes-all node-role.kubernetes.io/master-

Temporarily allow the Master node to execute the application, adding to the application's yaml file:

Tolerations:-key: node-role.kubernetes.io/master effect: NoSchedule

I use this test here:

ApiVersion: apps/v1kind: DaemonSetmetadata: name: fluentd-elasticsearch namespace: test labels: k8s-app: fluentd-loggingspec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: tolerations:-key: node-role.kubernetes.io/master effect: NoSchedule containers:-name: fluentd-elasticsearch image: quay.io/fluentd_elasticsearch/fluentd : v2.5.2 resources: limits: memory: 200Mi requests: cpu: 100m memory: 200Mi volumeMounts:-name: varlog mountPath: / var/log-name: varlibdockercontainers mountPath: / var/lib/docker/containers readOnly: true terminationGracePeriodSeconds: 30 volumes:-name: varlog HostPath: path: / var/log-name: varlibdockercontainers hostPath: path: / var/lib/docker/containers

Then save it as test.yaml, run: kubectl apply-f test.yaml,pod is set up.

If there is no setting for tolerations, although it runs successfully, pod only runs on the worker node, and if there is only the master node, pod will not be started.

The above is all the contents of the article "how to set up the Master node of Kubernetes to run the application pod". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report