Skip to main content
Version: Next 🚧

Workload Types

Valid values for the workload type are the case-insensitive Kubernetes resource names of the workloads. Workload types to be included in the scaling process can be specified using the --include-resources argument at the CLI Scope

List of Workload Types​

Here is a list of all the workload types supported by KubeDownscaler and how they are scaled.

Cronjobs​

  • id: cronjobs
  • resource: cronjob.v1.batch

Scales by setting the cronjobs suspend property to true, which halts further scheduled runs of the Cronjob.

Daemonsets​

  • id: daemonsets
  • resource: daemonset.v1.apps

Scales by setting the node selector to match none of the nodes, which stops pods from running on any node.

Deployments​

  • id: deployments
  • resource: deployment.v1.apps

Scales by setting the replica count to the downscale replicas.

HPAs​

  • id: horizontalpodautoscalers
  • resource: horizontalpodautoscaler.v2.autoscaling

Scales by setting the minReplicas to the downscale replicas. If the downscale replicas are less than 1 it will throw an error. When restoring the original minReplicas value, if minReplicas happens to be greater than the current maxReplicas value, the downscaler will set minReplicas to the current maxReplicas value to avoid configuration errors.

Jobs​

  • id: jobs
  • resource: job.v1.batch

Scales by setting the suspend property to true, which stops the execution of the job until it is upscaled again.

PodDisruptionBudgets​

  • id: poddisruptionbudgets
  • resource: poddisruptionbudget.v1.policy

Scales by setting the maxUnavailable or minAvailable properties (depending on which one is used) to the downscale replicas. Percentage values are supported as well

ScaledObjects​

  • id: scaledobjects
  • resource: scaledobject.v1alpha1.keda.sh

Scales by setting the paused replicas annotation to the downscale replicas, which scales the workloads managed by the scaled object to the downscale replicas.

When scaled objects are being scaled the downscaler will automatically exclude the workloads the scaled objects are managing to avoid conflicts.

Statefulsets​

  • id: statefulsets
  • resource: statefulset.v1.apps

Scales by setting the replica count to the downscale replicas.

Rollouts​

  • id: Rollouts
  • resource: rollout.v1alpha1.argoproj.io

Scales by setting the replica count to the downscale replicas. When .spec.workloadRef is present the downscaler ensures the template is resolved from the referenced workload as specified in the Argo Rollouts documentation (see the comments above .spec.workloadRef and .spec.template)

Applications​

  • id: applications
  • resource: application.v1alpha1.argoproj.io

Scales by suspending auto-sync self-heal on the Argo CD Application (spec.syncPolicy.automated.selfHeal is set to false) and restores the original value when the workload is upscaled.

Stacks​

  • id: stacks
  • resource: stack.v1.zalando.org

Scales by setting the replica count to the downscale replicas.

Prometheuses​

  • id: prometheuses
  • resource: prometheus.v1.monitoring.coreos.com

Scales by setting the replica count to the downscale replicas.

AutoscalingRunnerSets​

  • id: autoscalingrunnersets
  • resource: autoscalingrunnerset.v1alpha1.actions.github.com

Scales by setting the minRunners count to the downscale replicas.

Services​

  • id: services
  • resource: services.v1

Scales by setting the type to ClusterIP.

AWSELBServices​

  • id: awselbservices
  • resource: services.v1

Scales by setting the type to ClusterIP. Only services without the service.beta.kubernetes.io/aws-load-balancer-type annotation or with the service.beta.kubernetes.io/aws-load-balancer-type annotation set to a value different from nlb are scaled.

AWSNLBServices​

  • id: awsnlbservices
  • resource: services.v1

Scales by setting the type to ClusterIP. Only services with the service.beta.kubernetes.io/aws-load-balancer-type annotation set to nlb are scaled.

Ingresses​

  • id: ingresses
  • resource: ingresses.v1.networking.k8s.io

Scales by setting the IngressClassName of the Ingress object to downscaler-ingress-class. In a constrained installation, the IngressClass object with the name downscaler-ingress-class must be provisioned by a cluster administrator having the necessary cluster-wide permissions

Gateways​

  • id: gateways
  • resource: gateway.v1.networking.k8s.io

Scales by setting the GatewayClassName of the Gateway object to downscaler-gateway-class. In a constrained installation, the GatewayClass object with the name downscaler-gateway-class must be provisioned by a cluster administrator having the necessary cluster-wide permissions

Postgresqls​

  • id: postgresqls
  • resource: postgresql.v1.acid.zalan.do

Scales by setting the numberOfInstances count to the downscale replicas.

MongoDBCommunities​

  • id: mongodbcommunities
  • resource: mongodbcommunity.v1.mongodbcommunity.mongodb.com

Scales by setting the spec.members count to the downscale replicas. The MongoDB Community Operator stops reconciling the StatefulSet once members is 0, so it does not scale the pods down by itself. The downscaler scales that StatefulSet directly instead, always, regardless of the scale-children scope setting. Downscaling the CR alone would have no effect on the running pods. The chart grants the RBAC needed to scale that StatefulSet automatically whenever mongodbcommunities is in includedResources.

