Skip to main contentIBM Cloud Pak Playbook

IBM Edge Computing Manager - Installation Guide

In this section we will walk through the installation of the IBM Edge Computing Manager for Devices version 4.

Prerequisties

    1. Install IBM CP4MCM 1.3
    2. A macOS or Ubuntu Linux Host
    3. Openshift Client CLI Download
    4. Jq Download
    5. git
    6. docker 1.13 +
    7. make
    8. Download following CLI tools from the ICP console https://<ICP_CLUSTER_URL>/common-nav/cli
      1. Kubernetes CLI (kubectl)
      2. Helm CLI(helm)
      3. IBM Cloud Pak CLI ( cloudctl)

    Installing IBM Edge Computing Manager for Devices 4.0

      1. Set the ICP_CLUSTER_URL environment variable. This value can be obtained from the output of the Management Hub install:

        export ICP_CLUSTER_URL=https://$(oc get routes -n kube-system icp-console -o jsonpath='{.spec.host}')
      2. Connect to your cluster with cluster administrator privileges, selecting kube-system as the namespace and fill in the password you defined in the config.yaml file during the Management Hub install:

        cloudctl login -a $ICP_CLUSTER_URL -u admin -p <your-icp-admin-password> -n kube-system --skip-ssl-validation
      3. Define the image registry host, configure the Docker CLI to trust the self-signed certificate:

        export REGISTRY_HOST=$(oc get routes -n openshift-image-registry default-route -o jsonpath='{.spec.host}')
        oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge

        Trust the certificate

        mkdir -p ~/.docker/certs.d/$REGISTRY_HOST && \
        echo | openssl s_client -showcerts -connect $REGISTRY_HOST:443 2>/dev/null | openssl x509 -outform PEM > ~/.docker/certs.d/$REGISTRY_HOST/ca.crt && \
        sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.docker/certs.d/$REGISTRY_HOST/ca.crt

        Restart the Docker service from the menu bar

      4. Login to the OpenShift Container Platform 4.3.x image registry:

        docker login $REGISTRY_HOST -u $(oc whoami) -p $(oc whoami -t)
      5. Unpack the IBM Edge Computing Manager for Devices installation compressed file that was downloaded from IBM Passport Advantage:

        tar -zxvf ibm-ecm-4.0.0-x86_64.tar.gz && \
        cd ibm-ecm-4.0.0-x86_64
      6. Create a new namespace ibmcom.

        oc new-project ibmcom
      7. Load the archive content into the catalog, and the images into the registry’s ibmcom namespace:

        cloudctl catalog load-archive --archive ibm-ecm-prod-catalog-archive-4.0.0.tgz --registry $REGISTRY_HOST/ibmcom
      8. Extract the chart compressed file content to the current directory and move into the directory created:

        tar -O -zxvf ibm-ecm-prod-catalog-archive-4.0.0.tgz charts/ibm-ecm-prod-4.0.0.tgz | tar -zxvf - && \
        cd ibm-ecm-prod
      9. Install the Chart.

        ./ibm_cloud_pak/pak_extensions/full-install/install-edge-computing.sh

        Verifying the Chart

        • The script above verifies that the pods are running and the agbot and exchange are responding. Look for a “RUNNING” and “PASSED” message towards the end of the installation.
        • If “FAILED”, the output will ask you to look at specific logs for more information
        • If “PASSED”, the output will show details of tests that were run, and two more items to verify
          • Browse to the IBM Edge Computing Manager UI console at the URL given at the end of the log. https://<ICP_CLUSTER_URL>/edge

      Post installation configuration

        1. Set the ICP_CLUSTER_URL environment variable. This value can be obtained from the output of the Management Hub install:

          export ICP_CLUSTER_URL=https://$(oc get routes -n kube-system icp-console -o jsonpath='{.spec.host}')
        2. Connect to your cluster with cluster administrator privileges, selecting kube-system as the namespace and fill in the password you defined in the config.yaml file during the Management Hub install:

          cloudctl login -a $CLUSTER_URL -u admin -p <your-icp-admin-password> -n kube-system --skip-ssl-validation
        3. Install the hzn CLI with either the Ubuntu Linux or macOS package installers that are found under horizon-edge-packages in the appropriate OS/ARCH directory from the compressed content extracted in step 5 of the Installation process above:

          • Ubuntu Linux example:

            sudo dpkg -i horizon-edge-packages/linux/ubuntu/bionic/amd64/horizon-cli*.deb
          • macOS example:

            sudo installer -pkg horizon-edge-packages/macos/horizon-cli-*.pkg -target /
        4. Export the following variables that are needed for the next steps:

          export EXCHANGE_ROOT_PASS=$(oc -n kube-system get secret edge-computing -o jsonpath="{.data.exchange-config}" | base64 --decode | jq -r .api.root.password)
          export HZN_EXCHANGE_URL=https://$(oc get routes -n kube-system icp-console -o jsonpath='{.spec.host}')/ec-exchange/v1
          export HZN_EXCHANGE_USER_AUTH="root/root:$EXCHANGE_ROOT_PASS"
          export HZN_ORG_ID=IBM
        5. Run the following command to trust the OpenShift Container Platform 4.3 Certificate Authority:

          oc --namespace kube-system get secret cluster-ca-cert -o jsonpath="{.data['tls\.crt']}" | base64 --decode > /tmp/icp-ca.crt
          • Ubuntu Linux example:

            sudo cp /tmp/icp-ca.crt /usr/local/share/ca-certificates && sudo update-ca-certificates
          • macOS example:

            sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/icp-ca.crt
        6. Run the following command to create a signing key pair.

          hzn key create <company-name> <owner@email>
        7. Run the following command to confirm that the setup can communicate with the IBM Edge Computing Manager for Devices exchange API:

          hzn exchange status
        8. Populate sample edge services by running the following command:

          curl https://raw.githubusercontent.com/open-horizon/examples/v4.0/tools/exchangePublishScript.sh | bash
        9. Run the following commands to view some of the services and policies that were created in the IBM Edge Computing Manager for Devices exchange:

          hzn exchange service list IBM/
          hzn exchange pattern list IBM/
          hzn exchange service listpolicy IBM/ibm.helloworld_1.0.0_amd64
          hzn exchange service listpolicy IBM/ibm.cpu2evtstreams_1.4.3_amd64

        Uninstalling IBM Edge Computing Manager for Devices 4.0

        Return to the location of the chart unpacked as part of installation
        and run the provided uninstall script. This script will uninstall the helm release and all associated resources. First, login to the cluster as a cluster administrator by using cloudctl, and then run:

        ./ibm_cloud_pak/pak_extensions/uninstall/uninstall-edge-computing.sh <cluster-name>