Jump to content

Kubernetes help


GOLA MANOJ

Recommended Posts

kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2beta2
metadata:
  name: request-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: app-deployment
  minReplicas: {{ .Values.hpa.minReplicas }}
  maxReplicas: {{ .Values.hpa.maxReplicas }}
  metrics:
  - type: External
    external:
      metric:
        name: requests_avg
      target:
        type: Value
        value: {{ .Values.hpa.targetValue }}

Above HPA , there is nothing special about it. Actual part is to expose the metrics to Prometheus - it depends on application - for ex: if it is Java/ SpringBoot then you can use io.micrometer.core.instrument.Metrics.counter. 

Whats left is prometheus adapter configuration - see documentation at https://github.com/kubernetes-sigs/prometheus-adapter and walk through - it has examples of how to add "rules". 
https://github.com/kubernetes-sigs/prometheus-adapter/blob/master/docs/walkthrough.md

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...