Horizontal Pod Autoscaling (HPA) is only supported by NF testnf-du-large.
Follow the below steps to enable it.
-
Prepare values.yml to have contents like this. The content follow the same format as https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v2/#HorizontalPodAutoscalerSpec but without scaleTargetRef.
The following HPA content aligns with Kubernetes version v1.23+. For lower versions, please follow this guide https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v1/#HorizontalPodAutoscalerSpec.
hpa: maxReplicas: 2 minReplicas: 1 metrics: - resource: name: cpu target: averageUtilization: 20 type: Utilization type: Resource
-
Please make sure the selected nodepool where testnf-du-large would be onboarded has at least 2 nodes, otherwise the new scaled-up pod would be in pending status.
-
Follow TestNF DU Large Onboard and Instantiation Page to instantiate testnf-du-large and select the prepared values.yml.
-
Once testnf-du-large pod is running, you could use cyclictest tool in the testnf-du-large pod to increase the load and you will see a new pod is created.
➜ kubectl -n testnf-du-large exec -ti testnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-4m66p -- bash root [ /opt/vmwaretools ]# cyclic-test-auto -D 5m -E 10 Duration=5m Expected-max=10 log-off=0 out=/tmprun-cyclic-test -D 5m ➜ kubectl get pods -n testnf-du-large -w NAME READY STATUS RESTARTS AGE testnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-4m66p 1/1 Running 0 14m testnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-5nf9j 0/1 Pending 0 0s testnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-5nf9j 0/1 Pending 0 0 stestnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-5nf9j 0/1 ContainerCreating 0 0s testnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-5nf9j 0/1 ContainerCreating 0 2s testnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-5nf9j 0/1 ContainerCreating 0 2s testnf-du-l-cb47d-iu5ed-testnf-du-large-dcccb88d-5nf9j 1/1 Running 0 3s