Chapter 3. Managing Fuse Online on OCP

After you install Fuse Online on OpenShift Container Platform (OCP) on-site, you can use Prometheus to monitor integration activity, and you can set up periodic Fuse Online backups, which you can use to restore Fuse Online environments. As needed, you can upgrade Fuse Online, uninstall Fuse Online, or delete an OCP project that contains Fuse Online.

See the following topics for details:

3.1. Monitoring Fuse Online integrations on OCP with Prometheus

You can use Prometheus to monitor Fuse Online infrastructure and Fuse Online integrations. To do this, enable the ops add-on in the syndesis custom resource. Enabling ops exposes Fuse Online for monitoring by a Prometheus instance that is installed in a separate OpenShift project. You can enable the ops add-on before or after you install Fuse Online.

The procedure here is for changing a Fuse Online configuration to enable Prometheus. To enable Prometheus before you install Fuse Online, see Descriptions of custom resource attributes that configure Fuse Online.

Prerequisites

  • Fuse Online is installed and running on OCP on-site.
  • The oc client tool is installed and it is connected to the OCP cluster in which Fuse Online is installed.
  • A user with cluster administration permissions gave you permission to install Fuse Online in any project that you have permission to access in the cluster.
  • You have a Red Hat developer account for which you know your user name and password. The installation script prompts you for these credentials so it can authenticate you against https://developers.redhat.com. For details about creating an account, see Accessing and Configuring the Red Hat Registry.

Procedure

  1. Log in to OpenShift with an account that has permission to install Fuse Online. For example:

    oc login -u developer -p developer

  2. Switch to the project in which Fuse Online is running. For example:

    oc project my-fuse-online-project

  3. Edit the syndesis custom resource:

    1. Invoke the following command, which typically opens the resource in an editor:

      oc edit syndesis

    2. Ensure that the following lines are in the resource. Edit as needed.

      spec:
        addons:
          ops:
            enabled: true
    3. Save the resource.

Results

Saving this change to the syndesis custom resource triggers syndesis-operator to install new OpenShift resources. Redeployment of syndesis-server is not needed.

Next step

Install the Application Monitoring Operator, which installs Prometheus and Grafana.

Additional resources

3.2. Backing up a Fuse Online environment

You can configure Fuse Online to periodically back up:

  • The internal PostgreSQL database in which Fuse Online stores connections and integrations.
  • OpenShift resources that syndesis-operator creates and that are needed to run Fuse Online. This includes, but is not limited to, configuration maps, deployment configurations, and service accounts.

You can configure backups for a Fuse Online environment before you install Fuse Online or you can change the configuration of a Fuse Online environment to enable backups.

When Fuse Online is configured to perform backups, Fuse Online zips data into one file and uploads that file to an Amazon S3 bucket that you specify. You can apply a backup to a new Fuse Online environment (no connections or integrations defined) to restore the Fuse Online environment that was backed up.

Prerequisites

  • OCP is running on-site.
  • The oc client tool is installed and connected to the OCP cluster in which Fuse Online is or will be running.
  • A user with cluster administration permissions gave you permission to install Fuse Online in any project that you have permission to access in the cluster.
  • You have an AWS access key and an AWS secret key. For details about obtaining these credentials, see the AWS documentation for Managing Access Keys for IAM Users.
  • You know the AWS region where the S3 bucket that you want to upload to resides.
  • You know the name of the S3 bucket that you want to upload backups to.

