Preparing a namespace for the operator

All instances of an operator need a namespace on all Kubernetes clusters. Depending on your platform type, prepare the namespace on OCP, ROKS, Rancher, Tanzu, or GKE.

About this task

You can create a namespace before or when you run the cluster setup script.

Note: If you plan to run the cluster setup script, you do not need to create the project beforehand. If you prefer, you can create a new project by using the script.

Procedure

  1. For OpenShift®, log in to your OCP cluster.
    Use the oc command line interface for Kubernetes container platforms.
    To log in to your cluster.
    oc login https://<cluster-ip>:<port> -u <cluster-admin> -p <password>

    Where the <cluster-ip>:<port> is the IP address and port number of the cluster, and the <password> is your password for your <cluster-admin> user.

    The following command shows an example cluster URL and port.

    oc login https://api.ocp4616-bai.cp.example.com:6443 -u admin -p admin_pwd
    
    To log in to your ROKS cluster.
    oc login --token=<token> --server=https://<cluster-ip>:<port>

    Where the <token> is your API token for your user on the cluster, and <cluster-ip>:<port> is the IP address and port number of the cluster. You can get these values for OpenShift by clicking Copy Login Command in the OCP console.

    The following example command shows that the token is an almost-unique fixed-size 256-bit (32-byte) hash.

    oc login --token=sha256~5a0GogeS4oEUfG5yFCcPE2Qf-rz5exEUiFaZ4V0Iy1Y --server=<https://<cluster-ip>:<port>>
  2. Create a namespace for the operator deployment.

    You can use an existing project in the cluster or create a new namespace. You can create a project in the Kubernetes CLI by running the following command.

    kubectl create namespace <namespace_name>

    If you do create a project, change the scope in the cluster to the new project (bai-project).

    kubectl config set-context --current --namespace=<namespace_name>
    For OpenShift use the following commend:
    oc new-project <project name>

What to do next

You can now check that you have access to the container images. For more information, see Getting access to images from the public IBM Entitled Registry.