kubernetes / ingress-nginx

Ingress-NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
16.95k stars 8.14k forks source link

[AutoScaling] Kubernetes Ingress Object Metrics with Community NGINX Ingress Controller #7283

Open chirangaalwis opened 3 years ago

chirangaalwis commented 3 years ago

What would you like to be added:

A custom metrics API implementation for capturing the request count per unit time of a Kubernetes Ingress resource object, when using the community NGINX Ingress Controller in order to be used as a metric for Horizontal Pod Autoscaling (HPA).

The ultimate goal is to be able to add a request per unit time metric to Horizontal Pod Autoscaler as described in the walk through, when using the community NGINX Ingress Controller implementation.

type: Object
object:
  metric:
    name: requests-per-second
  describedObject:
    apiVersion: networking.k8s.io/v1beta1
    kind: Ingress
    name: main-route
  target:
    type: Value
    value: 2k

An example similar to the suggested solution can be found at Skipper collector with the kube-metrics-adapter. This particular solution works when using the skipper Ingress Controller implementation.

Why is this needed:

Notes:

Suggested Assignees:

@rikatz @strongjz

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

chirangaalwis commented 2 years ago

/remove-lifecycle stale

chirangaalwis commented 2 years ago

IMO this is a valid requirement which needs addressing.

chirangaalwis commented 2 years ago

Folks, any update on this?

rikatz commented 2 years ago

Hi @chirangaalwis

I'm with my head a bit under other stuff and couldn't look into this.

If possible, can you provide some implementation PR for us? We can help you on this. Otherwise, you will rely on the availability of some of us, and talking from my side, I'm really on a rush.

Anyway I will add this as something for milestone v1.2.0 and see what we can do, ok?

tao12345666333 commented 2 years ago

We currently have HPA and KEDA related configurations, so this issue mainly wants to add some related metrics, right?

chirangaalwis commented 2 years ago

Hi @chirangaalwis

I'm with my head a bit under other stuff and couldn't look into this.

If possible, can you provide some implementation PR for us? We can help you on this. Otherwise, you will rely on the availability of some of us, and talking from my side, I'm really on a rush.

Anyway I will add this as something for milestone v1.2.0 and see what we can do, ok?

@rikatz ack.

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

chirangaalwis commented 2 years ago

/remove-lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

chirangaalwis commented 2 years ago

/remove-lifecycle stale

iamNoah1 commented 2 years ago

/triage accepted /priority longterm-important

k8s-ci-robot commented 2 years ago

@iamNoah1: The label(s) priority/longterm-important cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/kubernetes/ingress-nginx/issues/7283#issuecomment-1096448275): >/triage accepted >/priority longterm-important Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
iamNoah1 commented 2 years ago

/priority important-longterm

rikatz commented 2 years ago

We currently have HPA and KEDA related configurations, so this issue mainly wants to add some related metrics, right?

Anyone knows if this may help? :D

iamNoah1 commented 2 years ago

/help

k8s-ci-robot commented 2 years ago

@iamNoah1: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes/ingress-nginx/issues/7283): >/help Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
23henne commented 1 year ago

Any updates on this? While reading the walkthrough I thought it was supported OOTB what I learned now is not the case :(

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

luarx commented 1 year ago

This functionality would be so useful... because configuring HPA using CPU/Memory is not accurate as sometimes there are enough resources but worker_connections is reached :(

k8s-triage-robot commented 2 months ago

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted