diff --git a/.gitignore b/.gitignore index 19b8088..8baa7a2 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,6 @@ platform/agones/skaffold.yaml # Ignore Terraform generated kustomization files **/global-game-*/kustomization.yaml **/global-game-*/agones-system.yaml -platform/open-match/base/kustomization.yaml # Ignore any tmp files generated infrastructure/tmp diff --git a/infrastructure/files/open-match/kustomization.yaml.tpl b/infrastructure/files/open-match/kustomization.yaml.tpl deleted file mode 100644 index 5f98f1c..0000000 --- a/infrastructure/files/open-match/kustomization.yaml.tpl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2023 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ./base/kustomization.yaml -helmCharts: -- name: open-match - namespace: open-match - repo: https://open-match.dev/chart/stable - version: 1.8.0 - releaseName: open-match - valuesInline: - prometheus: - enabled: false - grafana: - enabled: false - jaeger: - enabled: false - open-match-override: - enabled: true - open-match-customize: - enabled: true - evaluator: - enabled: true - open-match-core: - redis: - enabled: false - # If open-match-core.redis.enabled is set to false, have Open Match components talk to this redis address instead. - # Otherwise the default is set to the om-redis instance. - hostname: ${redis_host} - port: ${redis_port} - pool: - maxIdle: 500 - maxActive: 500 - idleTimeout: 0 - healthCheckTimeout: 300ms - -resources: - - open-match.yaml - - agones-allocator-vs.yaml diff --git a/infrastructure/open-match.tf b/infrastructure/open-match.tf index 53157af..5c00bc5 100644 --- a/infrastructure/open-match.tf +++ b/infrastructure/open-match.tf @@ -54,13 +54,3 @@ resource "google_service_networking_connection" "private_service_connection" { depends_on = [google_project_service.project] } -# Add Redis Host & IP to Open Match kustomization.yaml -resource "local_file" "open-match-kustomization-file" { - - content = templatefile( - "${path.module}/files/open-match/kustomization.yaml.tpl", { - redis_host = google_redis_instance.open-match.host - redis_port = google_redis_instance.open-match.port - }) - filename = "${path.module}/${var.platform_directory}/open-match/base/kustomization.yaml" -} diff --git a/infrastructure/pipelines.tf b/infrastructure/pipelines.tf index c190628..3cc4dc1 100644 --- a/infrastructure/pipelines.tf +++ b/infrastructure/pipelines.tf @@ -212,6 +212,13 @@ resource "google_clouddeploy_delivery_pipeline" "open-match" { serial_pipeline { stages { target_id = google_clouddeploy_target.open-match-target.target_id + deploy_parameters { + values = { + # values are passed into Cloud Deploy Helm Charts by convention. + "open-match-core.redis.hostname" = google_redis_instance.open-match.host + "open-match-core.redis.port" = google_redis_instance.open-match.port + } + } } } } diff --git a/platform/cloudbuild.yaml b/platform/cloudbuild.yaml index bf3c943..de5a547 100644 --- a/platform/cloudbuild.yaml +++ b/platform/cloudbuild.yaml @@ -20,41 +20,34 @@ steps: # newly added clusters are configured properly with ASM. - name: gcr.io/google.com/cloudsdktool/cloud-sdk id: fleet-membership - entrypoint: bash - args: - - '-c' - - | - MEMBERSHIPS=$(gcloud container fleet memberships list --format="value(name)" | xargs | sed 's/ /,/g') - - gcloud container fleet mesh update --management automatic --memberships $$MEMBERSHIPS + script: | + export MEMBERSHIPS=$(gcloud container fleet memberships list --format="value(name)" | xargs | sed 's/ /,/g') && \ + echo Memberships: $MEMBERSHIPS && \ + gcloud container fleet mesh update --management automatic --memberships "$MEMBERSHIPS" - name: gcr.io/google.com/cloudsdktool/cloud-sdk id: deploy-agones - entrypoint: bash dir: agones - args: - - '-c' - - | - gcloud deploy releases create deploy-$(date +'%Y%m%d%H%M%S') \ - --annotations=cloud_build=https://console.cloud.google.com/cloud-build/builds/${BUILD_ID} \ - --delivery-pipeline agones-deploy-pipeline \ - --skaffold-file skaffold.yaml \ - --region us-central1 + script: | + gcloud deploy releases create deploy-$(date +'%Y%m%d%H%M%S') \ + --annotations=cloud_build=https://console.cloud.google.com/cloud-build/builds/$BUILD_ID \ + --delivery-pipeline agones-deploy-pipeline \ + --skaffold-file skaffold.yaml \ + --region us-central1 + automapSubstitutions: true waitFor: - fleet-membership - name: gcr.io/google.com/cloudsdktool/cloud-sdk id: deploy-open-match - entrypoint: bash dir: open-match - args: - - '-c' - - | - gcloud deploy releases create deploy-$(date +'%Y%m%d%H%M%S') \ - --annotations=cloud_build=https://console.cloud.google.com/cloud-build/builds/${BUILD_ID} \ - --delivery-pipeline global-game-open-match \ - --skaffold-file skaffold.yaml \ - --region us-central1 + script: | + gcloud deploy releases create deploy-$(date +'%Y%m%d%H%M%S') \ + --annotations=cloud_build=https://console.cloud.google.com/cloud-build/builds/$BUILD_ID \ + --delivery-pipeline global-game-open-match \ + --skaffold-file skaffold.yaml \ + --region us-central1 + automapSubstitutions: true waitFor: - fleet-membership diff --git a/platform/open-match/base/agones-allocator-vs.yaml b/platform/open-match/agones-allocator-vs.yaml similarity index 100% rename from platform/open-match/base/agones-allocator-vs.yaml rename to platform/open-match/agones-allocator-vs.yaml diff --git a/platform/open-match/base/open-match.yaml b/platform/open-match/open-match.yaml similarity index 100% rename from platform/open-match/base/open-match.yaml rename to platform/open-match/open-match.yaml diff --git a/platform/open-match/skaffold.yaml b/platform/open-match/skaffold.yaml index e2c430c..9a00bfe 100644 --- a/platform/open-match/skaffold.yaml +++ b/platform/open-match/skaffold.yaml @@ -12,14 +12,34 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: skaffold/v4beta1 +apiVersion: skaffold/v4beta9 kind: Config manifests: - kustomize: - paths: - - ./base - buildArgs: - - --enable-helm + rawYaml: + - open-match.yaml + - agones-allocator-vs.yaml + helm: + releases: + - name: open-match + namespace: open-match + repo: https://open-match.dev/chart/stable + remoteChart: open-match + version: 1.8.0 + setValues: + prometheus.enabled: false + grafana.enabled: false + jaeger.enabled: false + open-match-override.enabled: true + open-match-customize.enabled: true + open-match-customize.evaluator.enabled: true + open-match-core.redis.enabled: false + # open-match-core.redis.hostname: redis -- set through Cloud Deploy by convention + # open-match-core.redis.port: 6379 -- set through Cloud Deploy by convention + open-match-core.redis.pool.maxIdle: 500 + open-match-core.redis.pool.maxActive: 500 + open-match-core.redis.pool.idleTimeout: 0 + open-match-core.redis.pool.healthCheckTimeout: 300ms + deploy: kubectl: flags: