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 <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span> operator. The <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span> is deployed into the same namespace as your IBM Cloud Pak deployment by default.

  1. Installing the IBM Common Service Operator
  2. Setting the hardware profile and accepting the license
  3. Configuring namespace permissions
  4. Configuring the services

Installing the IBM Common Service Operator

Ensure that your IBM Cloud Pak namespace exists in your cluster. The namespace is needed for the <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span> operator.

Usually, the <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span> 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 <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs_ns" data-variable="keyword.cs_ns" class="md-conref">keyword.cs_ns</span> namespace.

  • If your IBM Cloud Pak namespace exists in your cluster, and you installed your IBM Cloud Pak but you don't see the <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span> operator in your IBM Cloud Pak namespace, then you need to create only the subscription for the <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span> operator. You do not need to create a namespace and OperatorGroup.
  • If your IBM Cloud Pak namespace does not exist in your cluster, then you need to create a namespace for your IBM Cloud Pak, and a OperatorGroup and subscription for the <span data-key-file="/home/jenkins/workspace/workspace/dita-converter/git_repo/conrefs.yml" data-conkeyref="conrefs/keyword.cs" data-variable="keyword.cs" class="md-conref">keyword.cs</span> operator. In the Subscription definition, specify your IBM Cloud Pak namespace as the namespace parameter value.

See the following notes:

  • You can set the approval strategy to either Automatic or Manual, as required. By default, the approval strategy is set to Automatic, which automatically installs or upgrades the operator when a new version is available. If you set the strategy to Manual, the operator is not automatically installed or upgraded. Instead, you get an install plan that needs to be manually approved before an upgrade.

  • When you set the InstallPlanApproval for the IBM Cloud Pak foundational services operator, it applies to all foundational services installed with this operator.

  • If you install the IBM Cloud Pak foundational services operator in a namespace where another operator is installed that already has the installPlanApproval: Manual set in its subscription, then the IBM Cloud Pak foundational services operator inherits this setting. The approval plan is set to Manual and IBM Cloud Pak foundational services operator cannot be automatically installed or upgraded. For more information, see Approval strategy.

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: <your-catalog-source>
      sourceNamespace: <your-catalog-source-namespace>
    
    
  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
    
  3. If you are using License Service, see Installing License Service.

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

  5. If you are using the foundational services certificate manager, see Install the IBM Cert Manager Operator.

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 namespace> get csv
NAME                                          DISPLAY                                       VERSION   REPLACES                                      PHASE
ibm-common-service-operator.v4.6.16             IBM Cloud Pak foundational services            v4.6.16       ibm-common-service-operator.v4.6.17            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 the services

Before you deploy foundational services instance, you can customize the configuration of the foundational services that you are installing.

For more information, see Configuring foundational services .

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.

What to do next

You installed the foundational services operators, and now you can apply your entitlement key for online installation. For more information, see Applying your entitlement key for online installation.

If you are using an air-gapped cluster, your entitlement key is already applied as a part of the air-gapped image mirroring process. You do not need to apply your entitlement key again. You can now deploy the foundational services instances. For more information, see Deploying the foundational services instances.