Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there issues with running user pods on a Kubernetes master node?

Tags:

kubernetes

Many of the run-throughs for deploying Kubernetes master nodes suggest you use --register-schedulable=false to prevent user pods being scheduled to the master node (e.g. https://coreos.com/kubernetes/docs/latest/deploy-master.html). On a very small Kubernetes cluster it seems somewhat a wasteful of compute resources to effectively prevent an entire node from being used for pod scheduling unless absolutely essential.

The answer to this question (Will (can) Kubernetes run Docker containers on the master node(s)?) suggests that it is indeed possible to run user pods on a master node - but doesn't address whether there are any issues associated with allowing this.

The only information that I've been able to find to date that suggests there might be issues associated with allowing this is that it appears that pods on master nodes communicate insecurely (see http://kubernetes.io/docs/admin/master-node-communication/ and https://github.com/kubernetes/kubernetes/issues/13598). I assume that this would potentially allow a rogue pod running on a master node to access/hijack Kubernetes functionality not normally accessible to pods on non-master nodes. Probably not a big deal with if only running pods/containers developed internally - although I guess there's always the possibility of someone hacking access to a pod/container and thereby gaining access to the master node.

Does this sound like a viable potential risk associated with this scenario (allowing user pods to run on a Kubernetes master node)? Are there any other potential issues associated with such a setup?

like image 258
Michael Avatar asked Jun 17 '16 04:06

Michael


People also ask

Can we run pods on master node?

By deafult, only worker node could run the pod, master only response for the scheduler/configuration. However, you could disable the “NoSchedule” property so master node could run pod as well.

Is it possible to deploy pod in master?

If you specifically want to deploy your pod on a specific node, use labels. Example, give your master node a label say dedicated=master and set nodeSelector for your pod to look for this label.

Why are pods not scheduled on master nodes?

Security pods are not scheduled since the master nodes do not meet the required memory or CPU requirements. The output has the information about memory and CPU requirements. If the resource requirement is not met, increase the master node's memory or CPU.

What runs on Kubernetes master node?

What is Master Node in Kubernetes? A master node is a node which controls and manages a set of worker nodes (workloads runtime) and resembles a cluster in Kubernetes. A master node has the following components to help manage worker nodes: Kube-APIServer, which acts as the frontend to the cluster.


1 Answers

Running pods on the master node is definitely possible.

The security risk you mention is one issue, but if you configure service accounts, it isn't actually much different for all deployed pods to have secure remote access to the apiserver vs. insecure local access.

Another issue is resource contention. If you run a rogue pod on your master node that disrupts the master components, it can destabilize your entire cluster. Clearly this is a concern for production deployments, but if you are looking to maximize utilization of a small number of nodes in a development / experimentation environment, then it should be fine to run a couple of extra pods on the master.

Finally, you need to make sure the master node has a sufficiently large pod cidr allocated to it. In some deployments, the master only gets a /30 which isn't going to allow you to run very many pods.

like image 66
Robert Bailey Avatar answered Nov 15 '22 16:11

Robert Bailey