YAML File to Achieve HPA and Autoscaler

11/11/2019

YAML File for Horizontal Pod Autoscaler & Cluster Autoscaler

I have cluster ss1 which broken up into 2 agentpools: Pool1 and Pool2 , need to have HPA to run for the Pool2-Worker PODs,which runs on Pool2 with the cluster autoscaler to run on pool2, need to achieve via YAML File, anyways to do both HPA and Cluster Autoscaler in single YAML file,any help files to achieve this

-- Kaavhrit G
kubernetes
yaml

1 Answer

11/11/2019
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: test-app
  namespace: default
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: test-app
  minReplicas: 3
  maxReplicas: 10
  targetCPUUtilizationPercentage: 50

for more you can visit official kubernetes document also.

-- Harsh Manvar
Source: StackOverflow