简体   繁体   中英

Kubernetes enabling or disabling Keda and HPA

Is there a 'master switch' to enable/disable Keda and HPA? I can enable/disable scaling rules by editing the replicacount to 0, but is there a main enalbe/disable field?

  cooldownPeriod: 1800
  maxReplicaCount: 8
  minReplicaCount: 2
  pollingInterval: 300

You can enable/disable scaling rules either by editing the replica count to 0 or you can use a single field called Pause autoscaling .

Pause autoscaling lets you enable/disable autoscaling by using autoscaling.keda.sh/paused-replicas annotation. It can be useful to instruct KEDA to pause autoscaling of objects, if you want to do cluster maintenance or you want to avoid resource starvation by removing non-mission-critical workloads.

You can enable this by adding the below annotation to your ScaledObject definition:

metadata:
  annotations:
    autoscaling.keda.sh/paused-replicas: "0"

The presence of this annotation will pause autoscaling no matter what number of replicas is provided. The above annotation will scale your current workload to 0 replicas and pause autoscaling. You can set the value of replicas for an object to be paused at any arbitrary number. To enable autoscaling again, simply remove the annotation from the ScaledObject definition.

Refer to the KEDA documentation for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM