Skip to content

Commit

Permalink
Moving infastructure files to a subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
dtest committed Feb 2, 2023
1 parent 6089b85 commit f0656c7
Show file tree
Hide file tree
Showing 28 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ and then set your Google Cloud Project project name/PROJECT_ID:
$ gcloud config set project <PROJECT_ID>
```

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

Expand All @@ -42,41 +48,41 @@ 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
```

***NOTE*** - The cloudbuild.yaml, kustomization.yaml & skaffold.yaml files will not exist until Terraform runs for the first time! The templates used for these files are stored in `files/agones/`.

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

#### Initial Deploy
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
```

Expand Down
4 changes: 2 additions & 2 deletions docs/GKE.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f0656c7

Please sign in to comment.