Procedure

  1. Log in to OpenShift with an account that has permission to install Fuse Online. For example:

    oc login -u developer -p developer

  2. Switch to the OpenShift project that is or will be running the Fuse Online environment for which you want to configure backups. For example:

    oc project my-fuse-online-project

  3. Create an OpenShift secret. In the command line:

    • Specify syndesis-backup-s3 as shown in the following command format.
    • Replace the AWS variables with your AWS access key, AWS secret key, AWS region in which the bucket resides, and the name of the bucket.

      Use the following command format to create the secret:

      oc create secret generic syndesis-backup-s3 \
      --from-literal=secret-key-id="my-aws-access-key" \
      --from-literal=secret-access-key="my-aws-secret-key" \
      --from-literal=region="aws-region" \
      --from-literal=bucket-name="aws-bucket-name"

      This secret must be present when the backup job is running.

  4. If Fuse Online is not yet installed, you must edit the default-cr.yml file to enable backups. See Editing the syndesis custom resource before installing Fuse Online. After Fuse Online is installed, there will be backup jobs according to the schedule that you specified in the custom resource.

    If Fuse Online is running, you must edit the syndesis custom resource:

    1. Invoke the following command, which opens the syndesis custom resource in an editor:

      oc edit syndesis

    2. Add the following under spec::

      backup:
        schedule: my-backup-interval

      Replace my-backup-interval with the desired duration between backups. To determine how to specify the interval between backups, consult the following resources:

      • cron pre-defined schedules
      • cron intervals

        Do not specify the @ sign in front of the interval. For example, to configure daily backups, the custom resource would contain something like this:

        apiVersion: syndesis.io/v1beta1
        kind: Syndesis
        metadata:
          name: app
        spec:
          backup:
            schedule: daily
  5. Save the file.

    This adds a backup job to syndesis-operator.

Result

If Fuse Online was already running, there is now a Fuse Online backup job according to the schedule that you defined.

Next steps

If Fuse Online needs to be installed, edit the default-cr.yml file to enable any other desired features or set any other parameters. When the default-cr.yml file has all the settings that you want, install Fuse Online in the project that you specified when you created the OpenShift secret.

3.3. Restoring a Fuse Online environment

In a new Fuse Online environment, in which you have not yet created any connections or integrations, you can restore a backup of a Fuse Online environment. After you restore a Fuse Online environment, you must edit the restored connections to update their passwords. You should then be able to publish the restored integrations.

Prerequisites

  • OCP is running on-site.
  • The oc client tool is installed and connected to the OCP cluster in which you want to restore a Fuse Online environment.
  • A user with cluster administration permissions gave you permission to install Fuse Online in any project that you have permission to access in the cluster.
  • There is a Fuse Online environment that was configured to periodically back up data and upload the data to Amazon S3.
  • The Fuse Online release number, for example, 7.6, is the same for the Fuse Online environment that was backed up and the Fuse Online environment in which you want to restore the backup.
  • You have permission to access the AWS bucket that contains the Fuse Online backups.
  • The Fuse Online environment in which you want to restore a backup is a new Fuse Online installation. In other words, there are no connections or integrations that you defined. If you want to restore Fuse Online in a project that has a Fuse Online environment with connections and integrations, then you must uninstall that Fuse Online environment and install a new Fuse Online environment.

