agones.dev/agones@v1.54.0/install/helm/agones/templates/crds/_fleetautoscalerpolicy.yaml (about) 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 --- 16 {{/* schema for a URL configuration for webhooks and wasm */}} 17 {{- define "url.configuration" }} 18 type: object 19 nullable: true 20 properties: 21 url: 22 type: string 23 service: 24 type: object 25 required: 26 - namespace 27 - name 28 properties: 29 namespace: 30 type: string 31 name: 32 type: string 33 path: 34 type: string 35 port: 36 type: integer 37 caBundle: 38 type: string 39 format: byte 40 {{- end }} 41 42 {{/* schema for a fleet autoscaler policy */}} 43 {{- define "fleetautoscaler.policy" }} 44 {{- if .includePolicy }} 45 policy: 46 type: object 47 required: 48 - type 49 properties: 50 {{- end }} 51 type: 52 type: string 53 enum: 54 - Buffer 55 - Webhook 56 - Counter 57 - List 58 - Wasm 59 {{- if .includeSchedulePolicy }} 60 - Schedule 61 {{- end }} 62 {{- if .includeChainPolicy }} 63 - Chain 64 {{- end }} 65 buffer: 66 type: object 67 nullable: true 68 required: 69 - maxReplicas 70 properties: 71 minReplicas: 72 type: integer 73 minimum: 0 74 maxReplicas: 75 type: integer 76 minimum: 1 77 bufferSize: 78 x-kubernetes-int-or-string: true 79 anyOf: 80 - type: integer 81 - type: string 82 webhook: 83 {{- include "url.configuration" . | indent 6 }} 84 counter: 85 type: object 86 nullable: true 87 required: 88 - key 89 - bufferSize 90 - maxCapacity 91 properties: 92 key: # The name of the Counter. 93 type: string 94 minCapacity: # Minimum aggregate counter capacity that can be provided by this FleetAutoscaler. If not specified, the actual minimum capacity will be bufferSize. 95 type: integer 96 minimum: 0 97 maxCapacity: # Maximum aggregate counter capacity that can be provided by this FleetAutoscaler. Required. 98 type: integer 99 minimum: 1 100 bufferSize: # Size of a buffer of counted items that are available in the Fleet (available capacity). It can be specified either in absolute (i.e. 5) or percentage format (i.e. 5%). 101 x-kubernetes-int-or-string: true 102 anyOf: 103 - type: integer 104 - type: string 105 list: 106 type: object 107 nullable: true 108 required: 109 - key 110 - bufferSize 111 - maxCapacity 112 properties: 113 key: # The name of the List. 114 type: string 115 minCapacity: # Minimum aggregate list capacity that can be provided by this FleetAutoscaler. If not specified, the actual minimum capacity will be bufferSize. 116 type: integer 117 minimum: 0 118 maxCapacity: # Maximum aggregate list capacity that can be provided by this FleetAutoscaler. Required. 119 type: integer 120 minimum: 1 121 bufferSize: # Size of a buffer based on the list capacity that is available over the current aggregate list length in the Fleet. It can be specified either in absolute (i.e. 5) or percentage format (i.e. 5%). 122 x-kubernetes-int-or-string: true 123 anyOf: 124 - type: integer 125 - type: string 126 {{- if .includeSchedulePolicy }} 127 schedule: # Defines when the policy is applied. 128 type: object 129 nullable: true 130 required: 131 - policy 132 properties: 133 between: 134 type: object 135 nullable: true 136 properties: 137 start: # Defines when to start evaluating the active period, must conform to RFC3339. 138 type: string 139 end: # Defines when to stop evaluating the active period, must conform to RFC3339. 140 type: string 141 activePeriod: 142 type: object 143 nullable: true 144 properties: 145 timezone: # Timezone to be used for the startCron field, must conform with the IANA Time Zone database (e.g. America/New_York). 146 type: string 147 startCron: # Cron expression defining when to start applying the policy. All TZ/CRON_TZ specification within startCron will be rejected, please use the timezone field above to specify a timezone. Must conform with UNIX CRON syntax. 148 type: string 149 duration: # The length of time the policy should be applied for (e.g. 2h45m). 150 type: string 151 {{- include "fleetautoscaler.policy" (dict "includeChainPolicy" false "includeSchedulePolicy" false "includePolicy" true) | indent 8 }} 152 {{- end }} 153 {{- if .includeChainPolicy }} 154 chain: 155 type: array 156 nullable: true 157 items: 158 type: object 159 nullable: true 160 required: 161 - type 162 properties: 163 id: # The Id of a chain entry. 164 type: string 165 {{- include "fleetautoscaler.policy" (dict "includeChainPolicy" false "includeSchedulePolicy" true "includePolicy" false) | indent 6 }} # Defines which policy to apply during the active period. Required. 166 {{- end }} 167 wasm: 168 type: object 169 nullable: true 170 required: 171 - from 172 properties: 173 function: # The exported function to call in the wasm module, defaults to 'scale' 174 type: string 175 default: "scale" 176 config: # Config values to pass to the wasm program on startup 177 type: object 178 additionalProperties: 179 type: string 180 from: 181 type: object 182 required: 183 - url 184 properties: 185 url: 186 {{- include "url.configuration" . | indent 14 }} 187 hash: # optional sha256 hash to match against wasm file (it's optional, but recommended) 188 type: string 189 pattern: "^[a-fA-F0-9]{64}$" 190 {{- end }}