agones.dev/agones@v1.53.0/examples/chainfleetautoscaler.yaml (about)

     1  ---
     2  # Copyright 2024 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  # [Stage:Dev]
    18  # [FeatureFlag:ScheduledAutoscaler]
    19  # Example of a FleetAutoscaler - this is used to scale a Fleet based on a chain.
    20  #
    21  
    22  #
    23  # For a full reference and details: https://agones.dev/site/docs/reference/fleetautoscaler/
    24  #
    25  apiVersion: autoscaling.agones.dev/v1
    26  kind: FleetAutoscaler
    27  metadata:
    28    name: chain-fleet-autoscaler
    29  spec:
    30    fleetName: fleet-example
    31    policy:
    32      # Chain based policy for autoscaling.
    33      type: Chain
    34      chain:
    35        # Id of chain entry. If not set, the Id will be defaulted to the index of the entry within the chain.
    36        - id: "weekday"
    37          type: Schedule  # Schedule based policy.
    38          schedule:
    39            between:
    40              # The policy becomes eligible for application starting on Feb 20, 2100 at 4:04 PM EST. If not set, the policy will immediately be eligible for application.
    41              start: "2100-02-20T16:04:04-05:00"
    42              # The policy becomes ineligible for application on Feb 23, 2100 at 4:04 PM EST. If not set, the policy will always be eligible for application (after the start time).
    43              end: "2100-02-23T16:04:04-05:00"
    44            activePeriod:
    45              # Timezone to be used for the startCron field. Defaults to UTC if not set.
    46              timezone: "America/New_York"
    47              # Start applying the policy everyday at 1:00 AM EST. If not set, the policy will always be applied in the .between window.
    48              # (Only eligible starting on Feb 20, 2100 at 4:04 PM).
    49              startCron: "0 1 * * 0"
    50              # Only apply the policy for 5 hours. If not set, the duration will be defaulted to always/indefinite.
    51              duration: "5h"
    52            # Policy to be applied during the activePeriod. Required.
    53            policy:
    54              type: Buffer
    55              buffer:
    56                bufferSize: 50
    57                minReplicas: 100
    58                maxReplicas: 2000
    59        # Id of chain entry. If not set, the Id will be defaulted to the index of the entry within the chain list.
    60        - id: "weekend"
    61          type: Schedule  # Schedule based policy.
    62          schedule:
    63            between:
    64              # The policy becomes eligible for application starting on Feb 24, 2100 at 4:05 PM EST. If not set, the policy will immediately be eligible for application.
    65              start: "2100-02-24T16:04:05-05:00"
    66              # The policy becomes ineligible for application starting on Feb 26, 2100 at 4:05 PM EST. If not set, the policy will always be eligible for application (after the start time).
    67              end: "2100-02-26T16:04:05-05:00"
    68            activePeriod:
    69              # Timezone to be used for the startCron field. Defaults to UTC if not set.
    70              timezone: "America/New_York"
    71              # Start applying the policy everyday at 1:00 AM EST. If not set, the policy will always be applied in the .between window.
    72              # (Only eligible starting on Feb 24, 2100 at 4:05 PM EST)
    73              startCron: "0 1 * * 0"
    74              # Only apply the policy for 7 hours. If not set the duration will be defaulted to always/indefinite.
    75              duration: "7h"
    76            # Policy to be applied during the activePeriod. Required.
    77            policy:
    78              type: Counter
    79              counter:
    80                key: rooms
    81                bufferSize: 10
    82                minCapacity: 500
    83                maxCapacity: 1000
    84        # Id of chain entry. If not set, the Id will be defaulted to the index of the entry within the chain list.
    85        - id: "default"
    86          # Policy will always be applied when no other policy is applicable. Required.
    87          type: Buffer
    88          buffer:
    89            bufferSize: 5
    90            minReplicas: 100
    91            maxReplicas: 2000
    92    # The autoscaling sync strategy, this will determine how frequent any schedules within the chain is evaluated.
    93    sync:
    94      # type of the sync. for now, only FixedInterval is available
    95      type: FixedInterval
    96      # parameters of the fixedInterval sync
    97      fixedInterval:
    98        # the time in seconds between each auto scaling
    99        seconds: 30