How to scale down to replicas=0 #902
Replies: 3 comments
-
This is a bit strange. KEDA itself doesn't update the spec of the crd, only the status. do you have gitops or something else thats enforcing a desired state for the cluster that might be reupdating the crd? |
Beta Was this translation helpful? Give feedback.
-
As a separate option, we scale down the keda-operator pod before scaling down deployments during maintenance windows. Then scale up the operator when done and let it scale back up specific deploys as needed. |
Beta Was this translation helpful? Give feedback.
-
If someone finds it self with this issue use this annotation on your scaleobject:
https://keda.sh/docs/2.13/concepts/scaling-deployments/#pause-autoscaling |
Beta Was this translation helpful? Give feedback.
-
How can I scale down my deployment to replicas=0 for node maintenance ?
My deployment is managed via Keda
I tried to manually edit the scaled object but
kubectl edit scaledobjects.keda.k8s.io cloud-ingestionuseractivitysvc-scaler
spec:
maxReplicaCount: 10
minReplicaCount: 3
both to 0 but then it immediately changes back (below is the full desc of keda scaled object)
Error: required flag(s) "replicas" not set
sysdev@imabvlsys-496:~/.kube$ kubectl scale ScaledObject cloud-ingestionuseractivitysvc-scaler --replicas=0
Error from server (NotFound): the server could not find the requested resource (patch scaledobjects cloud-inge
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
creationTimestamp: "2020-04-16T22:21:47Z"
finalizers:
generation: 3
labels:
app: cloud-ingestionuseractivitysvc
deploymentName: cloud-ingestionuseractivitysvc
name: cloud-ingestionuseractivitysvc-scaler
namespace: cloud
resourceVersion: "25130625"
selfLink: /apis/keda.k8s.io/v1alpha1/namespaces/cloud/scaledobjects/cloud-ingestionuseractivitysvc-scaler
uid: 429390f5-e86c-4bdd-9acf-1ef6b001dbf0
spec:
maxReplicaCount: 10
minReplicaCount: 3
scaleTargetRef:
deploymentName: cloud-ingestionuseractivitysvc
triggers:
connection: EventBusSettings__ConnectionString
queueLength: "5"
subscriptionName: UserActivityIngester
topicName: eventbus
type: azure-servicebus
status:
externalMetricNames:
lastActiveTime: "2020-06-29T14:41:44Z"
Beta Was this translation helpful? Give feedback.
All reactions