Every Deployment within your Astro Private Cloud installation requires an individual Kubernetes namespace. You can configure a pool of pre-created namespaces to limit Astro Private Cloud access to these namespaces.
When you configure a pool of pre-created namespaces, Astronomer users are required to select a namespace from the pool whenever they create a new Deployment. Once the Deployment is created, Astro Private Cloud marks its corresponding namespace as unavailable. If a Deployment is deleted, its namespace is returned to the pool and is available.
A pre-created namespace pool provides the following benefits:
When a user creates a new Deployment with the UI or CLI, Astro Private Cloud creates the necessary Airflow components and isolates them in a dedicated Kubernetes namespace. These Airflow components depend on Kubernetes resources, some of which are stored as secrets.
To protect your Deployment Kubernetes secrets, Astronomer uses dedicated service accounts for parts of your Deployment that need to interact with external components. To enable this interaction, Astro Private Cloud needs extensive cluster-level permissions for all namespaces running in a cluster.
In Kubernetes, you can grant service account permissions for an entire cluster, or you can grant permissions for existing namespaces. Astronomer uses cluster-level permissions because, by default, the amount of Deployments to manage is unknown. This level of permissions is appropriate when Astro Private Cloud runs in its own dedicated cluster, but it poses security risks when other applications share the cluster.
For example, consider the Astronomer Commander service, which controls creating, updating, and deleting Deployments. By default, Commander has permissions to interact with secrets, roles, and service accounts for all applications in your cluster. The only way to mitigate this risk is by implementing pre-created namespaces.
To create a namespace pool you have the following options:
values.yaml file must be done for the data plane(s) and namespaces must be created in the data plane cluster(s). Each data plane can have their dedicated namespaces.values.yaml file:values.yaml file and update your Astro Private Cloud. See Apply a config change.Based on the namespace names that you specified, Astronomer creates the necessary namespaces and Kubernetes resources. These resources have permissions scoped appropriately for most use-cases.
Once you apply your configuration, you should be able to create new Deployments using a namespace from your pre-created namespace pool. You should also be able to see the namespaces you specified inside your cluster resources.
Complete this setup if you want to further limit the namespace permissions that Astronomer provides by default.
For every namespace you want to add to a pool, you must create a namespace, role, and rolebinding for Astro Private Cloud to access the namespace with. The rolebinding must be scoped to the astronomer-commander service account and the namespace you are creating.
Create a new manifest file for each namespace you want to add to the pool. Replace <your-namespace-name> with the name of the namespace.
Save this file and name it <your-namespace-name>.yaml.
For each namespace you will configure in global.features.namespacePools.namespaces.names, run kubectl apply -f <your-namespace-name>.yaml.
Set the following values in your values.yaml file, making sure to specify all of the namespaces you created in the namespaces.names object:
Save the changes in your values.yaml and update Astro Private Cloud. See Apply a config change.
After you enable the pre-created namespace pool, the UI shows the namespaces you registered as options when you create a new Deployment.

When you create Deployments with the CLI, you are prompted to select one of the available namespaces for your new Deployment.
If no namespaces are available, the UI and CLI show an error message when you try to create a Deployment. Delete the Deployment associated with the namespace to return the namespace to the pool.
If your namespace configurations require more granularity, use the following settings in your values.yaml file.
Mixing global and advanced settings might result in unexpected behavior. If you use the standard settings, Astronomer recommends that you set global.features.namespacePools.enabled to false.
When using these settings, Astronomer recommends enabling hard deletion for Deployments.
In the following example values.yaml file, these settings are configured so that you don’t configure namespace pools at a global level:
If a Deployment isn’t active, check the Commander Pods to confirm they executed the Deployment commands successfully. When using a pre-created namespace pool with scoped roles, it’s possible that the astronomer-commander service account doesn’t have the permissions necessary to perform a required action. When Commander succeeds, it shows the following notification:
When Commander fails, it shows messages like the following:
This error shows that Commander couldn’t create the service accounts in the pre-created namespaces, so you need to update the roles.
If you’re not using hard deletion, it can take several days for pre-created namespaces to become available after the associated Deployment is deleted. To enable hard deletes, see Delete a Deployment.
NFS deploys don’t work if you both use namespace pools and set global.clusterRoles to false in your values.yaml file.