agones.dev/agones@v1.54.0/examples/gameserver.yaml (about)

     1  ---
     2  # Copyright 2017 Google LLC All Rights Reserved.
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #     http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  
    16  #
    17  # Full example of a single Game Server resource
    18  #
    19  # This specifies Game Server specific configuration, but provides
    20  # a Pod Template so that Pod options and capabilities are available.
    21  # This definition sets hostPort + containerPort combo for the game server,
    22  # and provides a sidecar for this game server that the SDK will connect with.
    23  #
    24  
    25  #
    26  # For a full reference and details: https://agones.dev/site/docs/reference/gameserver/
    27  #
    28  apiVersion: agones.dev/v1
    29  kind: GameServer
    30  metadata:
    31    # generateName: "gds-example"  # generate a unique name, with the given prefix
    32    name: gds-example  # set a fixed name
    33  spec:
    34    # if there is more than one container, specify which one is the game server
    35    container: example-server
    36    # Array of ports that can be exposed as direct connections to the game server container
    37    ports:
    38      # name is a descriptive name for the port
    39      - name: default
    40        # [Stage:Beta]
    41        # [FeatureFlag:PortRanges]
    42        # range is the optional port range name from which to select a port when using a 'Dynamic' or 'Passthrough' port policy.
    43        # Defaults to 'default'.
    44        range: default
    45        # portPolicy has four options:
    46        # - "Dynamic" (default) the system allocates a free hostPort for the gameserver, for game clients to connect to
    47        # - "Static", user defines the hostPort that the game client will connect to. Then onus is on the user to ensure that the
    48        # port is available. When static is the policy specified, `hostPort` is required to be populated
    49        # - "Passthrough" dynamically sets the `containerPort` to the same value as the dynamically selected hostPort.
    50        #      This will mean that users will need to lookup what port has been opened through the server side SDK.
    51        # [Stage:Beta]
    52        # [FeatureFlag:PortPolicyNone]
    53        # - "None" means the `hostPort` is ignored and if defined, the `containerPort` (optional) is used to set the port on the GameServer instance.
    54        portPolicy: Dynamic
    55        # The name of the container to open the port on. Defaults to the game server container if omitted or empty.
    56        container: simple-game-server
    57        # the port that is being opened on the game server process
    58        containerPort: 7654
    59        # the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic".
    60        # hostPort: 7777
    61        # protocol being used. Defaults to UDP. TCP and TCPUDP are other options
    62        protocol: UDP
    63    # Health checking for the running game server
    64    health:
    65      # Disable health checking. defaults to false, but can be set to true
    66      disabled: false
    67      # Number of seconds after the container has started before health check is initiated. Defaults to 5 seconds
    68      initialDelaySeconds: 5
    69      # If the `Health()` function doesn't get called at least once every period (seconds), then
    70      # the game server is not healthy. Defaults to 5
    71      periodSeconds: 5
    72      # Minimum consecutive failures for the health probe to be considered failed after having succeeded.
    73      # Defaults to 3. Minimum value is 1
    74      failureThreshold: 3
    75    # Parameters for game server sidecar
    76    sdkServer:
    77      # sdkServer log level parameter has three options:
    78      #  - "Info" (default) The SDK server will output all messages except for debug messages
    79      #  - "Debug" The SDK server will output all messages including debug messages
    80      #  - "Error" The SDK server will only output error messages
    81      #  - "Trace" The SDK server will output all messages, including detailed tracing information
    82      logLevel: Info
    83      # grpcPort and httpPort control what ports the sdkserver listens on.
    84      # Starting with Agones 1.2 the default grpcPort is 9357 and the default
    85      # httpPort is 9358. In earlier releases, the defaults were 59357 and 59358
    86      # respectively but as these were in the ephemeral port range they could
    87      # conflict with other TCP connections.
    88      grpcPort: 9357
    89      httpPort: 9358
    90    # [Stage:Alpha]
    91    # [FeatureFlag:PlayerTracking]
    92    # Players provides the configuration for player tracking features.
    93    # Commented out since Alpha, and disabled by default
    94    # players:
    95    #  # set this GameServer's initial player capacity
    96    #   initialCapacity: 10
    97    #
    98    # [Stage:Beta]
    99    # [FeatureFlag:CountsAndLists]
   100    # Counts and Lists provides the configuration for generic (player, room, session, etc.) tracking features.
   101    # Now in Beta, and enabled by default
   102    counters:  # counters are int64 counters that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time.
   103      rooms:  # arbitrary key.
   104        count: 1  # initial value can be set.
   105        capacity: 100  # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. See GitHub issue https://github.com/googleforgames/agones/issues/3636 for more details.
   106    lists:  # lists are lists of values stored against this GameServer that can be added and deleted from. Keys must be declared at GameServer creation time.
   107      players:  # an empty list, with a capacity set to 10.
   108        capacity: 10  # capacity value, defaults to 1000.
   109      rooms:  # note that it is allowed to have the same key name with one used in counters
   110        capacity: 333
   111        values:  # initial values can also be set for lists
   112          - room1
   113          - room2
   114          - room3
   115    # Pod template configuration
   116    template:
   117      # pod metadata. Name & Namespace is overwritten
   118      metadata:
   119        labels:
   120          myspeciallabel: myspecialvalue
   121      # Pod Specification
   122      spec:
   123        containers:
   124          - name: simple-game-server
   125            image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.39
   126            imagePullPolicy: Always
   127            # nodeSelector is a label that can be used to tell Kubernetes which host
   128            # OS to use. For Windows game servers uncomment the nodeSelector
   129            # definition below.
   130            # Details: https://kubernetes.io/docs/setup/production-environment/windows/user-guide-windows-containers/#ensuring-os-specific-workloads-land-on-the-appropriate-container-host
   131            # nodeSelector:
   132            #   kubernetes.io/os: windows