Skip to content

Commit a0bec03

Browse files
authored
Agones Installation to Cloud Deploy Params (#260)
This is the last piece of removing generating local files from the Terraform configuration to use with Cloud Deploy - everything has now been moved to Cloud Deploy Parameters! This moves the installation of Agones' into each cluster to use a Cloud Deploy parameter set on each Cloud Deploy Target. This also simplifies the Skaffold configuration to remove Kustomize from the yaml. Closes #181
1 parent 1a3e51a commit a0bec03

File tree

7 files changed

+48
-90
lines changed

7 files changed

+48
-90
lines changed

.gitignore

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ backend.tf
2222

2323
deploy/base/charts/
2424

25-
# Ignore Terraform generated k8s manifest files
26-
patch-agones-allocator-*.yaml
27-
28-
# Ignore Terraform generated skaffold files
29-
skaffold-global-game-*.yaml
30-
platform/agones/skaffold.yaml
31-
32-
# Ignore Terraform generated kustomization files
33-
**/global-game-*/kustomization.yaml
34-
**/global-game-*/agones-system.yaml
35-
3625
# Ignore any tmp files generated
3726
infrastructure/tmp
3827

infrastructure/agones-gke.tf

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -122,32 +122,3 @@ resource "google_compute_firewall" "agones-gameservers" {
122122
target_tags = ["game-server"]
123123
source_ranges = ["0.0.0.0/0"]
124124
}
125-
126-
# Make Skaffold file for Cloud Deploy into each GKE Cluster
127-
resource "local_file" "agones-skaffold-file" {
128-
content = templatefile(
129-
"${path.module}/files/agones/skaffold.yaml.tpl", {
130-
gke_clusters = merge(var.game_gke_standard_clusters, var.game_gke_autopilot_clusters)
131-
})
132-
filename = "${path.module}/${var.platform_directory}/agones/skaffold.yaml"
133-
}
134-
135-
# Make cluster specific helm value for LB IP
136-
resource "local_file" "agones-ae-lb-file" {
137-
for_each = merge(var.game_gke_standard_clusters, var.game_gke_autopilot_clusters)
138-
139-
content = templatefile(
140-
"${path.module}/files/agones/agones-install.yaml.tpl", {
141-
location = each.value.region
142-
})
143-
filename = "${path.module}/${var.platform_directory}/agones/${each.key}/kustomization.yaml"
144-
}
145-
146-
# Create agones-system ns manifest as resource referenced by kustomization.yaml
147-
resource "local_file" "agones-ns-file" {
148-
for_each = merge(var.game_gke_standard_clusters, var.game_gke_autopilot_clusters)
149-
150-
content = file("${path.module}/files/agones/agones-system.yaml")
151-
filename = "${path.module}/${var.platform_directory}/agones/${each.key}/agones-system.yaml"
152-
}
153-

infrastructure/files/agones/agones-install.yaml.tpl

Lines changed: 0 additions & 27 deletions
This file was deleted.

infrastructure/files/agones/skaffold.yaml.tpl

Lines changed: 0 additions & 22 deletions
This file was deleted.

infrastructure/pipelines.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ resource "google_clouddeploy_target" "agones-gke" {
9696
project = var.project
9797
require_approval = false
9898

99+
deploy_parameters = {
100+
"agones.allocator.labels.region" = each.value.region
101+
}
102+
99103
depends_on = [google_project_service.project]
100104
}
101105

@@ -115,7 +119,6 @@ resource "google_clouddeploy_delivery_pipeline" "agones-gke" {
115119
for_each = merge(var.game_gke_standard_clusters, var.game_gke_autopilot_clusters)
116120
content {
117121
target_id = google_clouddeploy_target.agones-gke[stages.key].target_id
118-
profiles = [stages.key]
119122
}
120123
}
121124
}
File renamed without changes.

platform/agones/skaffold.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2024 Google LLC All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: skaffold/v4beta9
16+
kind: Config
17+
manifests:
18+
rawYaml:
19+
- agones-system.yaml
20+
helm:
21+
releases:
22+
- name: agones
23+
namespace: agones-system
24+
repo: https://agones.dev/chart/stable
25+
remoteChart: agones
26+
version: 1.40.0
27+
setValues:
28+
agones.crds.cleanupOnDelete: false
29+
agones.allocator.disableMTLS: true
30+
agones.allocator.disableTLS: true
31+
agones.allocator.service.serviceType: ClusterIP
32+
agones.allocator.service.http.port: 8000
33+
agones.allocator.service.http.targetPort: 8000
34+
agones.allocator.service.http.portName: http-alloc
35+
agones.allocator.service.grpc.enabled: false
36+
agones.allocator.labels.istio\.io/rev: asm-managed
37+
# agones.allocator.labels.region: -- set by convention with Cloud Deploy Parameter attached to the target cluster
38+
deploy:
39+
kubectl:
40+
flags:
41+
apply:
42+
- --server-side # Avoid the "Too long: must have at most 262144 bytes" problem
43+
- --force-conflicts
44+
tolerateFailuresUntilDeadline: true # Fixes startup timeouts

0 commit comments

Comments
 (0)