Limits

Let's inspect our new namespace a bit more. Run the describe command as follows:

$ kubectl describe namespace/test

The following screenshot is the result of the preceding command:

The describe namespace

Kubernetes allows you to both limit the resources used by individual pods or containers and the resources used by the overall namespace using quotas. You'll note that there are no resource limits or quotas currently set on the test namespace.

Suppose we want to limit the footprint of this new namespace; we can set quotas as shown in the following listing quota.yaml:

apiVersion: v1 kind: ResourceQuota metadata:   name: test-quotas  namespace: ...

Get Getting Started with Kubernetes - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.