Installing IBM Cloud Pak foundational services by using the CLI

You can use the command-line interface (CLI) to install IBM Cloud Pak foundational services in your cluster.

The IBM Cloud Pak foundational services operator installs IBM Cloud Pak foundational services and manages the lifecycle of all foundational services operators. For more information about the service operator names and versions, see Foundational services operators and versions

Note: If the IBM Cloud Pak foundational services that you are using are included as part of an IBM Cloud Pak® deployment, you do not have to manually deploy the IBM Cloud Pak foundational services operator. The IBM Cloud Pak foundational services is deployed into the same namespace as your IBM Cloud Pak deployment by default.

  1. Prerequisites
  2. Creating the catalog sources
  3. Installing the operators
  4. Setting the hardware profile and accepting the license
  5. Configuring namespace permissions
  6. Installing foundational services in your cluster

Prerequisites

For more information, see Prerequisites.

Creating the catalog sources

Create catalog sources that you need for foundational services installation.

  1. Log in to the cluster by using the oc login command.

  2. Create the following catalog sources.

    • Foundational services catalog source

      1. Create a YAML file named opencloud-operators.yaml with the following definition:

         apiVersion: operators.coreos.com/v1alpha1
         kind: CatalogSource
         metadata:
           name: opencloud-operators
           namespace: openshift-marketplace
         spec:
           displayName: IBMCS Operators
           publisher: IBM
           sourceType: grpc
           image: icr.io/cpopen/ibm-common-service-catalog:4.6
           updateStrategy:
             registryPoll:
               interval: 45m
        
      2. Create the foundational services catalog source.

         oc apply -f opencloud-operators.yaml
        
    • If you are using License Service, see Installing License Service.

    • If you are using License Service Reporter, see Installing License Service Reporter with the CLI.

    • If you are using the foundational services certificate manager, see Installing IBM Cert Manager with the CLI.

    • CloudNative PostgreSQL catalog source

      1. Create a YAML file named cloud-native-catalog.yaml with the following definition:

         apiVersion: operators.coreos.com/v1alpha1
         kind: CatalogSource
         metadata:
           name: cloud-native-postgresql-catalog
           namespace: openshift-marketplace
         spec:
           displayName: Cloud Native PostgreSQL Catalog
           publisher: IBM
           sourceType: grpc
           image: icr.io/cpopen/ibm-cpd-cloud-native-postgresql-operator-catalog@sha256:0b46a3ec66622dd4a96d96243602a21d7a29cd854f67a876ad745ec524337a1f
           updateStrategy:
             registryPoll:
               interval: 45m
        

        Note: You can create the Cloud Native PostgreSQL CatalogSource only by applying the image with the digest value that refers to the appropriate case bundle that is based on the Cloud Native PostgreSQL version.

      2. Create the CloudNative PostgreSQL catalog source.

         oc apply -f cloud-native-catalog.yaml
        
    • (optional) IBM Business Team Service catalog source, create this catalog source if you are using this service.

      1. Create a YAML file named bts-operator-catalog.yaml with the following definition:

         apiVersion: operators.coreos.com/v1alpha1
         kind: CatalogSource
         metadata:
           name: bts-operator
           namespace: openshift-marketplace
         spec:
           displayName: BTS Operator
           publisher: IBM
           sourceType: grpc
           image: icr.io/cpopen/ibm-bts-operator-catalog:latest
           updateStrategy:
             registryPoll:
               interval: 5m
        
      2. Create the IBM Business Team Service catalog source.

         oc apply -f bts-operator-catalog.yaml
        
    • (optional) IBM Automation Flink catalog source, create this catalog source if you are using this service.

      1. Create a YAML file named flink-catalog.yaml with the following definition:

         apiVersion: operators.coreos.com/v1alpha1
         kind: CatalogSource
         metadata:
           name: flink-catalog
           namespace: openshift-marketplace
         spec:
           displayName: Flink SC2 catalog
           image: icr.io/cpopen/ibm-opencontent-flink-operator-catalog:sc2
           publisher: IBM
           sourceType: grpc
           updateStrategy:
             registryPoll:
               interval: 45m
        
      2. Create the IBM Automation Flink catalog source.

         oc apply -f flink-catalog.yaml
        
    • (optional) IBM Automation Elastic catalog source, create this catalog source if you are using this service.

      1. Create a YAML file named ibm-elastic-operator-catalog.yaml with the following definition:

         apiVersion: operators.coreos.com/v1alpha1
         kind: CatalogSource
         metadata:
           name: ibm-elastic-operator-catalog
           namespace: openshift-marketplace
         spec:
           displayName: ibm-elastic-operator-catalog
           image: icr.io/cpopen/ibm-cs-elastic-operator-catalog:latest
           publisher: IBM Content
           sourceType: grpc
           updateStrategy:
             registryPoll:
               interval: 45m
        
      2. Create the IBM Automation Elastic catalog source.

         oc apply -f ibm-elastic-operator-catalog.yaml
        

      It might take up to a minute for the catalog sources to be created.

  3. Verify that all the catalog sources are created.

     oc -n openshift-marketplace get catalogsource opencloud-operators -o jsonpath="{.status.connectionState.lastObservedState}"
    
     oc -n openshift-marketplace get catalogsource cloud-native-postgresql-catalog -o jsonpath="{.status.connectionState.lastObservedState}"
    
     oc -n openshift-marketplace get catalogsource ibm-udsoperator-catalog -o jsonpath="{.status.connectionState.lastObservedState}"
    
     oc -n openshift-marketplace get catalogsource bts-operator -o jsonpath="{.status.connectionState.lastObservedState}"
    
     oc -n openshift-marketplace get catalogsource flink-catalog -o jsonpath="{.status.connectionState.lastObservedState}"
    
     oc -n openshift-marketplace get catalogsource ibm-elastic-operator-catalog -o jsonpath="{.status.connectionState.lastObservedState}"
    

    Following is the expected output:

     READY
    

Installing the IBM Common Service Operator

Ensure that your IBM Cloud Pak® namespace exists in your cluster. The namespace is needed for the IBM Cloud Pak foundational services operator.

Usually, the IBM Cloud Pak foundational services operator is automatically installed in your IBM Cloud Pak namespace when you install your IBM Cloud Pak. If you see the operator in your IBM Cloud Pak namespace, you do not need to manually install it. The Operand Deployment Lifecycle Manager and the foundational services are then, by default, installed in the foundational-services namespace.

See the following notes:

Complete these steps to install the resources:

  1. Create a YAML file named def.yaml with the resources definitions that you need.

    apiVersion: v1
    kind: Namespace
    metadata:
      name: <your IBM Cloud Pak namespace>
    
    ---
    apiVersion: operators.coreos.com/v1alpha2
    kind: OperatorGroup
    metadata:
      name: operatorgroup
      namespace: <your IBM Cloud Pak namespace>
    spec:
      targetNamespaces:
      - <your IBM Cloud Pak namespace>
    
    ---
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: ibm-common-service-operator
      namespace: <your IBM Cloud Pak namespace>
    spec:
      channel: v4.6
      installPlanApproval: Automatic
      name: ibm-common-service-operator
      source: opencloud-operators
      sourceNamespace: openshift-marketplace
    
  2. Create the resources that you specified in the definition file.

    oc apply -f def.yaml
    

    Following is a sample output:

    namespace/cloud-pak-1 created
    operatorgroup.operators.coreos.com/operatorgroup created
    subscription.operators.coreos.com/ibm-common-service-operator created
    
  1. If you are using License Service, see Installing License Service.
  2. If you are using License Service Reporter, see Installing License Service Reporter with the CLI.
  3. If you are using the foundational services certificate manager, see Install the IBM Cert Manager Operator.

The IBM Cloud Pak foundational services operator installs the Operand Deployment Lifecycle Manager Operator in the namespace. The IBM Cloud Pak foundational services operator creates the CommonService custom resource. If required, you can customize the service definitions by editing the custom resource. For more information, see Configuring foundational services by using the CommonService custom resource.

The Operand Deployment Lifecycle Manager provides the following APIs:

