Win $20,000. Help build the future of education. Answer the call. Learn more

Connect and communicate with a database service from an IBM Cloud Satellite location

In this tutorial, you get hands-on experience with the IBM Cloud Satellite distributed cloud solution. With the help of Satellite Link endpoints, you can connect to a service, server, or application that runs outside of the location from a client that runs within your Satellite location, or vice versa. You learn how to link a database service on the IBM Cloud to your Satellite location and verify the connection by sending and receiving data.

Prerequisites

  • An IBM Cloud Pay-As-You-Go or Subscription account. You must be the IBM Cloud account owner or have Administrator access.
  • An existing IBM Cloud Object Storage service instance.

Estimated time

It will take you approximately 30 minutes to complete this tutorial.

Steps

1. Create your location

In IBM Cloud Satellite, a location represents a data center that you can fill with your own infrastructure resources to run IBM Cloud services or other workloads on your infrastructure.

  • In the Satellite Locations dashboard, click Create a Satellite location.

  • In the Satellite location section of the page, click Edit.

  • Within the Name field, enter a custom name for your Satellite location.

  • From the Managed from list, select the region that you want to use to manage your Satellite location.

  • Click Done editing.

  • Click Create location.

2. Attach hosts from your on-premises data centers

Hosts are machines that reside within your infrastructure. In your on-premises environment, identify or create at least three host machines that meet the minimum hardware requirements and are located in physically separate racks (these are called zones in Satellite).

Follow the steps in the IBM Cloud Satellite product documentation to attach your hosts.

3. Assign your hosts to the Satellite location control plane

  • From the actions menu of each host machine that you attached, click Assign host.

  • For the Cluster, select Control plane.

  • For the Zone, select a unique zone such as zone-1.

  • Click Assign host.

    Note: When you assign the hosts to the control plane, IBM bootstraps your machine. This process might take a few minutes to complete. During the bootstrapping process, the Health of your machine changes from Ready to Provisioning.

  • Repeat these steps for each host. Make sure that you assign each host to a different zone so that you spread all three hosts across all three zones, such as zone-1, zone-2, and zone-3.

  • From the Hosts tab, verify that your hosts are successfully assigned to the Satellite control plane. The assignment is successful when an IP address is added to your host and the Health status changes to Normal.

4. Create the OpenShift cluster

To create the Red Hat OpenShift on IBM Cloud cluster that will live on your Satellite location, follow the steps located in the product documentation.

Now you can deploy an application of your choice.

A cloud endpoint allows you to securely connect to a service, server, or app that runs outside of the location from a client within your Satellite location. For this tutorial, you first create a PostgreSQL database service and then link that service to your Satellite location.

5.1 Create the database service

  • Select the Databases for PostgreSQL service from the IBM Cloud catalog.

  • Choose Databases for PostgreSQL. Click Create.

  • Name your database and click Create.

  • After the service is ready, click Service credentials in the navigation pane.

  • Select the New credential option and create credentials.

  • Copy the hostname, port, username, and password, as shown in the following screen capture image. You will use these service credentials to create an endpoint link for the Satellite location.

    Close up view of the service credentials with sample password, username, hostname, and port highlighted

  • Select the Link endpoints tab, as shown in the following screen capture image.

    Close up view of the Link endpoints tab

  • Click Create an endpoint.

    Screen capture of where the create an endpoint button is located

  • On the Create an endpoint page, select Cloud as your destination resource.

    Screen capture image of where the Cloud destination resource option is located

  • Click Next.

  • Type a name in the Endpoint name field.

  • In the Destination URL or IP field, paste the hostname that you copied when you created the PostgreSQL service credentials.

  • In the Destination port field, paste the port number that you copied when you created PostgreSQL service credentials.

    Screen capture image of where to fill in the details that you copied from credentials

  • Click Next.

  • In the TLS options section, leave the default values, as demonstrated in the following screen capture image, and click Next.

    Screen capture image of the TLS options section

  • Click Create endpoint.

    Screen capture image of the Connections settings (optional) section where the Create endpoint button is located

It takes few moments to create an endpoint. After the endpoint is created, you can view it by clicking the Endpoints tab.

Screen capture image of the Endpoints dashboard with a new endpoint highlighted

Note: You can follow the same procedure for other IBM Cloud services.

6. Send data to the PostgreSQL database by using the Satellite endpoint

Be sure that your Satellite endpoint is enabled, as shown in the following screen capture. If the endpoint is not enabled, you will not be able to send or receive data by using it.

View of the Endpoints dashboard with the Status of the new endpoint showing as Enabled

  • Copy the Satellite endpoint link that you created in Step 5.2.

  • Copy the hostname, port, username, and password from the credentials that you created in Step 5.1.

  • Go to the Satellite Link example GitHub repo. Follow the steps in that repo to send and receive data by using the Satellite endpoint.

    Screen capture of the data flow metrics for the sample application

Summary

With IBM Cloud Satellite, you can quickly address unforeseen challenges, leverage cloud computing benefits in any location, and innovate quickly. Now that you know how a Satellite Link works, try something more complex. Check out the code pattern to build an IoT application at your location by using IBM Cloud Pak for Data and IBM Cloud Satellite.