IBM Cloud Docs
Automating your GCP location setup with a Schematics template

Automating your GCP location setup with a Schematics template

Automate your GCP setup with templates that use IBM Cloud® Schematics to create a Satellite location, provision hosts in your GCP account, and set up the Satellite location control plane for you.

You can clone and modify these Terraform templates from the Satellite Terraform GitHub repository. Or, you can manually attach GCP hosts to a Satellite location.

For IBM Cloud Satellite to perform actions on your behalf in a cloud provider, you must provide credentials to the cloud provider. The credentials that you provide are stored and encrypted in etcd of the Satellite location management plane. For more information, see Securing your data.

Creating your location with a Schematics template

Before you begin, make sure that you have the correct IBM Cloud permissions to create locations, including to Satellite and Schematics. To create the template and manage its resources, Satellite automatically creates an IBM Cloud IAM API key. You can optionally provide the value of an existing API key that has the correct permissions in the same account.

Do not reuse the same name for multiple locations, even after the other location is deleted. If you use the same name 5 times or more within 7 days, you might reach the Let's Encrypt Duplicate Certificate rate limit.

  1. In your GCP cloud provider, set up your account credentials.
  2. From the Satellite console, click Create location.
  3. In the Get started section, click GCP Quick Start.
  4. Upload your GCP credentials file.
  5. Review the GCP environment details that are automatically populated. By default, enough VMs are created to provide hosts for 1 small location that can run about 2 demo clusters. To change the subscription, region, instance type, or number of VMs for the hosts, click the Edit pencil icon.
  6. Review the Satellite location details. If you edited the GCP environment details, you might want to click the Edit pencil icon to change details such as the description, API key, or IBM Cloud multizone region that the location is managed from.
  7. In the Summary pane, review the cost estimate.
  8. Click Create location. Your location might take about 30 minutes to finish provisioning.
  9. Optional: To review the provisioning progress, review the logs in the Schematics workspace that is automatically created for you.
    1. Click Manage in Schematics. If you see an error, navigate to the Schematics workspaces console and click the name of your workspace, such as us.east.cartOrder....
    2. From the Activity tab, find the current activity row and click View log to review the log details.
    3. Wait for the Schematics action to finish and the workspace to enter an Active state.
  10. Optional: If you need to setup SSH access to your hosts in GCP, see Choose your access method in the Google documentation. GCP recommends using the OS Login technology. You can also use the gcloud CLI or the built-in SSH client in the web UI to access your VMs.

The GCP VPC created by the Quick Start template does not have port 22 open externally for SSH and so you might need to add a firewall rule before you can use SSH. If you add a firewall rule to open port 22 externally, you must remove this firewall rule before you specify the Destroy resources option in Schematics to clean up your location.

Well done, your Satellite location is creating! You can review the Satellite console to see when your location is in a Normal state and ready to use.

What does this template create?

The following resources are created by the template in the resource group of your GCP cloud subscription.

  • 1 virtual network that spans the region.
  • 1 network security group to meet the host networking requirements for Satellite.
  • 1 virtual machine running RHEL 8 for each host that you specified, spread evenly across the region. By default, 6 virtual machines are created.
  • 1 network interface for each virtual machine.
  • 1 disk for each virtual machine.

The following resources are created by the template in your IBM Cloud account.

  • 1 Satellite location.
  • 3 Satellite hosts that represent the virtual machines in GCP, attached to the location and assigned to the Satellite location control plane.
  • 3 Satellite hosts that represent the virtual machines in GCP, attached to the location, unassigned, and available to use for services, such as a Red Hat OpenShift cluster. If you added more than 6 hosts, the additional hosts are unassigned and available for use in the control plane or by services.

If you are using this template for demonstration purposes, do not assign all your hosts to your control plane. Hosts that are assigned to the control plane cannot be used for other purposes, such as worker nodes for your cluster. For more information, see Understanding Satellite locations.

Google Cloud Platform credentials

Retrieve the Google Cloud Platform (GCP) credentials that Satellite can use to create Satellite resources in your GCP cloud on your behalf.

  1. Create a service account and service account key with at least the required GCP permissions. As part of creating the service account, a JSON key file is downloaded to your local machine.
  2. Open the JSON key file on your local machine, and verify that the format matches the following example. You can provide this JSON key file as your GCP credentials for actions such as creating a Satellite location.
    {
        "type":"string",
        "project_id":"string",
        "private_key_id": "string",
        "private_key": "string",
        "client_email": "string",
        "client_id": "string",
        "auth_uri": "string",
        "token_uri": "string",
        "auth_provider_x509_cert_url": "string",
        "client_x509_cert_url": "string"
    }
    

I created a Satellite location, what's next?

Now that your Satellite location is set up, you are ready to start using IBM Cloud services.

  1. Add compute capacity to your location by attaching more hosts to the location so that you can run Satellite-enabled IBM Cloud service.
  2. Create a Satellite-enabled IBM Cloud service, such as a Red Hat OpenShift cluster. You assign the additional hosts that you previously attached as worker nodes to provide the compute power for the cluster. You can even register existing Red Hat OpenShift clusters to your location to use as deployment targets.
  3. Manage your applications with Satellite Config.
  4. Create Satellite cluster storage templates.
  5. Learn more about the Satellite Link component and how you can use endpoints to manage the network traffic between your location and IBM Cloud.

Need help? Check out Getting support where you can find information about cloud status, issues, and logging; contacting support; and setting your email notification preferences for IBM Cloud platform-related items.