kubernetes:如何确保没有用户pod在master上运行 [英] kubernetes: how to make sure that no user pods are run on master
问题描述
我目前正在Kubernetes用于我们的登台环境-由于它只是一个很小的环境,因此我只在master
和在其中运行我的应用程序Pod时使用一个节点.
I'm currently using Kubernetes for our staging environment - and because it is only a small one, I'm only using one node for master
and for running my application pods on there.
当我们切换到生产环境时,将有一个以上的节点-至少一个用于主节点,一个更大的节点用于应用程序pod.我是否必须确保我所有的Pod都在与master
不同的节点上运行,还是Kubernetes会自动进行处理?
When we switch over to production, there will be more than one node - at least one for master and one bigger node for the application pods. Do I have to make sure that all my pods are running on a different node than master
or does Kubernetes take care of that automagically?
推荐答案
如果查看kubectl get nodes
的输出,则会看到类似以下内容的
If you look at the output of kubectl get nodes
, you'll see something like:
~ kubectl get nodes
NAME STATUS AGE VERSION
test-master Ready,SchedulingDisabled 23h v1.6.0-alpha.0.1862+59cfdfb8dba60e
test-minion-group-f635 Ready 23h v1.6.0-alpha.0.1862+59cfdfb8dba60e
test-minion-group-fzu7 Ready 23h v1.6.0-alpha.0.1862+59cfdfb8dba60e
test-minion-group-vc1p Ready 23h v1.6.0-alpha.0.1862+59cfdfb8dba60e
SchedulingDisabled
标记可确保我们不在该节点上调度任何Pod,并且默认情况下,每个HA主节点都应具有该节点.
The SchedulingDisabled
tag ensures that we do not schedule any pods onto that node, and each of your HA master nodes should have that by default.
也可以通过使用 kubectl将其他节点设置为SchedulingDisabled
警戒线.
It is possible to set other nodes to SchedulingDisabled
as well by using kubectl cordon.
这篇关于kubernetes:如何确保没有用户pod在master上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!