MakarkinSAkvelon commented on code in PR #23928:
URL: https://github.com/apache/beam/pull/23928#discussion_r1016482571


##########
playground/terraform/README.md:
##########
@@ -16,74 +16,118 @@
     specific language governing permissions and limitations
     under the License.
 -->
+# Playground deployment on GCP
 
-# Requirements
+## Prerequisites:
 
-The following items need to be setup for the Playground cluster deployment on 
GCP:
+### Following items need to be setup for Playground deployment on GCP:
+1. [GCP project](https://cloud.google.com/)
 
-* [GCP account](https://cloud.google.com/)
-* [`gcloud` command-line tool](https://cloud.google.com/sdk/gcloud) and 
required setup i.e. login
-* [Terraform](https://www.terraform.io/downloads.html) tool
-* [Docker](https://www.docker.com/get-started)
+2. [GCP User 
account](https://cloud.google.com/appengine/docs/standard/access-control?tab=python)
 _(Note: You will find the instruction "How to create User account" for your 
new project)_
 
-# Deployment steps
+***Google Cloud preparation steps:***
+After creating or identified an existing project for deployment, please be 
sure that your account has at least following privileges:
+   - App Engine Admin
+   - App Engine Creator
+   - Artifact Registry Administrator
+   - Cloud Memorystore Redis Admin
+   - Compute Admin
+   - Create Service Accounts
+   - Kubernetes Engine Admin
+   - Quota Administrator
+   - Role Administrator
+   - Security Admin
+   - Service Account User
+   - Storage Admin
+   - Cloud Datastore Index Admin
 
-## 0. Create GCS bucket for state
+3. [Google Cloud Storage 
bucket](https://cloud.google.com/storage/docs/creating-buckets) for saving 
deployment state
 
-```bash
-$ gsutil mb -p ${PROJECT_ID} gs://state-bucket-name
-$ gsutil versioning set on gs://state-bucket-name
-```
+4. DNS name for your Playground deployment instance
 
-## 1. Create new environment
+***Development environment preparation steps:***
 
-To provide information about the terraform backend, run the following commands
+During the Operation system preparation steps, you will need to install Java, 
Kubernetes, HELM, Docker, Terraform, gcloud CLI
 
-* New environment folder
+* [Java](https://adoptopenjdk.net/)
+* [Kubernetes Command Line 
Interface](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/)
+* [HELM](https://helm.sh/docs/intro/install/)
+* [Docker](https://docs.docker.com/engine/install/)
+* [Terraform](https://www.terraform.io/downloads)
+* [gcloud CLI](https://cloud.google.com/sdk/docs/install-sdk)
 
-```bash
-mkdir /path/to/beam/playground/terraform/environment/{env-name}
-```
+After Development environment preparation steps completed, navigate to the 
"beam" folder in your development environment.
 
-* Backend config
+# Deployment environment:
+Playground uses `terraform.tfvars` located in 
`playground/terraform/environment/environment_name` to define all 
infrastructure environment (like staging, production, etc.). Create a folder 
`environment_name` and place all configuration files inside to add a new 
environment.
 
-```bash
-echo 'bucket = "put your state bucket name here"' > 
/path/to/beam/playground/terraform/environment/{env-name}/state.tfbackend
+* `terraform.tfvars` environment variables:
 ```
-
-* Terraform variables config and provide necessary variables
-
-```bash
-touch 
/path/to/beam/playground/terraform/environment/{env-name}/terraform.tfvars
+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, [terraform state file] 
(https://cloud.google.com/docs/terraform/resource-management/store-state)
+bucket_examples_name = "bucket_name-example" #GCS bucket name for Playground 
examples storage
 ```
-
-Then provide necessary variables.
-
-## 2. Provision infrastructure
-
-To deploy Playground infrastructure run gradle task:
-
-```bash
-./gradlew playground:terraform:InitInfrastructure 
-Pproject_environment="env-name"
+* `state.tfbackend` environment variables:
 ```
-
-## 3. Deploy application
-
-To deploy application run following steps:
-
-* Authinticate in Artifact registry
-
-```bash
-gcloud auth configure-docker us-central1-docker.pkg.dev
+bucket               = "bucket_name"         #input bucket name - will be used 
for terraform tfstate file
 ```
+Then, configure authentication for the Google Cloud Platform:
 
-* Š’eploy backend services
-
-```bash
-./gradlew playground:terraform:deployBackend -Pproject_environment="env-name" 
-Pdocker-tag="tag"
+* The following commands allows us to configure account and project
+```
+gcloud init
+```
 ```
+gcloud auth application-default login
+```
+# Infrastructure deployment:
+* To deploy the Payground infrastructure, use the following command (please be 
sure that you are in the "beam" folder):
+```
+./gradlew playground:terraform:InitInfrastructure -Pproject_environment="env" 
(env - folder name which you created for configuration files)
+```
+# Playground deployment:
+Afrer successfully deploying Playground infrastrcuture in the previous step, 
authenticate on Docker and Google Kubernetes Engine<br>
+The following command will authenticate us in the Docker registry
+```
+ gcloud auth configure-docker `chosen_region`-docker.pkg.dev
+```
+The following command will authenticate in GKE
+```
+gcloud container clusters get-credentials --region `chosen_location` 
`gke_name` --project `project_id`
+```
+Find a Static IP in your GCP project>VPC Network>IP Addresses>pg-static-ip

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to