prometheus-adapter | An implementation of the custom.metrics.k8s.io API | Analytics library
kandi X-RAY | prometheus-adapter Summary
kandi X-RAY | prometheus-adapter Summary
This repository contains an implementation of the Kubernetes resource metrics, custom metrics, and external metrics APIs. This adapter is therefore suitable for use with the autoscaling/v2 Horizontal Pod Autoscaler in Kubernetes 1.6+. It can also replace the metrics server on clusters that already run Prometheus and collect the appropriate metrics.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prometheus-adapter
prometheus-adapter Key Features
prometheus-adapter Examples and Code Snippets
Community Discussions
Trending Discussions on prometheus-adapter
QUESTION
I am trying to create a HPA using Prometeus and Prometeus Adapter.
I am getting a "unexpected GroupVersion" error in the Status and I just have no idea what it means.
...ANSWER
Answered 2022-Mar-09 at 06:28Update your spec like below.
"/apps/v1" to "apps/v1"
QUESTION
I'm testing out HPA with custom metrics from application and exposing to K8s using Prometheus-adapter.
My app exposes a "jobs_executing" custom metric that is a numerical valued guage (prometheus-client) in golang exposing number of jobs executed by the app (pod).
Now to cater this in hpa, here is how my HPA configuration looks like:
...ANSWER
Answered 2021-Nov-05 at 20:03From the docs:
All metrics in the HorizontalPodAutoscaler and metrics APIs are specified using a special whole-number notation known in Kubernetes as a quantity. For example, the quantity 10500m would be written as 10.5 in decimal notation. The metrics APIs will return whole numbers without a suffix when possible, and will generally return quantities in milli-units otherwise. This means you might see your metric value fluctuate between 1 and 1500m, or 1 and 1.5 when written in decimal notation.
So it does not seem like you are able to adjust the unit of measurement that the HPA uses, the generic Quantity.
QUESTION
I am trying to get Kafka topic lag into Prometheus and finally to the APIServer in order to utilize an external metrics HPA for my application.
I am getting the error no metrics returned from external metrics API
...ANSWER
Answered 2021-Apr-21 at 16:57In a long tradition of answering my own questions after I ask them, here's what's wrong with the above configuration.
The error lies in the prometheus-adapter yaml:
QUESTION
Following the guide that google made for deploying an HPA in Google Kubernetes Engine: https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics
And adding the right permissions because I am using Workload Identity with this guide: https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-metrics-stackdriver-adapter
And also adding the firewall-rule commented here: https://github.com/kubernetes-sigs/prometheus-adapter/issues/134
I am stuck in a point where the HPA returns me this error:
...ANSWER
Answered 2021-Apr-13 at 22:42Resolved for me!
After a several of test, changing in the HPA yaml,
the metric from Pod
to External
, and the metric name with custom.google.apis/my-metric
, it works!
QUESTION
I have two deployments running a v1 and v2 of the same service in istio. I have set up a custom-metric 'istio-total-requests' to be collected through prometheus adapater.
I have set up an HPA to scale the v2 deployment and can see the target value increasing when I send requests, but what is not happening is the HPA is not scaling the number of pods/replicas.
I am running kubernetes v1.19 on minikube v1.13.1, and cannot understand why its not scaling.
...ANSWER
Answered 2021-Jan-07 at 09:25According to your screenshot, HPA works as expected because your metric value is lower than the threshold. If the value does not go over your threshold value, HPA will not trigger the scale up. Instead, it may trigger the scale down in your case.
The metric you are using right now is istio_requests_per_second
. That is calculated by the total request per second. The first screenshot show the average value is 200m
, which will be 0.2
. Your threshold is 10
so HPA definitely would not scale up in this case.
For the selector, it gives you the ability to select your target label under the metrics. For example, if you want to scale the instances against the GET
method only. You can define the selector matching the GET
method label in this case.
QUESTION
I am using this to export metrics from Prometheus to Kubernetes. That seems to be working. I can (successfully) see the metric names with
...ANSWER
Answered 2020-Feb-26 at 10:55You need to be more specific for the Kubernetes API.
If you deployed everything correctly and everything is working as it should when you use
QUESTION
For now I have prometheus and prometheus adapter in different namespaces:
I tried to configure adapter YML but I was not successful: apiVersion: apps/v1 kind: Deployment metadata:
...ANSWER
Answered 2020-Feb-08 at 03:25You can not edit an existing resource to change namespace.You need to delete the existing deployment first and then recreate the deployment in another namespace.
Edit:
With Helm2 you need to delete the release first helm delete --purge release-name
and then deploy it to different namespace as helm install stable/prometheus-adapter --namespace namespace-name
With helm 3 since there is no --namespace
flag you need to delete the existing deployment and then redeploy it to a different namespace as below example to deploy metrics server.
QUESTION
To address the default AWS VPC CNI max pod number node limit (Max Pods = Maximum supported Network Interfaces for instance type) * ( IPv4 Addresses per Interface) - i.e. 17 in a t3.medium) in my EKS cluster I started using Weave CNI Plugin to overcome that limitation.
This brings a caveat, if you have an application or container running in the overlay network and the Kubernetes master node / API needs to talk to it, it won't work. For instance, the ApiService v1beta1.metrics.k8s.io
tries to connect to metrics-server
pods running in the overlay network and it won't succeed.
A proposed solution is to run metrics-server
with hostNetwork: true
which works just fine.
My problems started when we decided to have custom-metrics
with prometheus-adapter
so that we could have metrics from Kafka consumer group lag for horizontal autoscaling of the consumer pods.
To have the ApiService v1beta1.custom.metrics.k8s.io
talking with prometheus-adapter
pod we also have to set hostNetwork: true
but this time the prometheus-adapter
cannot access the Prometheus running in the overlay network anymore - and we cannot move everything to the host network!
I'm kind of in a dead-end here. I guess I could use some "tool" to forward the metrics that I need from the overlay network Prometheus to another Prometheus in the host network which would be then used by prometheus-adapter?
...ANSWER
Answered 2020-Feb-05 at 15:57Problem solved. I was testing connectivity with telnet but somehow wget works just fine.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prometheus-adapter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page