Skip to main content
Version: main 🚧

Configure CPU and memory limits for vCluster

Error message​

When using quota limits in your vCluster project, you might encounter this error:

FailedCreate
create Pod vclusterpod-0 in StatefulSet vclusterpod failed error: admission webhook "quota.loft.sh" denied the request: pods "vclusterpod-0" is forbidden: failed quota: project-quota-test: must specify limits.cpu

This error occurs when the vCluster pod doesn't have CPU limits specified while running in a namespace with resource quotas.

Solution​

You can configure CPU and memory limits for vCluster using either the Platform UI or CLI.

Configure limits using the platform UI​

  1. Log in to the vCluster platform.

    Access your platform dashboard.

  2. Start the vCluster creation process.

    Click Create vCluster.

  3. Configure resource limits.

    In vcluster.yaml, add the following configuration and modify values as needed:

    controlPlane:
    statefulSet:
    resources:
    limits:
    cpu: "1"
    memory: "2Gi"
  4. Create the vCluster.

    Complete the creation process by clicking .

Configure limits using the vCluster CLI​

  1. Create a configuration file.

    Create a file named values.yaml with the following content and edit values as needed:

    controlPlane:
    statefulSet:
    resources:
    limits:
    cpu: "1"
    memory: "2Gi"
  2. Deploy the vCluster with the configuration.

    Use the vCluster CLI to create a new vCluster with the limits:

    vcluster create my-vcluster --values values.yaml

Verify the configuration​

Since vCluster is deployed as a StatefulSet, verify the resource limits with the following:

kubectl get statefulset -n <vc-namespace> <vc-name> -o jsonpath="{.spec.template.spec.containers[*].resources.limits}"

This command displays the configured CPU and memory limits for your vCluster.

Additional resources​