From f0656c7c5a13ebda95d25954a126e677a0f7c377 Mon Sep 17 00:00:00 2001 From: Derek Downey Date: Thu, 2 Feb 2023 18:08:48 +0000 Subject: [PATCH] Moving infastructure files to a subdirectory --- README.md | 20 ++++++++++++------ docs/GKE.md | 4 ++-- agones-gke.tf => infrastructure/agones-gke.tf | 0 .../allocation-endpoint.tf | 0 .../agones/endpoint-patch/cloudbuild.yaml | 0 .../deploy}/agones/install/agones-system.yaml | 0 .../deploy}/agones/install/cloudbuild.yaml | 0 .../deploy}/services/install/cloudbuild.yaml | 0 .../services/install/nginx/kustomization.yaml | 0 .../deploy}/services/install/skaffold.yaml | 0 .../services/install/spanner-system.yaml | 0 .../files}/agones/ae-lb-ip-patch.yaml.tpl | 0 .../agones_allocation_api_descriptor.pb | Bin .../files}/agones/api_config.yaml.tpl | 0 .../files}/agones/clusters_info.tpl | 0 .../agones/patch-agones-allocator.yaml.tpl | 0 .../files}/agones/skaffold.yaml.tpl | 0 iam.tf => infrastructure/iam.tf | 0 main.tf => infrastructure/main.tf | 0 outputs.tf => infrastructure/outputs.tf | 0 pipelines.tf => infrastructure/pipelines.tf | 0 project.tf => infrastructure/project.tf | 0 providers.tf => infrastructure/providers.tf | 0 .../spanner-gke.tf | 0 spanner.tf => infrastructure/spanner.tf | 0 .../terraform.tfvars.sample | 0 variables.tf => infrastructure/variables.tf | 0 vpc.tf => infrastructure/vpc.tf | 0 28 files changed, 15 insertions(+), 9 deletions(-) rename agones-gke.tf => infrastructure/agones-gke.tf (100%) rename allocation-endpoint.tf => infrastructure/allocation-endpoint.tf (100%) rename {deploy => infrastructure/deploy}/agones/endpoint-patch/cloudbuild.yaml (100%) rename {deploy => infrastructure/deploy}/agones/install/agones-system.yaml (100%) rename {deploy => infrastructure/deploy}/agones/install/cloudbuild.yaml (100%) rename {deploy => infrastructure/deploy}/services/install/cloudbuild.yaml (100%) rename {deploy => infrastructure/deploy}/services/install/nginx/kustomization.yaml (100%) rename {deploy => infrastructure/deploy}/services/install/skaffold.yaml (100%) rename {deploy => infrastructure/deploy}/services/install/spanner-system.yaml (100%) rename {files => infrastructure/files}/agones/ae-lb-ip-patch.yaml.tpl (100%) rename {files => infrastructure/files}/agones/agones_allocation_api_descriptor.pb (100%) rename {files => infrastructure/files}/agones/api_config.yaml.tpl (100%) rename {files => infrastructure/files}/agones/clusters_info.tpl (100%) rename {files => infrastructure/files}/agones/patch-agones-allocator.yaml.tpl (100%) rename {files => infrastructure/files}/agones/skaffold.yaml.tpl (100%) rename iam.tf => infrastructure/iam.tf (100%) rename main.tf => infrastructure/main.tf (100%) rename outputs.tf => infrastructure/outputs.tf (100%) rename pipelines.tf => infrastructure/pipelines.tf (100%) rename project.tf => infrastructure/project.tf (100%) rename providers.tf => infrastructure/providers.tf (100%) rename spanner-gke.tf => infrastructure/spanner-gke.tf (100%) rename spanner.tf => infrastructure/spanner.tf (100%) rename terraform.tfvars.sample => infrastructure/terraform.tfvars.sample (100%) rename variables.tf => infrastructure/variables.tf (100%) rename vpc.tf => infrastructure/vpc.tf (100%) diff --git a/README.md b/README.md index 5a4a92f..3d29105 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,18 @@ and then set your Google Cloud Project project name/PROJECT_ID: $ gcloud config set project ``` +Now, set an environment variable for the home directory for easy navigation: + +```shell +$ export GAME_DEMO_HOME=$(pwd) +``` ### Provision Initialize Terraform & configure variables ```shell +$ cd $GAME_DEMO_HOME/infrastructure $ terraform init $ cp terraform.tfvars.sample terraform.tfvars @@ -42,25 +48,25 @@ Provision the infrastructure. $ terraform apply ``` -### Deploy Agones To GKE Clusters +### Deploy Agones To GKE Clusters The Agones deployment is in two steps: The Initial Install and the Allocation Endpoint Patch. #### Initial Install -Replace the` _RELEASE_NAME` substitution with a unique build name. Cloudbuild will deploy Agones using Cloud Deploy. +Replace the` _RELEASE_NAME` substitution with a unique build name. Cloudbuild will deploy Agones using Cloud Deploy. ```shell -$ cd deploy/agones/install +$ cd $GAME_DEMO_HOME/infrastructure/deploy/agones/install $ gcloud builds submit --config=cloudbuild.yaml --substitutions=_RELEASE_NAME=rel-1 ``` You can monitor the status of the deployment through the Cloud Logging URL returned by the `gcloud builds` command as well as the Kubernetes Engine/Worloads panel in the GCP Console. Once the Worloads have been marked as OK, you can proceed to apply the Allocation Endpoint Patch. #### Allocation Endpoint Patch -After the Agones install has completed and the GKE Workloads show complete, run the Allocation Endpoint Patch Cloud Deploy to apply the appropriate endpoint patches to each cluster: +After the Agones install has completed and the GKE Workloads show complete, run the Allocation Endpoint Patch Cloud Deploy to apply the appropriate endpoint patches to each cluster: ```shell -$ cd deploy/agones/endpoint-patch/ +$ cd $GAME_DEMO_HOME/infrastructure/deploy/agones/endpoint-patch/ $ gcloud builds submit --config=cloudbuild.yaml ``` @@ -68,7 +74,7 @@ $ gcloud builds submit --config=cloudbuild.yaml You can monitor the status of the deployment through the Cloud Logging URL returned by the `gcloud builds` comma nd as well as the Kubernetes Engine/Worloads panel in the GCP Console. Once the Worloads have been marked as O -K, Agones should be avaialable. +K, Agones should be avaialable. ### Deploy Spanner Applications to GKE Cluster @@ -76,7 +82,7 @@ K, Agones should be avaialable. Replace the` _RELEASE_NAME` substitution with a unique build name. Cloudbuild will deploy Spanner applications using Cloud Deploy. ```shell -$ cd deploy/spanner/install +$ cd $GAME_DEMO_HOME/infrastructure/deploy/spanner/install $ gcloud builds submit --config=cloudbuild.yaml --substitutions=_RELEASE_NAME=rel-1 ``` diff --git a/docs/GKE.md b/docs/GKE.md index e680999..2d14645 100644 --- a/docs/GKE.md +++ b/docs/GKE.md @@ -1,11 +1,11 @@ # GKE -This repository provides support for running the backend applications on GKE Autopilot utilizing Workload Identity. +This repository provides support for running the game services on GKE Autopilot utilizing Workload Identity. ## Setup ### Terraform -The provided Terraform [gke.tf](../gke.tf) will provision a [GKE Autopilot](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview) cluster. This method of provisioning GKE will automatically manage the nodes for the cluster as the backend applications are added. +The provided Terraform [gke.tf](../terraform/spanner-gke.tf) will provision a [GKE Autopilot](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview) cluster. This method of provisioning GKE will automatically manage the nodes for the cluster as the backend applications are added. Additionally, there is a service account created for the backend services. diff --git a/agones-gke.tf b/infrastructure/agones-gke.tf similarity index 100% rename from agones-gke.tf rename to infrastructure/agones-gke.tf diff --git a/allocation-endpoint.tf b/infrastructure/allocation-endpoint.tf similarity index 100% rename from allocation-endpoint.tf rename to infrastructure/allocation-endpoint.tf diff --git a/deploy/agones/endpoint-patch/cloudbuild.yaml b/infrastructure/deploy/agones/endpoint-patch/cloudbuild.yaml similarity index 100% rename from deploy/agones/endpoint-patch/cloudbuild.yaml rename to infrastructure/deploy/agones/endpoint-patch/cloudbuild.yaml diff --git a/deploy/agones/install/agones-system.yaml b/infrastructure/deploy/agones/install/agones-system.yaml similarity index 100% rename from deploy/agones/install/agones-system.yaml rename to infrastructure/deploy/agones/install/agones-system.yaml diff --git a/deploy/agones/install/cloudbuild.yaml b/infrastructure/deploy/agones/install/cloudbuild.yaml similarity index 100% rename from deploy/agones/install/cloudbuild.yaml rename to infrastructure/deploy/agones/install/cloudbuild.yaml diff --git a/deploy/services/install/cloudbuild.yaml b/infrastructure/deploy/services/install/cloudbuild.yaml similarity index 100% rename from deploy/services/install/cloudbuild.yaml rename to infrastructure/deploy/services/install/cloudbuild.yaml diff --git a/deploy/services/install/nginx/kustomization.yaml b/infrastructure/deploy/services/install/nginx/kustomization.yaml similarity index 100% rename from deploy/services/install/nginx/kustomization.yaml rename to infrastructure/deploy/services/install/nginx/kustomization.yaml diff --git a/deploy/services/install/skaffold.yaml b/infrastructure/deploy/services/install/skaffold.yaml similarity index 100% rename from deploy/services/install/skaffold.yaml rename to infrastructure/deploy/services/install/skaffold.yaml diff --git a/deploy/services/install/spanner-system.yaml b/infrastructure/deploy/services/install/spanner-system.yaml similarity index 100% rename from deploy/services/install/spanner-system.yaml rename to infrastructure/deploy/services/install/spanner-system.yaml diff --git a/files/agones/ae-lb-ip-patch.yaml.tpl b/infrastructure/files/agones/ae-lb-ip-patch.yaml.tpl similarity index 100% rename from files/agones/ae-lb-ip-patch.yaml.tpl rename to infrastructure/files/agones/ae-lb-ip-patch.yaml.tpl diff --git a/files/agones/agones_allocation_api_descriptor.pb b/infrastructure/files/agones/agones_allocation_api_descriptor.pb similarity index 100% rename from files/agones/agones_allocation_api_descriptor.pb rename to infrastructure/files/agones/agones_allocation_api_descriptor.pb diff --git a/files/agones/api_config.yaml.tpl b/infrastructure/files/agones/api_config.yaml.tpl similarity index 100% rename from files/agones/api_config.yaml.tpl rename to infrastructure/files/agones/api_config.yaml.tpl diff --git a/files/agones/clusters_info.tpl b/infrastructure/files/agones/clusters_info.tpl similarity index 100% rename from files/agones/clusters_info.tpl rename to infrastructure/files/agones/clusters_info.tpl diff --git a/files/agones/patch-agones-allocator.yaml.tpl b/infrastructure/files/agones/patch-agones-allocator.yaml.tpl similarity index 100% rename from files/agones/patch-agones-allocator.yaml.tpl rename to infrastructure/files/agones/patch-agones-allocator.yaml.tpl diff --git a/files/agones/skaffold.yaml.tpl b/infrastructure/files/agones/skaffold.yaml.tpl similarity index 100% rename from files/agones/skaffold.yaml.tpl rename to infrastructure/files/agones/skaffold.yaml.tpl diff --git a/iam.tf b/infrastructure/iam.tf similarity index 100% rename from iam.tf rename to infrastructure/iam.tf diff --git a/main.tf b/infrastructure/main.tf similarity index 100% rename from main.tf rename to infrastructure/main.tf diff --git a/outputs.tf b/infrastructure/outputs.tf similarity index 100% rename from outputs.tf rename to infrastructure/outputs.tf diff --git a/pipelines.tf b/infrastructure/pipelines.tf similarity index 100% rename from pipelines.tf rename to infrastructure/pipelines.tf diff --git a/project.tf b/infrastructure/project.tf similarity index 100% rename from project.tf rename to infrastructure/project.tf diff --git a/providers.tf b/infrastructure/providers.tf similarity index 100% rename from providers.tf rename to infrastructure/providers.tf diff --git a/spanner-gke.tf b/infrastructure/spanner-gke.tf similarity index 100% rename from spanner-gke.tf rename to infrastructure/spanner-gke.tf diff --git a/spanner.tf b/infrastructure/spanner.tf similarity index 100% rename from spanner.tf rename to infrastructure/spanner.tf diff --git a/terraform.tfvars.sample b/infrastructure/terraform.tfvars.sample similarity index 100% rename from terraform.tfvars.sample rename to infrastructure/terraform.tfvars.sample diff --git a/variables.tf b/infrastructure/variables.tf similarity index 100% rename from variables.tf rename to infrastructure/variables.tf diff --git a/vpc.tf b/infrastructure/vpc.tf similarity index 100% rename from vpc.tf rename to infrastructure/vpc.tf