Skip to main content
Version: Release 22.2

Install Release in a Custom Namespace

This topic describes the considerations and requirements for installing multiple instances of Release on the same cluster using custom namespaces.

  • If you would like to install multiple Release instances on the same cluster, you need to use a custom namespace.
  • Installation of the Release in custom namespace is for users that don't want to install Release in the default namespace: digitalai.

Note: Don't use custom namespace name that is longer from 24 characters. The namespace name is composing the CR name when using change-namespace script, and longer CR name could cause naming of some resources that are longer from 63 characters. Consider using namespace names up to 10 characters.

A few points to consider if you install Release in a custom namespace:

  • multiple Release instances on the same cluster in different namespaces.
  • each instance of the Release uses custom CR name.
  • when nginx is used, different IngressClass is created for each namespace.
  • all instances in different namespaces are reusing the same CRD; so exercise caution before deleting the CRD when you remove one of the instances.
  • every instance has one Release operator running that is managing the instance in only one namespace.

Audience

This guide is for administrators who install and manage Digital.ai Release.

Before You Begin

If you are doing this process as part of installation steps, you are OK, and go to next section.

  1. The Operator zip file is downloaded from the Release Software Distribution site and extracted to the standalone Deploy server you would use to install Release on the Kubernetes cluster.

  2. Created custom namespace on the cluster.

    kubectl create namespace <name-0f-the-custom-namespace>
  3. Install XL CLI.

    See Install the XL-CLI.

    Note: Use the version that matches your product version in the public folder.

Configuring Custom Namespace

  • Run the XL CLI's xl op command with the --change-namespace flag.
  • This command changes nothing on the cluster
  • This command checks the current state of CRD and CRs, for the case if they already exist on the cluster.
  • This command prepares the YAML files in the operator zip file.
xl op --change-namespace

For example, here's is the list of questions you would be prompted with when you run the xl op command in Azure for a custom namespace called custom-namespace-1, for example. These questions are also discussed in Upgrade Operator-based Deployments

? Select the setup mode? advanced
? Select the Kubernetes setup where the digitalai Devops Platform will be installed or uninstalled: AzureAKS [Azure AKS]
? Do you want to use Kubernetes\' current-context from ~/.kube/config? Yes
? Do you want to use an custom Kubernetes namespace (current default is 'digitalai')? Yes
? Enter the name of the existing Kubernetes namespace where the XebiaLabs DevOps Platform will be installed, updated or undeployed: custom-namespace-1
? Product server you want to deploy? daiRelease
? Does product custom resource definition already exists on the cluster? No
? Enter path to the operator package: /xl-release-kubernetes-operator/release-operator-azure-aks
Using custom resource name dai-xlr-custom-namespace-1
Everything has been updated!

Refer to the specific cloud provider documentation to gather details about the provided infrastructure.

The last two questions are specific to this process and so let us discuss them here:

? Does product custom resource definition already exists on the cluster?

  • The Release Operator CRD digitalaireleases.xlr.digital.ai is reused between Release installations on the same cluster.
  • This name cannot change as it is defined in the Release's Operator image.
  • If the CRD resource for the Release Operator already exists on the cluster, in that case answer Yes and creation of the Release operator CRD during installation will be skipped..
  • In other cases, by answering No, the Release Operator CRD will be created.

If not sure, you can run the kubectl get crd command to verify the list of CRDs on the cluster.

For example, answer Yes if you see the following result for the kubectl get crd command:

❯ kubectl get crd
NAME CREATED AT
...
digitalaireleases.xlr.digital.ai 2022-06-14T09:05:54Z
...

? Enter path to the operator package:

  • Input the absolute path to the unpacked operator's zip file.
  • The yaml files in the zip file should be already changed.
  • The process of changing namespace checks the ingress settings to make changes in the CR file.
  • It depends on the following CR yaml dairelease_cr.yaml paths:
    • spec.nginx-ingress-controller.install
    • spec.haproxy-ingress.install

Post change namespace steps

The following files in the Operator-based installer package are updated with the custom namespace name, for example custom-namespace-1, as you change the namespace.