The Operand Deployment Lifecycle Manager creates the OperandRegistry and OperandConfig instances by default. You must manually create the OperandRequest instance to specify the services that you want to install in your cluster.

You can verify the status of the operators by running the following commands:

oc -n <operator-namespace> get csv

Following is a sample command and output:

oc -n <your IBM Cloud Pak&reg; namespace> get csv
NAME                                          DISPLAY                                       VERSION   REPLACES                                      PHASE
ibm-common-service-operator.v4.6.0             IBM Cloud Pak foundational services            v4.6.0       ibm-common-service-operator.v3.23.0            Succeeded

Verify whether the CustomResourceDefinitions (CRDs) are created.

oc get crd | grep operandrequest

Following is a sample output:

NAME                               CREATED AT
operandrequests.operator.ibm.com   2020-09-18T10:10:22Z

Setting the hardware profile and accepting the license

Complete these steps:

  1. Edit the common-service resource.

    oc -n <your-foundational-services-namespace> edit commonservice common-service
    
  2. Update the spec.size parameter to set the hardware profile, and add the spec.license.accept: true parameter to accept the license.

    apiVersion: operator.ibm.com/v3
    kind: CommonService
    metadata:
      name: common-service
      namespace: <your-foundational-services-namespace>
    spec:
      license:
        accept: true
      size: starterset
    

Configuring namespace permissions

For some topologies, you must authorize the foundational services operators to manage service workload across namespaces. For more information, see Authorizing foundational services to perform operations on workloads in a namespace.

Installing foundational services in your cluster

You must create the OperandRequest to specify the services that you want to install in your cluster.

Before you install the foundational services by creating OperandRequest instance, complete the configurations that are required for the foundational services that you are installing. For more information, see Configuring foundational services by using the CommonService custom resource.

Note: The ibm-im-operator creates a default cluster administrator by the name cpadmin during installation. If you already have a user by the name cpadmin in your cluster, you must set the defaultAdminUser parameter before you install foundational services. This setting is to avoid your cpadmin user from being removed if you uninstall foundational services later. For more information about setting this parameter, see Changing the default admin username.

To edit the CommonService custom resource, run this command:

oc -n <your-foundational-services-namespace> edit commonservice common-service
  1. Create a operand-request.yaml file with the following definition. Specify only the services that you want to install in your cluster. Remove the service entries (operands) that you do not want to install.

    For a list of foundational services that you can install, see IBM Cloud Pak foundational services Operators and versions.

    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: <custom-name-of-operand-request>
      namespace: <your-foundational-services-namespace>
      labels:
        app.kubernetes.io/instance: operand-deployment-lifecycle-manager
        app.kubernetes.io/managed-by: operand-deployment-lifecycle-manager
        app.kubernetes.io/name: operand-deployment-lifecycle-manager
    spec:
      requests:
        - operands:
            - name: ibm-im-operator
            - name: ibm-platformui-operator
            - name: cloud-native-postgresql
            - name: ibm-bts-operator
            - name: ibm-opencontent-flink-operator
            - name: ibm-elasticsearch-operator
            - name: ibm-events-operator
          registry: common-service
    

    Note: You can create the OperandRequest in any namespace. If you are creating the OperandRequest in a different namespace than where OperandRegistry and OperandConfig custom resources are, change the namespace: parameter value to the namespace from where you are creating the OperandRequest. And, add the registryNamespace: <your-foundational-services-namespace> in the OperandRequest. See the following example:

    apiVersion: operator.ibm.com/v1alpha1
    kind: OperandRequest
    metadata:
      name: <custom-name-of-operand-request>
      namespace: <OperandRequest namespace>
    spec:
      requests:
        - operands:
            - name: ibm-im-operator
             .
             .
             .
          registry: common-service
          registryNamespace: <your-foundational-services-namespace>
    
  2. Add bindings to access a service. This step is optional. For more information, see Accessing the services.

  3. If you are installing Cloud Native PostgreSQL, you need to create the entitled registry secret. For the steps to create the entitled registry secret, see Creating the entitled registry secret.

  4. Create the OperandRequest instance.

    oc apply -f operand-request.yaml
    

To verify the installation, see Verifying the installation.

To access the console, see Accessing the console.