Create a pipeline and release in the Google Cloud console

This page shows you how to use the Google Cloud console to create a Cloud Deploy delivery pipeline, and then create a release for that pipeline.

In this quickstart, you'll do the following:

  1. Create two GKE clusters or configure two Cloud Run services.

  2. Create a delivery pipeline and two targets using the Google Cloud console.

  3. Instantiate your delivery pipeline by creating a release using the Google Cloud console.

    After you create this release, the application is automatically deployed to the target.

  4. See the results in Google Cloud console.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Cloud Deploy, Cloud Build, GKE, Artifact Registry, Cloud Run, and Cloud Storage APIs.

    Enable the APIs

  5. Install the Google Cloud CLI.
  6. To initialize the gcloud CLI, run the following command:

    gcloud init
  7. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  8. Make sure that billing is enabled for your Google Cloud project.

  9. Enable the Cloud Deploy, Cloud Build, GKE, Artifact Registry, Cloud Run, and Cloud Storage APIs.

    Enable the APIs

  10. Install the Google Cloud CLI.
  11. To initialize the gcloud CLI, run the following command:

    gcloud init
  12. If you already have the CLI installed, make sure you're running the latest version:

    gcloud components update
    

Create your runtime environment

If you're deploying to Cloud Run, you can skip this command.

For GKE, create two clusters: quickstart-cluster-for-console-staging and quickstart-cluster-for-console-prod, with default settings. The clusters' Kubernetes API endpoints must be network-reachable from the public internet. GKE clusters are externally accessible by default.

gcloud container clusters create-auto quickstart-cluster-for-console-staging \
                 --project=PROJECT_ID \
                 --region=us-central1 && \
gcloud container clusters create-auto quickstart-cluster-for-console-prod \
                 --project=PROJECT_ID \
                 --region=us-central1

Create a delivery pipeline and two targets

You can use Cloud Deploy to create a delivery pipeline and targets based on configuration specified in one or more YAML files. But you can also create a delivery pipeline using the Google Cloud console.

In this section, you use Google Cloud console to create a delivery pipeline and two targets. When you use Google Cloud console, you don't need to create any YAML files; Cloud Deploy creates your skaffold.yaml and manifest for you.

  1. In the Google Cloud console, navigate to the Cloud Deploy main page.

    Open the Delivery pipelines page

  2. Click Create

    Cloud Deploy main page in the Google Cloud console

    The Create a delivery pipeline form is displayed.

  3. In the Pipeline name field, replace the default text with in-console-quickstart-pipeline.

  4. Optionally, enter a description for this delivery pipeline.

  5. In the Region drop-down, select us-central1.

  6. Select your runtime.

    If you're deploying to GKE, select Google Kubernetes Engine. Otherwise, select Cloud Run.

  7. Create your targets:

    GKE

    1. Under New target, in the Target name field, replace the default text with console-staging.

    2. From the Kubernetes Engine cluster drop-down, select quickstart-cluster-for-console-staging.

    3. Click Done.

    4. Click Add target.

      Replace the default text for Target name with console-prod.

    5. Select quickstart-cluster-for-console-prod from the Kubernetes Engine cluster drop-down.

    6. Select Require approval for rollouts.

      For this quickstart, we're requiring approval on the second target but not on the first target.

    7. Click Create to create this delivery pipeline.

      Cloud Deploy main page in the Google Cloud console

    Cloud Run

    1. Under New target, in the Target name field, replace the default text with console-staging.

    2. From the Region drop-down, select us-central1.

    3. Click Done.

    4. Click Add target.

    5. Replace the default text for Target name with console-prod.

    6. Activate the Require approval for rollouts checkbox for this target.

      For this quickstart, we're requiring approval on the second target but not on the first target.

    7. Click Create to create this delivery pipeline.

      Cloud Deploy main page in the Google Cloud console

    You now have a delivery pipeline with two targets, ready to create a release.
    The pipeline's page is displayed, showing both targets, with no rollouts.

    New delivery pipeline, created in the Google Cloud console

Create a release

Now that you have a delivery pipeline, with two targets, pointing to two GKE clusters or two Cloud Run services, you can create a release to deploy your application to the first target.

  1. If you're not already on the delivery pipeline page, showing the new delivery pipeline in-console-quickstart-pipeline, navigate there now.

    The pipeline visualization is shown, with no rollouts.

  2. Click the Create release button.

    The Create a release dialog is shown. Most of the fields are pre-populated. Keep these default values.

    The **Create a Release** dialog

    You can click the View manifest button to view the manifest the automatically generated manifest, for either target, and you can click View Skaffold file to view the generated skaffold.yaml. You can also edit them, but for this quickstart leave them as they are.

  3. Optionally, add a description for this release, in the Description field.

  4. Click Create to start the release.

    The rollout details page is shown, for the rollout to the first target, and you can watch the progress of this rollout. It will take a few minutes to complete. It may take a few seconds for the rollout to start.

  5. After the first rollout finishes, click the delivery pipeline name to go to the delivery pipeline page.

    Click the pipeline name to view the visualization

    The pipeline visualization is shown, with the rollout complete to the first target.

    Delivery pipeline visualization with first target complete

  6. Click Promote to start the rollout to the next target.

    The Promote dialog is shown.

  7. Keep the default values, add a Rollout description if you want, then click Promote.

    Because we selected Require approval for rollouts when we created the second target, this promotion is waiting for approval.

  8. Click Review, in the delivery pipeline visualization.

    The approval page is shown.

    Required approval for promotion to second target

  9. Click Review again, and in the approval dialog, click Approve.

    The rollout is started for the second target. You can click the delivery pipeline name again to watch the progress in the pipeline visualization.

When the second rollout is finished, the application is deployed in the second target, and your delivery pipeline has completed.

Completed delivery pipeline.

Clean up

To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.

  1. Delete the GKE clusters or Cloud Run services:

    GKE

    gcloud container clusters delete quickstart-cluster-for-console-staging --region=us-central1 --project=PROJECT_ID \
    && gcloud container clusters delete quickstart-cluster-for-console-prod --region=us-central1 --project=PROJECT_ID
    

    Cloud Run

    gcloud run services delete in-console-quickstart-pipeline-target-1 --region=us-central1 --project=PROJECT_ID \
    && gcloud run services delete in-console-quickstart-pipeline-target-2 --region=us-central1 --project=PROJECT_ID
    
  2. From the delivery pipeline page, click Delete to delete the delivery pipeline, the release, and rollouts.

    Type the pipeline name in the field provided, and click Confirm to finish deleting the resources.

    Confirmation dialog to delete pipeline and child resources. target

  3. Delete both targets:

    gcloud deploy targets delete console-staging --region=us-central1  && \
    gcloud deploy targets delete console-prod --region=us-central1
    
  4. Delete the Cloud Storage buckets that Cloud Deploy created.

    One ends with _clouddeploy, and the other is [region].deploy-artifacts.[project].appspot.com.

    Open the Cloud Storage browser page

That's it, you completed this quickstart!

What's next