---
title: Quotas & Limits
sidebar_label: Quotas & Limits
---

To ensure a vCluster will not consume too many resources in the host cluster, you can use a single [ResourceQuota](https://kubernetes.io/docs/concepts/policy/resource-quotas/) in the namespace where the virtual cluster is running. This could look like:

```yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  name: vcluster-quota
spec:
  hard:
    cpu: "10"
    memory: 20Gi
    pods: "10"
```

This allows the vCluster and all of the pods deployed inside it to only consume up to 10 vCores, 20GB of memory or to have 10 pods at maximum. If you use a resource quota, you probably also want to use a [LimitRange](https://kubernetes.io/docs/concepts/policy/limit-range/) that makes sure that needed resources are defined for each pod. For example:

```yaml
apiVersion: v1
kind: LimitRange
metadata:
  name: vcluster-limit-range
spec:
  limits:
  - default:
      memory: 512Mi
      cpu: "1"
    defaultRequest:
      memory: 128Mi
      cpu: 100m
    type: Container
```

This limit range would ensure that containers that do not set `resources.requests` and `resources.limits` would get appropriate limits set automatically.

