-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPA error, GKE unable to read custom metric requests-per-second. #254
Comments
Is your app listening on port |
My app is listening on port 8080. Sorry, I was thinking that 9090 is the port your service reads logs from. |
I have also tried the Prometheus queries based on the example provided in the link https://medium.com/google-cloud/kubernetes-autoscaling-with-istio-metrics-76442253a45a . I am getting the following error:
|
You HPA above suggest you want to scale based on metrics exposed by the application itself on Note the blog post you refer to is based on the older format, so it's slightly different. See the link above to get the right configuration for Prometheus based scaling. |
I have tried the example from seeing the following error: |
Hello, and sorry for commenting on an old issue. But I am new to this k8s world and I'm just trying to get the HPA to work properly for the PHP application at my work. How do I get this to run in our GKE instance? I'm sorry for these noob questions. I'm just trying to learn and understand. And learning k8s on GKE hasn't been the easiest with all these differences. Our application runs on port 8000 when running only the php application docker image. But there is an nginx before the php app. Sorry but I'm a bit confused by all of this. I have just ran the same logs command, and I get a similar error message. I am also using a load balancer to forward port 80 to 8080. So I have just updated the custom metrics HPA to use that port instead. @mikkeloscar You are saying that the HPA he has provided in the original issue. Suggests that he wants to scale based on metrics exposed by the application itself on /metrics . Isn't his example the example from the readme? I know our application isn't running a /metrics by itself unless we do something. But how do we get these metrics to run on /metrics and if it isn't supposed to run on the application, what port should we put instead? I am running a GKE cluster with an sql-proxy, nginx and fpm container in a deployment. the nginx containerPort=80 and fpm containerPort=9000. apiVersion: v1
kind: Service
metadata:
name: internal-service-prod
namespace: default
spec:
type: NodePort
selector:
name: my-api-prod # Match the name of the container so k8s knows which pods to route traffic to
ports:
- port: 8080
targetPort: 80 # Math container port from deployment.yaml |
I am trying to create a custom metric based auto-scaling based on requests per second on GKE.
Installed the kube-metrics-adapter by applying https://github.com/zalando-incubator/kube-metrics-adapter/tree/master/docs yaml files.
On GKE cluster, enabled istio and installed Prometheus using
After installing, created an HPA based on the example provided in the readme
Exposed application using load balancer by port forwarding from port 80 to container 8080 port.
In cloud console, it shows an error that "HPA cannot read metric value"
Checked the error log by running
kubectl -n kube-system logs deployment/kube-metrics-adapter
Seeing the following error:
Thanks
The text was updated successfully, but these errors were encountered: