Hello @han chong tan ,
I was testing your scenario and the answer is NO.
Here is the reason :
When you implement Virtual Nodes and if you want your PODS to be scheduled on those Virtual Nodes - you might have to implement below 2 parts in combination with HPA.
- Node Affinity
- Tolerations
Based upon the HPA CPU utilization % it will scale up the PODS , when you have a nodeAffinity like below to reduce the CPU utilization based upon the HPA parameters - If the nodes are not not available , PODS will go and sit on ACI - there by CPU utilization % decreases. So even if a new node gets added as there are no pending PODS + CPU utilization % is less than the target % - hence no new PODS and existing PODS on ACI will not come down to 0.
Example Below YAML:-
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: type
operator: NotIn
values:
- virtual-kubelet
containers:
- name: php-apache
image: k8s.gcr.io/hpa-example
ports:
- containerPort: 80
resources:
limits:
cpu: 500m
requests:
cpu: 500m
tolerations:
- key: virtual-kubelet.io/provider
operator: Exists
- effect: NoSchedule
key: azure.com/aci