# Setting up custom namespaces

Specify your own namespace names for both the Dynamic Engine and its environment.

## About this task

By default, the following namespaces are created:

* qlik-dynamic-engine: for Dynamic Engine's infrastructure services.
* qlik-processing-env-&lt;env-id&gt;: for each Dynamic Engine environment, where *&lt;env-id&gt;* is the environment identifier.

With Helm deployment, you can define custom names for these namespaces to facilitate your namespace management.

Information noteNote: Changing the namespace name is only allowed during engine deployment.

## Procedure

1. In the Kubernetes machine, unzip the Helm deployment zip file previously downloaded.
2. Create a custom values file for the Dynamic Engine custom namespace.

   Run the following command in your terminal.
   ```
   cat <<EOF > $DYNAMIC_ENGINE_ID-custom-namespace-values.yaml
   global:
     namespace:
       create: false
       name: <engine-custom-namespace>
   EOF        
   ```

   For example, $DYNAMIC\_ENGINE\_ID is c-m-sjufu4qy and &lt;engine-custom-namespace&gt; is dynamic-engine-dev. This creates a values file called c-m-sjufu4qy-custom-namespace-values.yaml. This file contains:
   ```
   global:
     namespace:
       create: false
       name: dynamic-engine-dev
   ```
3. Create the custom namespace in your Kubernetes cluster.
   ```
   kubectl create namespace <engine-custom-namespace>            
   ```
4. Deploy the Dynamic Engine with your custom namespace configuration.
   ```
   helm install dynamic-engine-$DYNAMIC_ENGINE_ID -f $DYNAMIC_ENGINE_ID-values.yaml  \
   -f $DYNAMIC_ENGINE_ID-custom-namespace-values.yaml \
   oci://ghcr.io/talend/helm/dynamic-engine \
   --version $DYNAMIC_ENGINE_VERSION          
   ```
5. Create a custom values file for the environment custom namespace.

   Run the following commands in your terminal.
   ```
   cat <<EOF > $DYNAMIC_ENGINE_ENVIRONMENT_ID-custom-namespace-values.yaml
   global:
     namespace:
       create: false
       name: <environment-custom-namespace>

   dynamicEngine:
     namespace:
       name: <engine-custom-namespace>
   EOF       
   ```

   Ensure to use the same engine custom namespace name for &lt;engine-custom-namespace&gt; as the one you previously created. If you use a different one, the environment cannot be deployed.

   For example, $DYNAMIC\_ENGINE\_ENVIRONMENT\_ID is 67f7d562ffd7c3525a902542, &lt;environment-custom-namespace&gt; is dynamic-engine-dev-env-1, and engine-custom-namespace&gt; is dynamic-engine-dev, exactly the same as the engine's custom namespace name mentioned in previous examples. This creates a values file called 67f7d562ffd7c3525a902542-custom-namespace-values.yaml. This file contains:
   ```
   global:
     namespace:
       create: false
       name: dynamic-engine-dev-env-1
   dynamicEngine:
     namespace:
       name: dynamic-engine-dev
   ```
6. Create the custom environment namespace in your Kubernetes cluster.
   ```
   kubectl create namespace <environment-custom-namespace>            
   ```
7. Deploy the Dynamic Engine environment with your custom namespace configuration.
   ```
   helm install dynamic-engine-environment-$DYNAMIC_ENGINE_ENVIRONMENT_ID -f $DYNAMIC_ENGINE_ENVIRONMENT_ID-values.yaml  \
   -f $DYNAMIC_ENGINE_ENVIRONMENT_ID-custom-namespace-values.yaml \
   oci://ghcr.io/talend/helm/dynamic-engine-environment \
   --version $DYNAMIC_ENGINE_VERSION                  
   ```

   Information noteTip: If you have multiple Dynamic Engine environments for the same Dynamic Engine, repeat these steps to create a distinct custom namespace name for each environment.
8. Verify the status of your Dynamic Engine and environments.
   ```
   kubectl get dynamicengines.apps.qlik.com -n <engine-custom-namespace>
   kubectl get dynamicengineenvs.apps.qlik.com -n <environment-custom-namespace>                    
   ```

   You should see information similar to these lines:
   ```
   NAME                               VERSION     STATUS    LAST UPDATE
   qlik-dynamic-engine-$DYNAMIC_ENGINE_ID   0.22.0      RUNNING   5 minutes

   NAME                   VERSION  STATUS    LAST UPDATE
   <environment-resource-name>   0.22.0   RUNNING   3 minutes
   ```

   The &lt;environment-resource-name&gt; is the same as the environment's custom namespace name, for example, dynamic-engine-dev-env-1.

## Results

Once done successfully, the Dynamic Engine environment services are installed in your cluster and connect to the Dynamic Engine.

In Talend Management Console, the status of this environment becomes Ready, confirming that it is ready to run tasks or plans.