EKS HPA's apiVersion fails to stay at v2beta2

0

When I deploy my HPA's I am choosing apiVersion: autoscaling/v2beta2 but kubernetes is making them autoscaling/v2beta1

For example: If I deploy this.

apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: surething-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: surething
  minReplicas: 2
  maxReplicas: 4
  behavior:
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
      - type: Percent
        value: 100
        periodSeconds: 15
    scaleUp:
      stabilizationWindowSeconds: 0
      policies:
      - type: Percent
        value: 100
        periodSeconds: 15
      - type: Pods
        value: 4
        periodSeconds: 15
      selectPolicy: Max
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization 
        averageUtilization: 100

I will get this

apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: surething-hpa
  namespace: dispatch-dev
  uid: 189cee35-c000-410b-954e-c164a08809e1
  resourceVersion: '404150989'
  creationTimestamp: '2021-04-04T17:30:48Z'
  labels:
    app: dispatch
    deployment: dev
    microservice: surething
  annotations:...
  selfLink:...
status:...
spec:
  scaleTargetRef:
    kind: Deployment
    name: surething
    apiVersion: apps/v1
  minReplicas: 2
  maxReplicas: 4
  metrics:
    - type: Resource
      resource:
        name: cpu
        targetAverageUtilization: 100

All the documentation I can find on EKS and HPA's says that I should be able to use apiVersion: autoscaling/v2beta2. My cluster is version 1.21 and my nodegroup is as well.

When I run kubectl api-versions I can find autoscaling/v2beta2 in the list.

I'm at wits end on this one. Can someone tell me what I am doing wrong?

Kay
asked 2 years ago81 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions