Comments (6)
I just took that for a spin and it seems to solve the issue!
❯ ksys logs -f deploy/workerpodautoscaler | grep dev-inventa-root-user-queue
W0921 18:11:57.103341 1 controller.go:430] dev-queue qMsgs: -1 not uninitialized, waiting for init to complete
I0921 18:12:15.097447 1 controller.go:450] dev-queue qMsgs: 6869, desired: 4
I'll keep an eye out for when you cut a new version, but this is working great in the meantime.
from k8s-worker-pod-autoscaler.
It might be a bug. Thanks for reporting.
What do you mean by WPA to -1 here? Does it mean desired replica is being set to -1?
it temporarily sets the value on all of my wpas to -1,
Many values are initialised to -1 on startup. They are updated as we get their recent values. There could be a bug causing this, need to debug. Detailed logs of the event can help me troubleshoot.
from k8s-worker-pod-autoscaler.
I'll try to demo what I'm seeing with some more concrete examples.
But essentially, we run most of our workloads on AWS Spot instances, so then can go away/restart at any time (I've also seen a random error caused the pod to crash or restart).
I can easily see this if i restart the pod manually:
kubectl -n kube-system rollout restart deploy/workerpodautoscaler
So when that happens what I see:
k get wpa -ocustom-columns=NAME:.metadata.name,QUEUE:.status.CurrentMessages,DEPLOYMENTS:.status.AvailableReplicas,MIN:.spec.minReplicas,MAX:.spec.maxReplicas <redacted-wpa-name> -w
NAME QUEUE DEPLOYMENTS MIN MAX
<redacted-wpa-name> 3 1 0 4
<redacted-wpa-name> -1 1 0 4
<redacted-wpa-name> 2 0 0 4
<redacted-wpa-name> 0 1 0 4
and for the deployment
❯ k get deploy <redacted-deployment> -w
NAME READY UP-TO-DATE AVAILABLE AGE
<redacted-deployment> 1/1 1 1 7d
<redacted-deployment> 1/0 1 1 7d
<redacted-deployment> 1/0 1 1 7d
<redacted-deployment> 0/0 0 0 7d
<redacted-deployment> 0/1 0 0 7d
<redacted-deployment> 0/1 0 0 7d
<redacted-deployment> 0/1 0 0 7d
<redacted-deployment> 0/1 1 0 7d
<redacted-deployment> 1/1 1 1 7d
So essentially the queues gets set to -1, the deployment gets scaled to zero, all the pods terminate, it gets the queue value from sqs, and then scales the deployment back up to 1, new pods restart.
Also, as I mentioned, I have a LOT of wpa and deployments (in the hundreds) so this causes a huge swing of pod restrats across the entire cluster.
from k8s-worker-pod-autoscaler.
I would think, upon startup, that if a value currently exists, it wouldn't reset it back to -1 unless it was unsuccessfully able to get metrics from SQS, and then maybe then.
from k8s-worker-pod-autoscaler.
Thanks for the details.
-1 in queue size should not cause scale down. As it is uninitialized value.
Let me find the issue and fix the bug.
from k8s-worker-pod-autoscaler.
@aleclerc-sonrai Trying out a fix in https://github.com/practo/k8s-worker-pod-autoscaler/pull/137/files
Would you be able to use this image for your WPA pod and see if this fixes the issue?
practodev/workerpodautoscaler:v1.4.1-1-g73ba5c4
from k8s-worker-pod-autoscaler.
Related Issues (20)
- Scaling with spiky queues HOT 6
- Deployment gets stuck MinimumReplicasUnavailable HOT 2
- Question: Gracefull shutdown? HOT 2
- Multi Queue support with one WPA object. HOT 4
- WPA Status is not updating in k8s1.19 - add support for k8s 1.19
- Scale based on: `numMessages +1` HOT 2
- How to achieve near realtime scheduling of pods? HOT 3
- What is the best way to access WPA controllers? HOT 6
- min=0, max=0 should not lead to scale up of deployments HOT 1
- Cannot get qMsgs if the WPA deleted and re-created HOT 3
- Changes for Kubernetes 1.22 support
- does WPA support Amazon MQ, will it be provided in near future? HOT 1
- Deploymets scaled down very quickly despite low maxDisruption HOT 20
- Does WPA kill pods if the queue length decreases? HOT 7
- The manifest for public.ecr.aws/practo/workerpodautoscaler:v1.6.0 is not found on the public ECR HOT 3
- Unable to fetch queue messages HOT 8
- Does this support multiple SQS Queues monitoring? HOT 1
- Does't work with localstack
- IRSA (IAM Roles for Service Accounts) Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k8s-worker-pod-autoscaler.