Procedure

  1. Download the desired backup file from Amazon S3. Details for doing this are in the AWS documentation for How Do I Download an Object from an S3 Bucket?
  2. Extract the content of the zip file. For example, the following command line unzips the 7.6-2020-03-15-23:30:00.zip file and copies the content into the /tmp/fuse-online-backup folder:

    unzip 7.6-2020-03-15-23:30:00.zip -d /tmp/fuse-online-backup

  3. Decode the Fuse Online database, for example:

    base64 -d /tmp/fuse-online-backup/syndesis-db.dump > /tmp/fuse-online-backup/syndesis-db
  4. Switch to the OpenShift project that is running the new Fuse Online environment. For example, if the new Fuse Online environment is in the my-fuse-online-project, then you would invoke the following command:

    oc project my-fuse-online-project

    The remainder of this procedure assumes that you have switched to the project that contains the new Fuse Online environment.

  5. Obtain the name of the database pod.

    If the restored Fuse Online environment uses the provided, internal, PostgreSQL database, invoke the following command to obtain the name of the database pod:

    oc get pods -l deploymentconfig=syndesis-db -o jsonpath='{.items[*].metadata.name}'

    If the restored Fuse Online environment uses an external database, it is assumed that you know how to obtain the name of the pod for that database.

    In the remaining commands, where you see DATABASE_POD_NAME, insert the name of the database pod for the restored Fuse Online environment.

  6. Scale down the components that are accessing the database in any way.

    1. Scale down syndesis-operator so that other components can be scaled down:

      oc scale dc syndesis-operator --replicas 0

    2. Scale down the syndesis-server and syndesis-meta components:

      oc scale dc syndesis-server --replicas 0
      oc scale dc syndesis-meta --replicas 0

  7. Send the database backup file to the Fuse Online database pod:

    oc cp /tmp/fuse-online-backup/syndesis-db DATABASE_POD_NAME:/tmp/syndesis-db
  8. Open a remote shell session in the Fuse Online database pod:

    oc rsh DATABASE_POD_NAME

  9. Invoke the following commands to restore the Fuse Online database.

    If a psql command prompts for the database password, and the restored Fuse Online environment uses the provided, internal PostgreSQL database, you can find the password in the POSTGRESQL_PASSWORD environment variable in the syndesis-db deployment configuration. If the restored Fuse Online environment uses an external database, then it is assumed that you know the password.

    cd /tmp
    psql -c 'DROP database if exists syndesis_restore'
    psql -c 'CREATE database syndesis_restore'
    pg_restore -v -d syndesis_restore /tmp/syndesis-db
    psql -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'syndesis'"
    psql -c 'DROP database if exists syndesis'
    psql -c 'ALTER database syndesis_restore rename to syndesis'

    Fuse Online should now be restored. You can end the RSH session:

    exit

  10. Scale up the Fuse Online components:

    oc scale dc syndesis-operator --replicas 1

    Scaling syndesis-operator to 1 should bring up the other pods that were scaled down. However, if that does not happen, you can scale them up manually:

    oc scale dc syndesis-server --replicas 1
    oc scale dc syndesis-meta --replicas 1

  11. The server tries to start each restored integration but you need to update connections first. Consequently, ensure that the restored integrations are not running:

    1. Obtain the Fuse Online console route:

      echo "https://$(oc get route/syndesis -o jsonpath='{.spec.host}' )"
    2. Log in into the Fuse Online console with an OpenShift user account that has permission to install Fuse Online.
    3. Display the list of integrations and ensure that all integrations are stopped. If an integration is running, stop it.
  12. For each connection that has a password, you need to update the connection to have the correct password for this Fuse Online environment. The following steps show how to do this for the provided PostgresDB connection.

    1. In the OpenShift console for the project in which this restored Fuse Online environment is running, retrieve the password for the PostgresDB connection. In the syndesis-db deployment, the password is available in the environment variables.
    2. In the Fuse Online console, display the connections.
    3. Edit the PostgresDB connection.
    4. In the connection details for the PostgresDB connection, paste the retrieved password in the Password field.
  13. For each integration, confirm that there are no Configuration Required indicators. If there are, edit the integration to resolve the issues. When all steps in the integration are correct, publish the integration.

    If Fuse Online keeps rolling an integration back to a Stopped state right after the Build step, delete the deployment, ensure that no configuration is required, and try publishing the integration again.

    You can safely ignore the following message if you see it in the log:

    Error performing GET request to https://syndesis-my-fuse-online-project.my-cluster-url/api/v1/metrics/integrations

3.4. Upgrading Fuse Online on OCP

To upgrade Fuse Online on OCP on-site, download the latest Fuse Online release, obtain permission to upgrade Fuse Online from a cluster administrator, and run the update script.

From time to time, fresh application images, which incorporate patches and security fixes, are released for Fuse Online. You are notified of these updates through Red Hat’s errata update channel. You can then upgrade your Fuse Online images.

The upgrade procedure for the following upgrades is the same:

  • From Fuse Online 7.5 to Fuse Online 7.6
  • From a Fuse Online 7.6 version to a newer Fuse Online 7.6 version

