- A ResourceQuota named
<release-name>-resource-quota. It caps the number of Pods in the namespace, and the total CPU, memory, and ephemeral storage that those Pods can request and use. - A LimitRange named
<release-name>-limit-range. It caps the size of any single Pod, and gives a default CPU and memory size to containers that don’t declare one.
Operator-mode Deployments get a ResourceQuota and LimitRange starting in APC 2.2. The rule that combines your configured quota values with the calculated quota, and the calculated ephemeral storage quota, also start in 2.2. For the behavior of APC 2.0 and 2.1, see Behavior in earlier versions.
How the quota affects a Deployment
The ResourceQuota applies to every Pod in the Deployment’s namespace, not only to Airflow components. It counts:- The Airflow components: the scheduler, webserver or API server, triggerer, Dag processor, Celery workers, StatsD, PgBouncer, Redis, and Flower.
- Pods that
KubernetesPodOperatortasks start in the Deployment’s namespace. - Kubernetes executor task Pods.
- Any other workload that runs in the namespace, for example in a pre-created namespace.
FailedCreate event whose message contains exceeded quota. Running Pods aren’t affected.
Kubernetes counts each resource as follows:
- CPU and memory: Every container must declare a CPU and memory request and limit. The LimitRange gives a default to containers that declare none. See Configure the limit range.
- Ephemeral storage: A container that doesn’t declare ephemeral storage counts as zero.
- Requests and limits: APC sets
requests.<resource>andlimits.<resource>to the same value.
How APC calculates the quota
APC calculates a value for each quota key from the components the Deployment runs, called the calculated quota.
The calculation follows these rules:
- Components: APC counts the components of the Deployment’s executor. It counts the triggerer and Dag processor only when they’re enabled, and it doesn’t count Flower in operator mode.
- Rollout headroom: APC doubles each component’s resources so old and new Pods can run together during a rolling update.
- Worker queues: In a Deployment with worker queues, APC counts each queue at its ceiling. The ceiling is the queue’s maximum worker count when the queue can autoscale, and its fixed worker count otherwise. APC sums every queue’s ceiling, because all queues can reach it at the same time.
- Sidecar allowance: APC adds a fixed allowance for the sidecar containers and jobs it runs beside the Airflow components, such as log groomers and metrics exporters. It also adds the resources of the authentication sidecar, logging sidecar, Dag deploy server, and Airflow database cleanup job when enabled. The allowance is sized from
resourceManagement.sidecarsandresourceManagement.astroUnit. - Ephemeral storage: APC reads each container’s ephemeral storage from the larger of its request and its limit. It counts each component’s main container and the containers APC runs beside it: the log groomer, metrics exporter, logging sidecar, Dag downloader, authentication sidecar, and any extra containers in the component’s Helm configuration. Only the main containers have ephemeral storage by default, so the sidecars count only when you give them some. In a Deployment with worker queues, APC counts the worker sidecars on every worker Pod.
How configured values combine with the calculated quota
You can configure a quota value in two places: thehelm.airflow.quotas configuration, which you can set at the platform, cluster, Workspace, or Deployment tier, and the quotas argument of a single Deployment.
Starting in APC 2.2, APC sets each quota key to the largest of these values:
- The calculated quota.
- The value for that key in
helm.airflow.quotas, after config governance resolves the tiers. - The value for that key in the Deployment’s
quotasargument.
- A configured value can raise a quota but can’t lower it below the calculated quota. A smaller value doesn’t cause Pod refusals; APC uses the calculated quota.
- When a configured value wins, including when it equals the calculated quota, APC writes it exactly as you wrote it. For example,
50Gistays50Gi. - The
pods, CPU, and memory keys always appear in the ResourceQuota. - The ephemeral storage keys appear only when a configured value sets them. APC raises an ephemeral storage limit that’s too small, but it never adds one. The APC Helm chart sets both ephemeral storage keys to
50Giby default, so every Deployment has an ephemeral storage quota of at least 50 GiB by default. - APC ignores a configured value that isn’t a valid Kubernetes quantity, for example
50 Gior4 cores, and uses the calculated quota for that key. The APC API logs a warning that names the key.
limits.ephemeral-storage for one Deployment:
Where you can change the quota
The table lists every setting that changes the ResourceQuota or LimitRange. The Astro CLI can’t set or show quota values. It can change only the executor and the number of triggerer replicas, which change what APC calculates.Raise the quota for a scope with config governance
Sethelm.airflow.quotas to give every Deployment in a scope a minimum quota. Use it to give KubernetesPodOperator Pods and Kubernetes executor task Pods room in an operator-mode Deployment, where Extra Capacity isn’t available, or to keep an ephemeral storage quota larger than the calculated quota.
The keys are the ResourceQuota keys, written as one flat key each, for example limits.cpu. APC combines these keys with the calculated quota:
podsrequests.cpuandlimits.cpurequests.memoryandlimits.memoryrequests.ephemeral-storageandlimits.ephemeral-storage
helm.airflow.quotas, for example count/configmaps, to the ResourceQuota as written without validating it. An invalid value can make the Deployment update fail.
Set the requests and limits for a resource to the same value so the ResourceQuota keeps requests.<resource> equal to limits.<resource>.
- APC UI
- APC API
- Helm values
The cluster, Workspace, and Deployment configuration override editors take YAML that starts at the
deployments level, so omit astronomer, houston, config, and deployments.-
Open the override editor for the scope you want:
- For a cluster, see Override base configuration.
- For a Workspace, go to Workspace Settings > Configuration Overrides.
- For a Deployment, open the Deployment and go to Configuration Overrides.
- Click Edit.
-
Add the quota values, and keep the rest of the editor’s content. For a Workspace or a Deployment, saving replaces the stored override with the editor’s content.
- Save the change, then review and confirm each change in the dialog that appears.
When the change applies
APC recalculates and applies the quota every time a Deployment updates: when you deploy code, change its settings, environment variables, or worker queues, or set itsquotas argument.
- A change at the platform, cluster, or Workspace tier applies to each Deployment the next time that Deployment updates.
- A change at the Deployment tier applies immediately when you use
updateDeploymentConfigwithapplyToDeployment: true. A change that you save in the APC UI applies the next time the Deployment updates.
Raise the quota for one Deployment with the quotas argument
TheupsertDeployment mutation takes a quotas argument, settable only with the APC API, that raises the quota for one Deployment. Unlike helm.airflow.quotas, it nests each resource under requests and limits:
Each request must be less than or equal to its limit. The mutation rejects a
quotas argument that’s missing a required field or that has a value in the wrong format.
quotas argument with the Deployment and uses it on every later update. A later quotas argument replaces the values for the keys it sends and keeps the stored values for the others. You can’t delete a stored quotas argument. To stop it from raising the quota, send "0" for each key you set. APC then uses the calculated quota for those keys.
Give task Pods room with extra capacity
Extra Capacity adds CPU, memory, and Pods to the quota of a Helm-mode Deployment soKubernetesPodOperator Pods and Kubernetes executor task Pods have room to run. It sizes the most those Pods can claim at one time. For more, see Kubernetes executor: Set extra capacity.
APC adds the Extra Capacity CPU and memory to the CPU and memory quota, and adds Pods in proportion to the larger of the two.
Set Extra Capacity in one of these ways:
- In the APC UI, open the Deployment, go to Settings > Execution Environment, and set the Extra Capacity CPU and memory.
- With the APC API, pass
properties: { extra_capacity: { cpu: <millicores>, memory: <mebibytes> } }toupsertDeployment.
- Minimum: the executor’s
defaultExtraCapacity. The default is 1,000 millicores and 3,840 MiB for the Kubernetes executor, and zero for the Celery and Local executors. - Maximum:
resourceManagement.maxExtraCapacity. The default is 40,000 millicores and 153,600 MiB. A Deployment that already stores a larger value keeps that value as its own maximum.
Minimum Extra CPU not met, Minimum Extra Memory not met, Maximum Extra CPU exceeded, or Maximum Extra Memory exceeded.
In operator mode, Extra Capacity is always zero and doesn’t appear in the APC UI. To give task Pods room in an operator-mode Deployment, set a minimum quota with helm.airflow.quotas or the quotas argument.
Change what APC calculates
Change any of these to change the calculated quota:- Component CPU, memory, and replicas: Set them in the Deployment’s Settings or with the APC API. The CPU and memory you set are both the request and the limit. See Customize Deployment CPU and memory resources.
- Worker queues: Each queue counts its CPU, memory, and ephemeral storage per worker, multiplied by its ceiling. A queue’s ephemeral storage defaults to 2,048 MiB. See Configure worker queues.
- Executor: The executor decides which components run. Change it in the Deployment’s Settings, with the APC API, or with the
--executorflag ofastro deployment update. - Deployment mode: Flower and Extra Capacity count only in Helm mode.
- Component ephemeral storage: Set
helm.airflow.<component>.resources.requests.ephemeral-storageandhelm.airflow.<component>.resources.limits.ephemeral-storagewith config governance. The APC Helm chart sets a 1 GiB request and a 2 GiB limit for the scheduler, webserver, API server, and workers. In a Deployment with worker queues, each queue’s own ephemeral storage replaces the worker value. - Sidecar ephemeral storage: Ephemeral storage that you set on a sidecar adds to its component’s Pods. The sidecars read it from
helm.airflow.<component>.logGroomerSidecar.resources,helm.airflow.pgbouncer.metricsExporterSidecar.resources,helm.airflow.<component>.extraContainers,logging.loggingSidecar.resources,dagDeploy.client.resources, andauthSideCar.resources. - Git-sync ephemeral storage: In a Helm-mode Deployment that uses git-sync, Ephemeral Storage Overwrite Gigabytes on the DAG Deployment card, or
dagDeployment.ephemeralStorageinupsertDeployment, raises the scheduler and worker ephemeral storage. The range is 2 to 10 GiB. - Optional features: Enabling the authentication sidecar, logging sidecar, Dag-only deploys, or Airflow database cleanup adds their resources to the CPU and memory quota.
Configure the limit range
APC builds the LimitRange from two settings:
The LimitRange doesn’t set ephemeral storage.
You can set both settings at any config governance tier.
maxPodCapacity also caps the CPU and memory of a worker queue, and APC checks the scheduler and webserver limits against it. astroUnit also sizes the sidecar allowance in the quota and the default PgBouncer connection pool sizes.
helm.airflow.limits.
Turn off quota and limit range management
SetresourceManagement.resourceQuotas.enabled to false to stop APC from managing the ResourceQuota and LimitRange. You can set it at any config governance tier, so you can turn management off for the platform, a cluster, a Workspace, or a single Deployment.
maxPodCapacity for those Deployments.
APC 2.x doesn’t read the APC 1.x setting disableManageResourceQuotasAndLimitRanges. The upgrade to 2.x converts it to resourceManagement.resourceQuotas.enabled. If you still have disableManageResourceQuotasAndLimitRanges in your Helm values, APC ignores it and manages quotas. See Upgrade to Astro Private Cloud 2.0 from 1.x.
If you use namespace pools and create the namespace RBAC yourself, grant the data plane internal API the create, delete, get, list, patch, and watch verbs on resourcequotas and limitranges in each namespace. Without them, APC can’t apply or remove the objects.
View the quota
APC shows the quota in these places:- APC UI: Open the Deployment and go to Metrics. The Usage Quotas card shows Pods Usage, CPU Usage, and Memory Usage as a share of the quota. It doesn’t show ephemeral storage.
-
Kubernetes: Read the objects in the Deployment’s namespace:
The Kubernetes API server rewrites quantities in canonical form, so
51200Miappears as50Gi. -
APC API: The
effectiveConfigfield of a Deployment shows the resolvedhelm.airflow.quotasandresourceManagementvalues. Theconfigfield shows the storedquotasargument, andpropertiesshowsextra_capacity. See Effective configuration. -
Alerts: The
AirflowPodQuotaalert fires when a Deployment uses more than 95% of its Pod quota for 10 minutes. TheKubeQuotaExceededalert fires when a namespace uses more than 90% of any quota value for 15 minutes. See Platform and deployment alerts.
Permissions
A custom role can change a setting if it has the listed permission.
None of the settings on this page are blocklisted at the Workspace or Deployment tier. Anyone who can set a Workspace or Deployment configuration override can raise the quota for that scope or turn quota management off for it.
Troubleshoot
Kubernetes refuses a Pod with exceeded quota
Find the event in the Deployment’s namespace:KubernetesPodOperator Pods or workloads you run in the namespace yourself. Raise the quota with Extra Capacity in Helm mode, or with helm.airflow.quotas or the quotas argument in either mode.
Kubernetes refuses a Pod that’s larger than the maximum Pod size
The message says the maximum usage per Pod is lower than the Pod’s limit, meaning the Pod is larger thanresourceManagement.maxPodCapacity. Make the Pod smaller, or raise maxPodCapacity as described in Configure the limit range.
A configured quota value has no effect
Check the following:- The value is smaller than the calculated quota. APC uses the larger value.
- The value isn’t a valid Kubernetes quantity. Check the APC API logs for a warning that names the key.
- The Deployment hasn’t updated since you saved the change. See When the change applies.
- In
helm.airflow.quotas, the key is nested instead of flat. Writelimits.cpu: "40", notlimits: { cpu: "40" }.
Pods stay in the Pending state
The quota admitted the Pods, but no node has enough free CPU, memory, or ephemeral storage. Runkubectl describe pod <pod-name> -n <namespace> to see the scheduler’s reason.
Behavior in earlier versions
In APC 2.0 and 2.1:- Operator-mode Deployments have no ResourceQuota or LimitRange.
- The ephemeral storage quota is the configured
helm.airflow.quotasvalue,50Giby default, whatever the Deployment’s components need. - APC ignores
pods, CPU, and memory values inhelm.airflow.quotasand uses the calculated quota. - The
quotasargument replaces the calculatedpods, CPU, and memory quota, even when it’s smaller. APC ignores its ephemeral storage keys.
helm.airflow.quotas, and the quotas argument, in both Helm and operator mode, and operator-mode Deployments get both objects.