Skip to content

Commit

Permalink
add ports to examples for game services deployment. (GoogleCloudPlatf…
Browse files Browse the repository at this point in the history
…orm#4178)

following error text: 'at least one port is required' and example at https://cloud.google.com/game-servers/docs/how-to/creating-config.
  • Loading branch information
nat-henderson authored Nov 3, 2020
1 parent c7479d7 commit c99ccab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions templates/terraform/examples/game_service_config_basic.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "google_game_services_game_server_config" "<%= ctx[:primary_resource_id

fleet_configs {
name = "something-unique"
fleet_spec = jsonencode({ "replicas" : 1, "scheduling" : "Packed", "template" : { "metadata" : { "name" : "tf-test-game-server-template" }, "spec" : { "template" : { "spec" : { "containers" : [{ "name" : "simple-udp-server", "image" : "gcr.io/agones-images/udp-server:0.14" }] } } } } })
fleet_spec = jsonencode({ "replicas" : 1, "scheduling" : "Packed", "template" : { "metadata" : { "name" : "tf-test-game-server-template" }, "spec" : { "ports": [{"name": "default", "portPolicy": "Dynamic", "containerPort": 7654, "protocol": "UDP"}], "template" : { "spec" : { "containers" : [{ "name" : "simple-udp-server", "image" : "gcr.io/agones-images/udp-server:0.14" }] } } } } })
}

scaling_configs {
Expand All @@ -27,4 +27,4 @@ resource "google_game_services_game_server_config" "<%= ctx[:primary_resource_id
cron_spec = "0 0 * * 0"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "google_game_services_game_server_config" "default" {

fleet_configs {
name = "some-non-guid"
fleet_spec = jsonencode({ "replicas" : 1, "scheduling" : "Packed", "template" : { "metadata" : { "name" : "tf-test-game-server-template" }, "spec" : { "template" : { "spec" : { "containers" : [{ "name" : "simple-udp-server", "image" : "gcr.io/agones-images/udp-server:0.14" }] } } } } })
fleet_spec = jsonencode({ "replicas" : 1, "scheduling" : "Packed", "template" : { "metadata" : { "name" : "tf-test-game-server-template" }, "spec" : { "ports": [{"name": "default", "portPolicy": "Dynamic", "containerPort": 7654, "protocol": "UDP"}], "template" : { "spec" : { "containers" : [{ "name" : "simple-udp-server", "image" : "gcr.io/agones-images/udp-server:0.14" }] } } } } })

// Alternate usage:
// fleet_spec = file(fleet_configs.json)
Expand All @@ -20,4 +20,4 @@ resource "google_game_services_game_server_config" "default" {
resource "google_game_services_game_server_deployment_rollout" "<%= ctx[:primary_resource_id] %>" {
deployment_id = google_game_services_game_server_deployment.default.deployment_id
default_game_server_config = google_game_services_game_server_config.default.name
}
}

0 comments on commit c99ccab

Please sign in to comment.