amazon-archives / k8s-cloudwatch-adapter

An implementation of Kubernetes Custom Metrics API for Amazon CloudWatch
Apache License 2.0
158 stars 98 forks source link

Understanding TARGETS #33

Open linkyndy opened 4 years ago

linkyndy commented 4 years ago

Hello,

Great job with this adapter! I've started playing with it and it's great; however, I don't get how should I interpret the TARGET column when doing a kubectl get hpa/...:

TARGETS
6262500m/30 (avg)

Would love some insights so I can understand this better. Thanks!

chankh commented 4 years ago

You can refer to the HPA docs for details about how HPA works. The TARGETS here shows current average value is 6262500m and the target average value is 30.

dannylesnik commented 4 years ago

@chankh First of all thank you for this project it scale really well. However, I don't understand what this value means. I tested it with scale-out event for several hours where constant number of 500 messages were in the queue. and my HPA show the following results:

sqs-consumer-scaler   Deployment/sqs-consumer   166667m/10 (avg)   1         15        15         11h
sqs-consumer-scaler   Deployment/sqs-consumer   133334m/10 (avg)   1         15        15         11h
sqs-consumer-scaler   Deployment/sqs-consumer   100/10 (avg)       1         15        15         11h
sqs-consumer-scaler   Deployment/sqs-consumer   66667m/10 (avg)    1         15        15         11h
sqs-consumer-scaler   Deployment/sqs-consumer   33334m/10 (avg)    1         15        15         11h
sqs-consumer-scaler   Deployment/sqs-consumer   0/10 (avg)         1         15        15         11h

What does those 'm's mean? Why they are different, although the number of messages in the queue is constant?

I understand what Targets means in HPA, however I don't understand how those numbers refer to 'ApproximateNumberOfMessagesVisible' metric in Cloudwhatch.

Thanks.