As a safety measure, a MongoDBCommunity is never scaled to 0 unless it carries the operator-written annotation mongodb.com/v1.lastSuccessfulConfiguration. Without it, the operator has no known-good configuration to restore on wake, so the downscaler refuses and logs instead. Scaling up is never refused.

CnpgClusters​

  • id: cnpgclusters
  • resource: cluster.v1.postgresql.cnpg.io

Scales by toggling the cnpg.io/hibernation annotation between "on" and "off". The CloudNativePG Operator handles both directions on its own. Hibernating deletes every instance pod itself, preserving the underlying volumes. Clearing it recreates them, with no bookkeeping needed from the downscaler.

MariaDBs​

  • id: mariadbs
  • resource: mariadb.v1alpha1.k8s.mariadb.com

Scales by setting spec.replicas to the downscale replicas. The mariadb-operator propagates that value to its StatefulSet, including 0. It does not scale the metrics exporter Deployment it owns, which would crash-loop without a database. The downscaler scales that Deployment directly instead, always, regardless of the scale-children scope setting. The chart grants the RBAC needed to scale that Deployment automatically whenever mariadbs is in includedResources.

With Galera enabled, the operator's admission webhook rejects spec.replicas below 2, so a Galera MariaDB is scaled down differently. The downscaler sets spec.suspend: true, which stops the operator from reconciling, and leaves spec.replicas untouched. It also scales the StatefulSet the MariaDB owns to 0 directly. The chart grants the RBAC needed to scale that StatefulSet automatically whenever mariadbs is in includedResources. On wake it sets spec.suspend: false and restores the StatefulSet. It then runs Galera recovery. This bootstraps the cluster from the node with the highest sequence number, so waking up takes a few minutes. A Galera MariaDB whose recovery is disabled is never scaled down, since nothing would bootstrap the cluster on wake. Recovery counts as disabled when spec.galera.recovery is set but spec.galera.recovery.enabled is not true. Downscale replicas of 1 are refused for Galera as well.

A MariaDB with replication enabled is never scaled below 2 replicas, for the same webhook reason; the downscaler refuses and logs instead. Scaling up is never refused.

Kustomizations​

  • id: kustomizations
  • resource: kustomizations.v1.kustomize.toolkit.fluxcd.io

Scales by setting spec.suspend: true to stop the Flux kustomize-controller. The downscaler does not change the replicas of the workloads the Kustomization applies. Those workloads are only scaled when they are scaled by their own downscaler configuration.

KafkaConnects​

  • id: kafkaconnects
  • resource: kafkaconnect.v1.kafka.strimzi.io

Scales by setting the replica count to the downscale replicas. Requires the Strimzi Kafka Operator >=0.49 (the v1 API was introduced in 0.49 and the legacy v1beta2 was removed in 1.0.0).

KafkaMirrorMaker2s​

  • id: kafkamirrormaker2s
  • resource: kafkamirrormaker2.v1.kafka.strimzi.io

Scales by setting the replica count to the downscale replicas. Requires the Strimzi Kafka Operator >=0.49 (the v1 API was introduced in 0.49 and the legacy v1beta2 was removed in 1.0.0).

KafkaBridges​

  • id: kafkabridges
  • resource: kafkabridge.v1.kafka.strimzi.io

Scales by setting the replica count to the downscale replicas. Requires the Strimzi Kafka Operator >=0.49 (the v1 API was introduced in 0.49 and the legacy v1beta2 was removed in 1.0.0).

KruiseStatefulSets​

  • id: advancedstatefulsets
  • resource: statefulset.v1beta1.kruise.io

Scales by setting the replica count to the downscale replicas.

CloneSets​

  • id: clonesets
  • resource: clonesets.v1beta1.kruise.io

Scales by setting the replica count to the downscale replicas.

BroadcastJobs​

  • id: broadcastjobs
  • resource: broadcastjobs.v1beta1.kruise.io

Scales by setting the suspend property to true.

warning

According to Kruise documentation, this won't stop the job from running, but it will prevent new pods from being created.

ImagePullJobs​

  • id: imagepulljobs
  • resource: imagepulljobs.v1beta1.kruise.io

Scales by setting the suspend property to true.

warning

According to Kruise documentation, this won't stop the job from running, but it will prevent new pods from being created.

AdvancedCronJobs​

  • id: advancedcronjobs
  • resource: advancedcronjobs.v1beta1.kruise.io

Scales by setting the suspend property to true, which halts further scheduled runs of the AdvancedCronJob.

AdvancedDaemonSets​

  • id: advanceddaemonsets
  • resource: advanceddaemonsets.v1beta1.kruise.io

Scales by setting the node selector to match none of the nodes, which stops pods from running on any node.

HelmReleases​

  • id: helmreleases
  • resource: helmrelease.v2.helm.toolkit.fluxcd.io

Scales by setting the suspend property to true, which pauses reconciliation of the HelmRelease until it is upscaled again.