Hi Janaka, Jerzy, Sander and everyone, There is something unclear for me to understand the setup so I just wanna ask:
- Do we need Prometheus running in order to do hpa with custom metric (queries per second) ? OR cAdvisor and heapster are enough ? - By binding the configMap to a pod and adding the annotation to HPA manifest, we will be good to have it autoscaled? -Tuna On Thursday, June 16, 2016 at 1:59:28 PM UTC+2, Sander Ploegsma wrote: > > EDIT: never mind, my endpoint was being served over HTTPS, which made it > insecure as the certificate wasn't valid for 'localhost'. When using HTTP > everything works as expected. Marking as resolved. > > Hi, Janaka, > > Could you show how you got it working exactly? I tried setting everything > up according to the documentation proposed in the PR, but it's a bit > unclear how the endpoint should be structured. > > My steps: > > - Enabled custom metrics on the cluster > - Created an endpoint on my application that returns the number of > open connections > - Created this exact ConfigMap: > apiVersion: v1 > kind: ConfigMap > metadata: > name: cm-config > data: > # Use Prometheus structure, see > https://github.com/google/cadvisor/blob/master/docs/application_metrics.md > definition.json: "{\"endpoint\" : \"http://localhost:8443/metrics\", > {\"metrics_config\" : [{\"name\" : \"connections\", \"metric_type\" : > \"gauge\", \"data_type\" : \"int\", \"polling_frequency\" : 10, \"units\" > : > \"number of active connections\"}]}}" > > - Mapped the hostPort and containerPort in the RC > - Mounted the ConfigMap in my ReplicationController to > /etc/custom-metrics > - Added this exact annotation to my HPA: > alpha/target.custom-metrics.podautoscaler.kubernetes.io: > '{"items":[{"name":"connections", > "value": "1000"}]}' > > However, the HPA is unable to get my custom metrics. I also couldn't find > any way to debug the setup, all I see is 'FailedGetCustomMetrics metrics > obtained for 0/1 of pods' when I check the HPA events. > > Cheers, > > Sander > > On Wednesday, May 4, 2016 at 6:17:50 PM UTC+2, Janaka Bandara wrote: >> >> Hi Jerzy, >> >> Thanks! >> I tried the approach in the PR and it worked fine. >> >> >> (I found the same links a few days ago from a different source, but could >> not update this thread on time.) >> >> -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.