4
votes

A few kubernetes novice questions.

If I got it right when a kubernetes cluster its setup the size ita defined with the number of minions that want to be in the cluster, lets say I create a cluster with two minions. If I decide to deploy 4 pods with a php and nginx serving it.

There its a way I can choose the amount of resources I want to have to each pod?

In old deployments we deploy directly to servers/vm we know the amount of resources of each server/vm. Suppose I have a no functional requirement of 2gb ram 4 cps 160gb hdd.

How can I do that using kubernetes.

Now suppose I have those 4 pods deployed I want to scale up and the new pods need to fulfill the same no functional requirements.

Do I need to resize my cluster or there ita a way kubernetes doit for me?

Thanks.

1

1 Answers

7
votes

See the Compute Resources section of the kubernetes user guide. It describes how to assign cpu and memory limits on your containers and how the scheduler places them in your cluster.

As you scale up the number of pods you are running, the scheduler will attempt to place them in the available space. If there is no way that the pods can be scheduled, then the pods will stay in a pending state until the scheduler can find a place to run them. You may be able to relax some constraints you placed on your pods (host ports, label selectors, etc) or you may need to increase the compute capacity of your cluster by adding additional nodes.

Right now, the cluster will not automatically add new nodes when it is out of capacity. Work to add this functionality, at least for GCE, is now underway (see #11748) but does not exist in v1.0 of Kubernetes. Until that feature is implemented, you will need to manually scale your cluster. If you are running on GCE / GKE, this can be accomplished by resizing the managed instance group that contains the nodes for your cluster. On other cloud providers, you need to clone the node configuration onto a new node so that is has the proper credentials to join the cluster.