Skip to content

Commit

Permalink
Update CRD with new horizontal scaling triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed May 8, 2024
1 parent 9a9677c commit d2555ed
Show file tree
Hide file tree
Showing 5 changed files with 608 additions and 10 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,18 @@ CUSTOM_RESOURCE_VERSION=v1

.PHONY: code-gen
code-gen: bootstrap
echo
# Hack to enable generate-groups to work outside of GOROOT
mkdir -p github.com/equinor/radix-operator/ && ln -s $$(pwd)/pkg $$(pwd)/github.com/equinor/radix-operator/pkg

$$(go env GOPATH)/pkg/mod/k8s.io/code-generator@$(KUBE_CODEGEN_VERSION)/generate-groups.sh all \
$(ROOT_PACKAGE)/pkg/client \
$(ROOT_PACKAGE)/pkg/apis \
$(CUSTOM_RESOURCE_NAME):$(CUSTOM_RESOURCE_VERSION) \
--go-header-file hack/boilerplate.txt

# Remove hack
rm -Rf ./github.com

.PHONY: crds
crds: temp-crds radixapplication-crd radixbatch-crd radixdnsalias-crd delete-temp-crds

Expand Down
183 changes: 179 additions & 4 deletions charts/radix-operator/templates/radixapplication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@ spec:
Configuration for automatic horizontal scaling of replicas.
More info: https://www.radix.equinor.com/references/reference-radix-config/#horizontalscaling
properties:
cooldownPeriod:
description: CooldownPeriod to wait after the last
trigger reported active before scaling the resource
back to 0. Defaults to 5min
format: int32
type: integer
maxReplicas:
description: Defines the maximum number of replicas.
format: int32
Expand All @@ -436,9 +442,15 @@ spec:
format: int32
minimum: 0
type: integer
pollingInterval:
description: PollingInterval configures how often
to check each trigger on. Defaults to 30sec
format: int32
type: integer
resources:
description: Defines the resource usage parameters
for the horizontal pod autoscaler.
description: |-
Defines the resource usage parameters for the horizontal pod autoscaler.
Deprecated Use a CPU or Memory triggers instead
properties:
cpu:
description: Defines the CPU usage parameters
Expand Down Expand Up @@ -469,8 +481,84 @@ spec:
- averageUtilization
type: object
type: object
triggers:
description: Defines a list of triggers the component
replicas will scale on.
items:
description: RadixTrigger defines configuration
for a specific trigger.
properties:
cpu:
properties:
metricType:
description: Defines the type of metric
to use. Options are Utilization or AverageValue.
Defaults to Utilization.
type: string
value:
description: |-
Value to trigger scaling actions for:
When using Utilization, the target value is the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.
When using AverageValue, the target value is the target value of the average of the metric across all relevant pods (quantity).
format: int32
type: integer
required:
- value
type: object
cron:
properties:
desiredReplicas:
description: DesiredReplicas Number of replicas
to which the resource has to be scaled
between the start and end of the cron
schedule. Defaults to 1
format: int32
type: integer
start:
description: Start is a Cron expression
indicating the start of the cron schedule.
type: string
stop:
description: Stop is a Cron expression indicating
the Stop of the cron schedule.
type: string
timezone:
description: Timezone One of the acceptable
values from the IANA Time Zone Database.
The list of timezones can be found here.
Defaults to Europe/Oslo
type: string
required:
- start
- stop
type: object
memory:
properties:
metricType:
description: Defines the type of metric
to use. Options are Utilization or AverageValue.
Defaults to Utilization.
type: string
value:
description: |-
Value to trigger scaling actions for:
When using Utilization, the target value is the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.
When using AverageValue, the target value is the target value of the average of the metric across all relevant pods (quantity).
format: int32
type: integer
required:
- value
type: object
name:
type: string
required:
- name
type: object
type: array
required:
- cooldownPeriod
- maxReplicas
- pollingInterval
type: object
identity:
description: |-
Expand Down Expand Up @@ -933,6 +1021,12 @@ spec:
Configuration for automatic horizontal scaling of replicas.
More info: https://www.radix.equinor.com/references/reference-radix-config/#horizontalscaling
properties:
cooldownPeriod:
description: CooldownPeriod to wait after the last trigger
reported active before scaling the resource back to 0.
Defaults to 5min
format: int32
type: integer
maxReplicas:
description: Defines the maximum number of replicas.
format: int32
Expand All @@ -943,9 +1037,15 @@ spec:
format: int32
minimum: 0
type: integer
pollingInterval:
description: PollingInterval configures how often to check
each trigger on. Defaults to 30sec
format: int32
type: integer
resources:
description: Defines the resource usage parameters for the
horizontal pod autoscaler.
description: |-
Defines the resource usage parameters for the horizontal pod autoscaler.
Deprecated Use a CPU or Memory triggers instead
properties:
cpu:
description: Defines the CPU usage parameters for the
Expand Down Expand Up @@ -974,8 +1074,83 @@ spec:
- averageUtilization
type: object
type: object
triggers:
description: Defines a list of triggers the component replicas
will scale on.
items:
description: RadixTrigger defines configuration for a
specific trigger.
properties:
cpu:
properties:
metricType:
description: Defines the type of metric to use.
Options are Utilization or AverageValue. Defaults
to Utilization.
type: string
value:
description: |-
Value to trigger scaling actions for:
When using Utilization, the target value is the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.
When using AverageValue, the target value is the target value of the average of the metric across all relevant pods (quantity).
format: int32
type: integer
required:
- value
type: object
cron:
properties:
desiredReplicas:
description: DesiredReplicas Number of replicas
to which the resource has to be scaled between
the start and end of the cron schedule. Defaults
to 1
format: int32
type: integer
start:
description: Start is a Cron expression indicating
the start of the cron schedule.
type: string
stop:
description: Stop is a Cron expression indicating
the Stop of the cron schedule.
type: string
timezone:
description: Timezone One of the acceptable values
from the IANA Time Zone Database. The list of
timezones can be found here. Defaults to Europe/Oslo
type: string
required:
- start
- stop
type: object
memory:
properties:
metricType:
description: Defines the type of metric to use.
Options are Utilization or AverageValue. Defaults
to Utilization.
type: string
value:
description: |-
Value to trigger scaling actions for:
When using Utilization, the target value is the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.
When using AverageValue, the target value is the target value of the average of the metric across all relevant pods (quantity).
format: int32
type: integer
required:
- value
type: object
name:
type: string
required:
- name
type: object
type: array
required:
- cooldownPeriod
- maxReplicas
- pollingInterval
type: object
identity:
description: |-
Expand Down
Loading

0 comments on commit d2555ed

Please sign in to comment.