This guide shows you how to deploy full Playground environment on Google Cloud Platform (GCP) environment. Alternatively, you can automate Playground environment deployment with Cloud Build as described in readme.
GCP User account (Note: You will find the instruction “How to create User account” for your new project)
Ensure that the account has at least following privileges:
Google Cloud Storage bucket for saving deployment state
DNS name for your Playground deployment instance
OS with installed software listed below:
Playground uses terraform.tfvars located in playground/terraform/environment/environment_name to define variables specific to an environment (e.g., prod, test, staging).
environment_name) to define a new environment and place configuration files into it:terraform.tfvars environment variables:project_id = "project_id" #GCP Project ID network_name = "network_name" #GCP VPC Network Name for Playground deployment gke_name = "playground-backend" #Playground GKE Cluster name region = "us-east1" #Set the deployment region location = "us-east1-b" #Select the deployment location from available in the specified region state_bucket = "bucket_name" #GCS bucket name for Beam Playground temp files redis_name = "playground_redis" #Choose the name for redis instance min_count = 2 #Min node count for GKE cluster max_count = 6 #Max node count for GKE cluster
state.tfbackend environment variables:bucket = "bucket_name" #input bucket name - will be used for terraform tfstate file
gcloud init
gcloud auth application-default login
./gradlew playground:terraform:InitInfrastructure -Pproject_environment="environment_name" -Pdns-name="playground.zone"
Where playground.zone - chosen DNS for Playground
java.playground.zone python.playground.zone scio.playground.zone go.playground.zone router.playground.zone playground.zone
Where “playground.zone” is the registered DNS zone
More about DNS zone registration
More about A records in DNS
gcloud auth configure-docker `chosen_region`-docker.pkg.dev
gcloud container clusters get-credentials --region `chosen_location` `gke_name` --project `project_id`
Start the following command from the top level repository folder (“beam”) to deploy the Payground infrastructure:
./gradlew playground:terraform:gkebackend -Pproject_environment="environment_name" -Pdocker-tag="tag" -Pdns-name="playground.zone" -Psdk-tag=2.43.0
Where tag - image tag for backend, playground.zone - chosen DNS for Playground, Psdk-tag - current BEAM version
During script execution, a Google managed certificate will be created. Provisioning might take up to 60 minutes.
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION playground default 1 your time deployed playground-2.44.0-SNAPSHOT 1.0.0
NAME AGE STATUS GCP Project time Active