Skip to content
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

Able to template HPA metrics configurations for TargetEndpoint and API #489

Open
renuka-fernando opened this issue Nov 9, 2020 · 0 comments

Comments

@renuka-fernando
Copy link
Contributor

renuka-fernando commented Nov 9, 2020

Description:

It is able to scale backend that is not instrumented with metrics (backends are not exposing metrics) when we use metric type "Object" and refer metrics exposed by the Microgateway. So backend is scaled with metrics exposed by the Microgateway.

In private jet mode if we able to define the API from what the backend should get custom metrics, the above can be achieved. For this, we can use templates for HPA configs.

Example:

For API name: {{$.API}}
For TargetEndpoint name: {{$.TargetEndpoint}}

Sample Config
apiVersion: v1
kind: ConfigMap
metadata:
  name: hpa-configs
  namespace: wso2-system
data:
  targetEndpointMetrics: |
    - type: Object
      object:
        metric:
          name: http_requests_total_value_per_second
        describedObject:
          apiVersion: v1
          kind: Service
          name: {{$.API}}
        target:
          type: Value
          value: 1

{{$.API}} will be replaced with the API(s) name which it is referenced.

Suggested Labels:
Improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant