Contact Us 1-800-596-4880

Creating Namespaces for Application Deployments

Anypoint Runtime Fabric version 1.12 or later enables you to create your own namespaces for application deployments.

When you deploy an application into an Anypoint Platform environment, Runtime Fabric creates a new default namespace using the identifier of the environment. However, if you can create or modify a namespace with the appropriate Kubernetes labels, Runtime Fabric deploys applications into that namespace instead of into the default namespace.

Create A Namespace

  1. As a user with permissions to create a namespace, log in to a Kubernetes workstation.

  2. Run the following commands:

    kubectl create ns <app_namespace>
    kubectl label ns <app_namespace><rtf_namespace><environment_id><org_id>
    • Replace <app_namespace> with the name of your namespace.

    • Replace <rtf_namespace> with the name of the namespace containing the RTF agent.

    • Replace <environment_id> with the correct ID for your environment.

    • Replace <org_id> with the correct ID for your Business Group.

After you run these commands, any application deployed into an Anypoint Platform environment identified by <environment_id> and <org_id> is created inside the <app_namespace> namespace by the RTF agent running in the <rtf_namespace>. Before you deploy any applications into the new namespace, delete any autogenerated namespaces and any applications in them that use the same environment ID as the new namespace.

Troubleshooting Custom Namespaces

If you encounter errors when attempting to create namespaces for Runtime Fabric, troubleshoot them as follows.

More Than One Namespace Uses the Same Environment ID

Imagine that you created more than one namespace using the same environment ID, as shown in the following example:

$ kubectl get ns custom-namespace-1 -oyaml
labels: b164ad54-7e15-4c8b-a7ab-18011a361d81 workers

$ kubectl get ns custom-namespace-2 -oyaml
labels: b164ad54-7e15-4c8b-a7ab-18011a361d81 workers

In such cases, Runtime Fabric fails the deployment and creates an error message in Runtime Manager.

Before you delete a namespace, ensure that you have not deployed any production applications into that namespace.