Generating the custom resource

The deployment script generates a custom resource file with the selected options.

About this task

The script creates a custom resource (CR) file to deploy by the Business Automation Insights operator. The deployment script prompts the user to enter values to get access to the container images and to select what is installed with the deployment.

If you ran the bai-prerequisites.sh script to prepare your Kubernetes secrets from the same local cert-kubernetes-bai directory. It is highly recommended that you use the bai-prerequisites.sh script before you run the deployment script, as it speeds up the time it takes to install and reduces the risk of error.

Note: The deployment script uses a custom resource (CR) template file. The pattern template names include "production" and are found in the cert-kubernetes-bai/descriptors/patterns folder. The CR files are configured by the deployment script. You can also use the appropriate CR template from the CASE package as your starting point and customize the YAML file instead of generating the CR with the script.
Remember: You can run the scripts on an amd64/x86, a Linux® on Z, or a Linux on Power® based cluster. If you cannot use the CLI on a compatible machine, you can install your production deployment in the OpenShift® console or start with a CR template file.

Procedure

  1. Log in to the cluster with the cluster administrator that you used in Preparing your cluster for an online deployment or a non-administrator user who has access to the project.

    Using the Red Hat® OpenShift CLI:

    oc login https://<cluster-ip>:<port> -u <cluster-admin> -p <password> 
  2. View the list of projects in your cluster to see the target project before you run the deployment script.
    kubectl get namespace
    Note: If you used the All namespaces option to install the Business Automation Insights operator, then you must have another project in addition to openshift-operators in the cluster before you create the deployment. Change the scope to the project that you created for your deployment (bai-project).
    kubectl config set-context --current --namespace=<project_name>

    The specified project is used in all subsequent operations that manipulate project-scoped content.

  3. If you need to, download the cert-kubernetes-bai repository to a Linux based VM/machine.

    For more information about downloading cert-kubernetes-bai, see Preparing your cluster for an online deployment.

  4. Run the bai-deployment.sh script to generate the CR.
    ./bai-deployment.sh -n < namespace >
  5. Run the deployment script from the local directory where you downloaded the cert-kubernetes-bai repository, and follow the prompts in the command window.
    Note: You must use the namespace where BAI Standalone operands / services are to be deployed in as the value passed to -n argument while generating the CR.
    Warning: The script deletes any previously generated custom resource files under the cert-kubernetes-bai/scripts/generated-cr folder. If you want to keep them, make copies of the YAML files somewhere else.
    cd cert-kubernetes-bai/scripts
    ./bai-deployment.sh -n <bai-namespace>
    Note:
    1. The bai-deployment.sh script checks your local file system for the property files that are created by the bai-prerequisites.sh script. If the following files are found, then the script assumes that you ran the bai-prerequisites.sh script, generated the ldap secrets, and validated that the property values that you entered are correct for your deployment.
      cert-kubernetes-bai/scripts/.tmp/.TEMPORARY.property
      cert-kubernetes-bai/scripts/bai-prerequisites/<BAI_NAMESPACE>/propertyfile/bai_LDAP.property
      cert-kubernetes-bai/scripts/bai-prerequisites/<BAI_NAMESPACE>/propertyfile/bai_user_profile.property
    2. If you did not run the bai-prerequisites.sh script, set the deployment profile to the size that you want to use for your deployment. The default is small.

      For a small-sized deployment, the size of the Cloud Pak foundational services instance is set to starterset.

      The setting of the Cloud Pak foundational services profile occurs at installation. If you change the BAI deployment profile it does not change the Cloud Pak foundational services CR. You have to update the Cloud Pak foundational services CR independently.

      To determine the real size that is needed for Cloud Pak foundational services, do proper performance testing with your intended workload and modify the CRs to the correct size. For more information, see Hardware requirements and recommendations for foundational services External link opens a new window or tab .

    1. Accept the license. You must agree to the license that is displayed.
    2. A summary of your selection is displayed. Click Yes to verify that the information is correct.

Results

A custom resource file is created scripts/generated-cr/<BAI_NAMESPACE>/ibm_bai_cr_final.yaml.

Tip: You can rename the file and move it to another folder, or you can continue to use the file from this location. Because the maximum length of labels in Kubernetes is 63 characters, be careful with the lengths of your CR name and project names. Some components can configure multiple instances, each instance must have a different name. The total length of the CR name must not exceed 24 characters, otherwise some component deployments fail.

What to do next

Go to Checking and completing your custom resource.