File nameYaml pathValue to set
digitalai-release/infrastructure.yamlspec[0].children[0].children[0].namecustom-namespace-1
digitalai-release/infrastructure.yaml (not on OpenShift)spec[0].children[0].children[0].namespaceNamecustom-namespace-1
digitalai-release/infrastructure.yaml (only on OpenShift)spec[0].children[0].children[0].projectNamecustom-namespace-1
digitalai-release/environment.yamlspec[0].children[0].members[0]~Infrastructure/k8s-infra/xlr/custom-namespace-1
digitalai-release/kubernetes/template/cluster-role-digital-proxy-role.yamlmetadata.namecustom-namespace-1-xlr-operator-proxy-role
digitalai-release/kubernetes/template/cluster-role-manager-role.yamlmetadata.namecustom-namespace-1-xlr-operator-manager-role
digitalai-release/kubernetes/template/cluster-role-metrics-reader.yamlmetadata.namecustom-namespace-1-xlr-operator-metrics-reader
digitalai-release/kubernetes/template/leader-election-rolebinding.yamlsubjects[0].namespacecustom-namespace-1
digitalai-release/kubernetes/template/manager-rolebinding.yamlmetadata.namecustom-namespace-1-xlr-operator-manager-rolebinding
digitalai-release/kubernetes/template/manager-rolebinding.yamlroleRef.namecustom-namespace-1-xlr-operator-manager-role
digitalai-release/kubernetes/template/manager-rolebinding.yamlsubjects[0].namespacecustom-namespace-1
digitalai-release/kubernetes/template/proxy-rolebinding.yamlmetadata.namecustom-namespace-1-xlr-operator-proxy-rolebinding
digitalai-release/kubernetes/template/proxy-rolebinding.yamlroleRef.namecustom-namespace-1-xlr-operator-proxy-role
digitalai-release/kubernetes/template/proxy-rolebinding.yamlsubjects[0].namespacecustom-namespace-1
digitalai-release/kubernetes/dairelease_cr.yamlmetadata.namedai-xlr-custom-namespace-1

Update the following files in case you use the nginx ingress (default behavior). In other words, if you have set the following parameters.

  • spec.haproxy-ingress.install = false
  • spec.nginx-ingress-controller.install = true

Note: Skip this part for OpenShift and On Premise setups. On these two providers there is already provider's ingress setup.

File nameYaml pathValue to set
digitalai-release/kubernetes/dairelease_cr.yamlspec.ingress.annotations.kubernetes.io/ingress.classnginx-dai-xlr-custom-namespace-1
digitalai-release/kubernetes/dairelease_cr.yamlspec.keycloak.ingress.annotations.kubernetes.io/ingress.classnginx-dai-xlr-custom-namespace-1
digitalai-release/kubernetes/dairelease_cr.yamlspec.nginx-ingress-controller.extraArgs.ingress-classnginx-dai-xlr-custom-namespace-1
digitalai-release/kubernetes/dairelease_cr.yamlspec.nginx-ingress-controller.ingressClassResource.controllerClassk8s.io/ingress-nginx-dai-xlr-custom-namespace-1
digitalai-release/kubernetes/dairelease_cr.yamlspec.nginx-ingress-controller.ingressClassResource.namenginx-dai-xlr-custom-namespace-1

Update the following files in case you use the haproxy ingress. In other words, if you have set the following parameters.

  • spec.haproxy-ingress.install = true
  • spec.nginx-ingress-controller.install = false
File nameYaml pathValue to set
digitalai-release/kubernetes/dairelease_cr.yamlspec.ingress.annotations.kubernetes.io/ingress.classhaproxy-dai-xlr-custom-namespace-1
digitalai-release/kubernetes/dairelease_cr.yamlspec.haproxy-ingress.controller.ingressClasshaproxy-dai-xlr-custom-namespace-1

Next Step—Proceed with the Installation

  • If you are doing this process as part of installation steps, you are finished with current step, continue with next step.
  • Once the setup is finalized you can proceed to applying the changed files to the cluster.
  • You can now run the xl apply command to deploy the setup to the cluster.