Arguments
Values and runtime configuration can be set via cli arguments.
Values
The Values will be applied to the cli scope.
Valid Values
- --upscale-period
- --default-uptime
- --downscale-period
- --default-downtime
- --downtime-replicas
- --explicit-include
--explicit-include
will set the exclude value to true
on the cli scope.
This will exclude every workload unless more specific scopes (e.g.: namespace scope,
workload scope) specify exclude to false
.
Runtime Configuration
The runtime configuration set by the cli arguments will take precedence over their respective environment variables if they are both set.
Valid Config Flags
- --dry-run
- --debug
- --once
- --interval
- --namespace
- --include-resources
- --exclude-namespaces
- --exclude-deployments
- --matching-labels
- --deployment-time-annotation
- --leader-election
- --max-retries-on-conflict
- -k (kubeconfig)
Usage
The CLI arguments can be set in different ways, depending on your setup.
The value of a boolean cli flags can be omitted. This will set its value to true.
Binary or Go Run
# go build cmd/kubedownscaler -o kubedownscaler
kubedownscaler --dry-run --namespace=my-namespace
go run cmd/kubedownscaler --explicit-include=true --interval 60s --exclude-namespaces "kube-.*"
Via Helm Chart values.yaml
Some arguments already have fields that specify them to make configuring them easier. Here is a list compiled of all of the fields that configure their respective cli arguments:
includedResources
directly sets--include-resources
constrainedNamespaces
directly sets--namespace
All other arguments can be used via the arguments
field.
# ...
arguments:
- --interval 2m
- --downscale-period "Sat-Sun 00:00-24:00 Europe/Paris"
# ...