# Copyright 2017 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. # # Full example of a single Game Server resource # # This specifies Game Server specific configuration, but provides # a Pod Template so that Pod options and capabilities are available. # This definition sets hostPort + containerPort combo for the game server, # and provides a sidecar for this game server that the SDK will connect with. # # # For a full reference and details: https://agones.dev/site/docs/reference/gameserver/ # apiVersion: "agones.dev/v1" kind: GameServer metadata: # generateName: "gds-example" # generate a unique name, with the given prefix name: "gds-example" # set a fixed name spec: # if there is more than one container, specify which one is the game server container: example-server # Array of ports that can be exposed as direct connections to the game server container ports: # name is a descriptive name for the port - name: default # portPolicy has three options: # - "Dynamic" (default) the system allocates a free hostPort for the gameserver, for game clients to connect to # - "Static", user defines the hostPort that the game client will connect to. Then onus is on the user to ensure that the # port is available. When static is the policy specified, `hostPort` is required to be populated # - "Passthrough" dynamically sets the `containerPort` to the same value as the dynamically selected hostPort. # This will mean that users will need to lookup what port has been opened through the server side SDK. portPolicy: Static # The name of the container to open the port on. Defaults to the game server container if omitted or empty. container: simple-game-server # the port that is being opened on the game server process containerPort: 7654 # the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic". hostPort: 7777 # protocol being used. Defaults to UDP. TCP and TCPUDP are other options protocol: UDP # Health checking for the running game server health: # Disable health checking. defaults to false, but can be set to true disabled: false # Number of seconds after the container has started before health check is initiated. Defaults to 5 seconds initialDelaySeconds: 5 # If the `Health()` function doesn't get called at least once every period (seconds), then # the game server is not healthy. Defaults to 5 periodSeconds: 5 # Minimum consecutive failures for the health probe to be considered failed after having succeeded. # Defaults to 3. Minimum value is 1 failureThreshold: 3 # Parameters for game server sidecar sdkServer: # sdkServer log level parameter has three options: # - "Info" (default) The SDK server will output all messages except for debug messages # - "Debug" The SDK server will output all messages including debug messages # - "Error" The SDK server will only output error messages logLevel: Info # grpcPort and httpPort control what ports the sdkserver listens on. # Starting with Agones 1.2 the default grpcPort is 9357 and the default # httpPort is 9358. In earlier releases, the defaults were 59357 and 59358 # respectively but as these were in the ephemeral port range they could # conflict with other TCP connections. grpcPort: 9357 httpPort: 9358 # [Stage:Alpha] # [FeatureFlag:PlayerTracking] # Players provides the configuration for player tracking features. # Commented out since Alpha, and disabled by default # players: # # set this GameServer's initial player capacity # initialCapacity: 10 # # Pod template configuration template: # pod metadata. Name & Namespace is overwritten metadata: labels: myspeciallabel: myspecialvalue # Pod Specification spec: containers: - name: simple-game-server image: gcr.io/agones-images/simple-game-server:0.13 imagePullPolicy: Always # nodeSelector is a label that can be used to tell Kubernetes which host # OS to use. For Windows game servers uncomment the nodeSelector # definition below. # Details: https://kubernetes.io/docs/setup/production-environment/windows/user-guide-windows-containers/#ensuring-os-specific-workloads-land-on-the-appropriate-container-host # nodeSelector: # kubernetes.io/os: windows