Update Resource Limits of a Project

This guide describes how to change the resource limits of a single Project in a APPUiO Zone.

Prerequisites

  • Administrator access to the APPUiO Zone

Change Resource Quota of a Namespace

By default in a namespace there are three different ResourceQuotas.

organization-compute

Limits for pods and their resource usage.

organization-compute-terminating

Limits for terminating resources, such as jobs.

organization-objects

Limits the number of objects, such as configmaps or services.

You can update the defaults of any of these ResourceQuotas by setting an annotation on the Namespace. The annotation need to have the following structure

resourcequota.appuio.io/<resourceQuotaName>.<resource>

The resourceQuotaName is the name of one of the three ResourceQuotas and resource is the specific field of the quota you want to update.

For resources containing a forward slash, you will need to substitute it for an underline. For example: resourcequota.appuio.io/organization-objects.openshift.io_imagestreams: "40".

Based on how Kyverno implements policies which generate resources, it may take a few minutes for overrides to be applied in the actual ResourceQuota or LimitRange object.

Examples

Update the allowed number of pods in the namespace restless-wave to 100
kubectl --as=cluster-admin annotate namespace restless-wave \
  resourcequota.appuio.io/organization-compute.pods=100
Update the limit of CPU requests for terminating pods to 7
kubectl --as=cluster-admin annotate namespace restless-wave \
  resourcequota.appuio.io/organization-compute-terminating.requests.cpu=7
Update the limit of allowed configmaps to 300
kubectl --as=cluster-admin annotate namespace restless-wave \
  resourcequota.appuio.io/organization-objects.count_configmaps=300
Update the CephFS storage quota to 50Gi
kubectl --as=cluster-admin annotate namespace restless-wave \
  resourcequota.appuio.io/organization-objects.storageclasses='{"cephfs-fspool-cluster.storageclass.storage.k8s.io/requests.storage": "50Gi"}'

Please make sure to extend the existing annotation value (for example with kubectl edit ns), if you want to customize the storage quota for multiple storageclasses.