New Relic Inc.

01/24/2022 | News release | Distributed by Public on 01/24/2022 11:18

Autoscaling Kubernetes pods with HPA and New Relic One

  • The HPA is configured to autoscale the manipulation-service deployment.
  • The maximum number of replicas created is 10 and the minimum is one.
  • The HPA will autoscale based on the metric manipulate_average_requests. This should be the same name as the metric defined above in the helm chart.

Every 30 seconds, Kubernetes queries the New Relic API for the value of the metric and autoscales the manipulation-service deployment if necessary. You can autoscale your Kubernetes deployments based on multiple metrics. The autoscaler will select the metric that creates the most replicas and change the frequency of fetching metrics.

Make sure to apply the new YAML file by running

Navigate to the url of the deployed site by running:

Then open the EXTERNAL-IP that you see for frontend-service in your browser.

Next, install hey (and Go v1.17) with the following command in your terminal:

After installing hey, confirm it's installed correctly with the command in your terminal.

Now you can send GET requests to the EXTERNAL-IP of the frontend with the following command:

This opens 2 connections and sends 10 requests. Each request is a GET request to .

You can see the HPA autoscaling by running: