<p>I currently have a service running in my kubernetes cluster which exports my metrics to prometheus which is monitoring my cluster and services.</p>

<p>I want to use a metric from this service to automatically scale (hpa) a second service based on these metrics.</p>

<p>Is this possible to do? </p>

<p>Thanks in advance! </p>

Yonah Dissen
<p>I've managed to make it work! </p>

<p>You can choose the scale target in one parameter and under the metrics section choose the target of a different service. </p>

<p>Example yaml </p>

<pre><code>kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2beta1
metadata:
  name: my-app-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  minReplicas: 1
  maxReplicas: 5
  metrics:
  - type: Object
    object:
      target:
        kind: Service
        name: app-that-generates-metrics
      metricName: my-metric
      targetValue: 10
</code></pre>
