Installing Behavior Analytics Service

Install the Behavior Analytics Service (BAS) to collect and process TRIRIGA Application Suite license and usage information.

Procedure

  1. Create the new BAS project by running the following command:
    
    oc new-project ibm-bas
    
  2. Enable the IBM operator catalog by running the following command:
    
    cat <<EOF |oc apply -f -
    apiVersion: operators.coreos.com/v1alpha1
    kind: CatalogSource
    metadata:
      name: ibm-operator-catalog
      namespace: openshift-marketplace
    spec:
      displayName: "IBM Operator Catalog" 
      publisher: IBM
      sourceType: grpc
      image: icr.io/cpopen/ibm-operator-catalog:latest
      updateStrategy:
        registryPoll:
          interval: 45m
    EOF
    
  3. Install BAS Operator.
    1. Create the operator group by running the following command:
      
      cat <<EOF |oc apply -f -
      apiVersion: operators.coreos.com/v1
      kind: OperatorGroup
      metadata:
        name: bas-operator-group
        namespace: ibm-bas
      spec:
        targetNamespaces:
          - ibm-bas
      EOF
      
    2. Install BAS Operator by running the following command:
      
      cat <<EOF |oc apply -f -
      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: behavior-analytics-services-operator-certified
        namespace: ibm-bas
      spec:
        channel: alpha
        installPlanApproval: Automatic
        name: behavior-analytics-services-operator-certified
        source: certified-operators
        sourceNamespace: openshift-marketplace
      EOF
      
  4. Create the IBM entitlement secret.
    1. Obtain your IBM entitlement registry from the Container software library. Click Copy key and substitute the value as <ENTITLEMENT_KEY> in the next step of this task.
    2. Create the secret by running the following command:
      
      oc create secret docker-registry ibm-entitlement --docker-server=cp.icr.io --docker-username=cp --docker-password="$ENTITLEMENT_KEY" -n ibm-bas
      
  5. Create database secrets by running the following commands:
    
    oc create secret generic database-credentials -n ibm-bas --from-literal=db_username=basuser --from-literal=db_password=admin
    oc create secret generic grafana-credentials -n ibm-bas --from-literal=grafana_username=basuser --from-literal=grafana_password=admin
    
  6. Create the AnalyticsProxy (BAS) custom resource.

    Replace ibmc-file-gold-gid with the available storage class in the cluster.

    
    cat <<EOF | oc create -f -
    apiVersion: bas.ibm.com/v1
    kind: AnalyticsProxy
    metadata:
      name: analyticsproxy
      namespace: ibm-bas
    spec:
      allowed_domains: "*"
      db_archive:
        frequency: '@monthly'
        retention_age: 6
        persistent_storage:
          storage_class: ibmc-file-gold-gid
          storage_size: 10G
      airgapped:
        enabled: 'false'
        backup_deletion_frequency: '@daily'
        backup_retention_period: 7
      event_scheduler_frequency: '@hourly'
      ibmproxyurl: 'https://iaps.ibm.com'
      image_pull_secret: ibm-entitlement
      postgres:
        storage_class: ibmc-file-gold-gid
        storage_size: 10G
      kafka:
        storage_class: ibmc-file-gold-gid
        storage_size: 5G
        zookeeper_storage_class: ibmc-file-gold-gid
        zookeeper_storage_size: 5G
      env_type: lite
    EOF
    

    Wait 20 minutes for the AnalyticsProxy installation to complete.

  7. Generate the API key.
    
    cat <<EOF | oc create -f -
    apiVersion: bas.ibm.com/v1
    kind: GenerateKey
    metadata:
      name: bas-api-key
      namespace: ibm-bas
    spec:
      image_pull_secret: ibm-entitlement
    EOF
    
  8. Get the BAS URL and API key.
    1. Obtain the BAS Endpoint URL from:
      
      echo https://$(oc get routes bas-endpoint -n ibm-bas |awk 'NR==2 {print $2}')
      
    2. Obtain the BAS API key from:
      
      oc get secret bas-api-key -n ibm-bas --output="jsonpath={.data.apikey}" | base64 -d