Skip to content

Latest commit

 

History

History

gke-provision-and-deploy-workflow

Deploy a Gatsby site to Google Cloud Platform with Terraform

This sample workflow deploys a simple Gatsby site to Google Cloud Platform (GCP). The workflow provisions a Google Kubernetes Engine (GKE) cluster on GCP using Terraform, and deploys the app to the cluster.

The workflow appears on the Workflows page in your Nebula web interface. If you don't see it there, add the workflow from our examples repo on GitHub.

Prerequisites

Before you run the workflow, make sure you have access to the following:

Run the workflow

Follow these steps to run the workflow:

  1. Add your Slack authentication token to the workflow as a secret.
    1. Click Edit > Secrets.
    2. Click Define new secret and use the following values:
      • KEY: slacktoken
      • VALUE: Enter your Slack authentication token
  2. Add your GCP service account key as a secret.
    1. Click Edit > Secrets.
    2. Click Define new secret and use the following values:
      • KEY: credentials
      • VALUE: Enter your base64 encoded GCP service account key
  3. Configure your workflow parameters.
    1. Click Run and enter the following parameters:
      • project: Enter the name of your GCP project
      • slack_channel: Enter the name of the Slack channel you'd like to notify when the workflow completes. For example, #nebula-workflows.
      • slack_message: Enter a message for the Slack notification. For example, K8s cluster successfully provisioned with Nebula!
      • terraform_state_bucket: The name of the Google Storage bucket where Terraform stores its state. The name must be globally unique.
  4. Click Run workflow and wait for the workflow run page to appear.

Open the Gatsby site in a browser

To find the URL for your Gatsby site:

  1. From your GCP console, click Kubernetes Engine > Services and Ingress.
  2. Copy the endpoint for nebula-example and paste the URL into a browser.

Congratulations! You've deployed an application to GCP using Terraform.

Useful topics: