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.Documentation Index
Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Benefits of pre-created namespaces
A pre-created namespace pool provides the following benefits:- It limits the cluster-level permissions your organization needs to give to Astro Private Cloud. Astro Private Cloud requires permissions only for the individual namespaces you configure. Pre-created namespaces are recommended when your organization does not want to give Astro Private Cloud cluster-level permissions in a multi-tenant cluster.
- It can reduce costs and resource consumption. By default, Astro Private Cloud allows users to create Deployments until there is no more unreserved space in your cluster. If you use a pool, you can limit the number of active Deployments running at a time. This is especially important if you run other Elastic workloads on the same cluster where Astro Private Cloud runs and need to prevent users from accidentally claiming your entire pool of unallocated resources.
Technical DetailsWhen 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.
Setup
To create a namespace pool you have the following options:- Delegate the creation of each namespace, including roles and rolebindings, to the Astronomer Helm chart. This option is suitable for most organizations.
- Create each namespace manually, including roles and rolebindings. This option is suitable if you need to further restrict Astronomer Kubernetes resource permissions. However, using this methodology to limit permissions can prevent Deployments from functioning as expected.
If you have a separate control plane and data plane(s), following changes in the
values.yamlfile 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.Prerequisites
Option 1: Use the Astronomer Helm chart
- Set the following configuration in your
values.yamlfile:
- Save the changes in your
values.yamlfile and update your Astro Private Cloud. See Apply a config change.
Option 2: Manually create namespaces, roles, and rolebindings
Complete this setup if you want to further limit the namespace permissions that Astronomer provides by default.Step 1: Configure namespaces
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. Therolebinding 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, runkubectl apply -f <your-namespace-name>.yaml.
Step 2: Configure a namespace pool in Astronomer
-
Set the following values in your
values.yamlfile, making sure to specify all of the namespaces you created in thenamespaces.namesobject: -
Save the changes in your
values.yamland update Astro Private Cloud. See Apply a config change.
Creating Deployments in pre-created namespaces
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.
Advanced settings
If your namespace configurations require more granularity, use the following settings in yourvalues.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.
| Setting | Description |
|---|---|
global.manualNamespaceNamesEnabled | Expands the Vector Log collector rule to look for Deployment component logs in all namespaces |
global.clusterRoles | When set to false, Astronomer does not create a cluster role for Commander. |
global.rbacEnabled | When set to false, the platform no longer creates any role, rolebindings, or service accounts. The user must define default roles to the k8s default service account to continue with the platform install. See Bring your own Kubernetes service accounts for service account setup steps. |
astronomer.houston.config.deployments.manualNamespaceNames | When set to true, a dropdown field is added to the Astro Private Cloud UI’s Deployment settings for namespace selection. |
astronomer.houston.config.deployments.preCreatedNamespaces | List of namespaces that were manually created for the namespace pool |
astronomer.commander.env | Inject an environment variable for Commander that prevents namespaces from being created when a new Deployment is triggered. The values specified here must be astronomer.commander.env.name: "COMMANDER_MANUAL_NAMESPACE_NAMES" and astronomer.commander.env.value= true. |
values.yaml file, these settings are configured so that you don’t configure namespace pools at a global level:
Troubleshooting namespace pools
My Deployment is in an unknown state
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 theastronomer-commander service account doesn’t have the permissions necessary to perform a required action. When Commander succeeds, it shows the following notification:
My namespace is not returning to the pool
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.My Deployments using NFS deploys stopped working
NFS deploys don’t work if you both use namespace pools and setglobal.clusterRoles to false in your values.yaml file.