Usage

Periods

Each scaler definition may include one or more period definitions. These periods are evaluated sequentially, with the first matching period taking precedence. A period can also be set to “reversed” with the reverse field, meaning it is considered inactive between its startTime and endTime, but active outside of that range (before the startTime and after the endTime).

Any Period with the once field set to true will be applied only when entering or living the given time range. If the resources are scaled manually, cloudscaler will not change their state.

Recurring periods

The startTime and endTime must be formated as 12:34.

Fixed periods

The startTime and endTime must be formated as 2006-01-02 15:04:05.

Exemples

periods:
- time:
    recurring:
      days:
        - all
      startTime: "01:00"
      endTime: "22:50"
      timezone: "Europe/Paris"
  minReplicas: 0
  maxReplicas: 10
  type: "down"
ℹ️
The resources will be scaled down to 0 everyday form 1h to 22h50, Paris time.
periods:
- time:
    recurring:
      days:
        - all
      startTime: "01:00"
      endTime: "07:00"
      timezone: "Europe/Paris"
  minReplicas: 0
  maxReplicas: 10
  type: "down"
- time:
    recurring:
      days:
        - all
      startTime: "12:00"
      endTime: "20:00"
      timezone: "Europe/Paris"
  minReplicas: 0
  maxReplicas: 10
  type: "up"
ℹ️
The resources will be scaled down to 0 repliacs everyday form 1h to 7h and scaled up to 10 replicas from 12h to 20h, Paris time.
periods:
- time:
    fixed:
      startTime: "2024-11-15 20:00:00"
      endTime: "2024-11-17 08:00:00"
      timezone: "Europe/Paris"
  minReplicas: 0
  maxReplicas: 10
  type: "down"
ℹ️
The resources will be scaled down to 0 repliacs between the November, 15th 20h00 to November, 17th 08h00, Paris time.

Resources

Kubernetes

The Kubernetes resource can be selected with various parameters, by default, all namespaces are selected excluding the kube-system namespace. Using an excludeNamespaces list will only exclude the specified namespaces. You can use the forceExcludeSystemNamespaces to enforce excluding kube-system namespace.

If no resources are specified, all deployments will be selected. Allowed resources are:

  • deployments
  • statefulsets
  • conjobs
  • horizontalPodAutoscalers

Any resource type can be filtered out by using a labelSelector parameter.

ℹ️
Deployments and HorizontalPodAutoscalers are mutually exclusive