Prerequisites

  • You installed and are running version 7.5 of Fuse Online on OCP on-site. OR, you installed and are running a version of 7.6 of Fuse Online on OCP on-site and you want to upgrade to fresh application images.

    For earlier versions:

    • If you are running version 7.4 of Fuse Online on OCP, then you must upgrade to 7.5 and then you can upgrade to 7.6.
    • If you are running version 7.3 of Fuse Online on OCP, then you must upgrade to 7.4 and then you can upgrade to 7.5.
    • If you are running version 7.2 of Fuse Online on OCP, then you must upgrade to 7.3.
    • If you are running version 7.1 of Fuse Online on OCP, then you must upgrade to 7.2.
  • You installed the oc client tool and it is connected to the OCP cluster in which Fuse Online is installed.
  • You have cluster administration permissions, which are required for the first five steps in this procedure.

Procedure

  1. A cluster administrator downloads the Fuse Online package and grants permission for a user to upgrade Fuse Online in a particular project:

    1. Download the package containing the Fuse Online installation scripts from the following location:

      https://github.com/syndesisio/fuse-online-install/releases/tag/1.9

      Unpack the downloaded archive at a convenient location on your file system. The fuse-online-install-1.9 directory contains the scripts and supporting files for upgrading Fuse Online.

    2. Change to the directory that contains the extracted archive. For example:

      cd fuse-online-install-1.9

    3. Log in to OpenShift with a cluster administration account, for example:

      oc login -u admin -p admin

    4. Change to the OpenShift project in which Fuse Online needs to be upgraded, for example:

      oc project fuse-online-project

    5. Grant permission for upgrading Fuse Online in just this project. For example, the following command grants permission for upgrading Fuse Online to the developer user. After the cluster administrator runs this command, the developer user can upgrade Fuse Online in only this project, which is fuse-online-project, in this example:

      bash install_ocp.sh --grant developer

  2. The user who was granted permission to upgrade Fuse Online performs the upgrade:

    1. Log in to OpenShift, for example:

      oc login -u developer

    2. Switch to the project in which you want to upgrade Fuse Online, for example:

      oc project fuse-online-project

    3. To check which version you are about to upgrade to, run the update script with the --version option, as follows:

      bash update_ocp.sh --version

    4. Invoke the update script as follows:

      bash update_ocp.sh

      To learn more about the script, invoke bash update_ocp.sh --help.

      During and after an infrastructure upgrade, existing integrations continue to run with the older versions of Fuse Online libraries and dependencies.

  3. Upgrade Fuse Online integrations that are running as follows:

    1. In Fuse Online, select the integration that you want to upgrade.
    2. Select Edit.
    3. Select Publish to republish the integration.

    Republishing the integration forces a rebuild that uses the latest Fuse Online dependencies.

3.5. Uninstalling Fuse Online from an OCP project

You can uninstall Fuse Online from an OCP project without deleting the project nor anything else in that project. After uninstalling Fuse Online, integrations that are running continue to run but you can no longer edit or republish them.

Prerequisite

  • You have an OCP project in which Fuse Online is installed.
  • You exported any integrations that you might want to use in some other OpenShift project in which Fuse Online is installed. If necessary, see Export integrations.

Procedure

  1. Log in to OpenShift with an account that has permission to install Fuse Online. For example:

    oc login -u developer -p developer

  2. Switch to the OpenShift project that is running the Fuse Online environment that you want to uninstall. For example:

    oc project my-fuse-online-project

  3. Delete Fuse Online infrastructure:

    oc delete syndesis app

  4. Delete syndesis-operator DeploymentConfig and ImageStream resources:

    oc delete dc/syndesis-operator
    oc delete is/syndesis-operator

3.6. Deleting an OCP project that contains Fuse Online

Deleting an OpenShift project in which Fuse Online is installed deletes everything in the project. This includes all integrations that have been defined as well as all integrations that are running.

Prerequisites

  • You have an OCP project in which Fuse Online is installed.
  • You exported any integrations that you might want to use in some other OpenShift project in which Fuse Online is installed. If necessary, see Exporting integrations.

Procedure

Invoke the oc delete project command. For example, to delete an OpenShift project whose name is fuse-online-project, enter the following command:

oc delete project fuse-online-project