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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.