-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Which component are you using?:
/area cluster-autoscaler
What version of the component are you using?:
Component version: 1.34.0
What did you expect to happen?:
When scheduling a pod, it is in a permanent pending state since there is no k8s.io/cluster-autoscaler/node-template/label/myNodeSelectorLabel tag for ASG
What happened instead?:
Autoscaler successfully scaled up and down a node from the unlabeled ASG
How to reproduce it (as minimally and precisely as possible):
It's rather a question. While configuring the HowTo docs I accidentally skipped the tags that are marked as important for CA.
#ASG
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names eks-web-asg --query 'AutoScalingGroups[0].Tags[].{Key:Key,Value:Value,PropagateAtLaunch:PropagateAtLaunch}' --output table
| Key | PropagateAtLaunch | Value |
+-----------------------------------------+--------------------+--------------------------------+
| eks:cluster-name | True | eks-dev |
| eks:nodegroup-name | True | web-eks-dev |
| k8s.io/cluster-autoscaler/eks-dev | True | owned |
| k8s.io/cluster-autoscaler/enabled | True | true |
| kubernetes.io/cluster/eks-dev | True | owned |
# EKS MNG
aws eks describe-nodegroup \
> --cluster-name eks-dev \
> --nodegroup-name web-eks-dev
{
"nodegroup": {
"scalingConfig": {
"minSize": 0,
"maxSize": 5,
"desiredSize": 0
},
"labels": {
"spotInstance": "true",
"org.com/role": "WebNode"
},
"tags": {
"EnvironmentType": "development",
"Managed_by": "terraform",
"Environment": "eks-dev",
"k8s.io/cluster-autoscaler/eks-dev": "eks-dev",
"k8s.io/cluster-autoscaler/enabled": "true",
"Name": "web-eks-dev"
}
}
}
So there are no any k8s.io/cluster-autoscaler/node-template/label/ tags.
Next I created my test pod:
kubectl apply -f - <<EOF
> apiVersion: v1
> kind: Pod
> metadata:
> name: node-selector-test
> namespace: default
> spec:
> nodeSelector:
> org.com/role: WebNode
> containers:
> - name: test
> image: busybox
> command: ["sh", "-c", "sleep 3600"]
> EOF
pod/node-selector-test created
Pod events
Normal TriggeredScaleUp 6s cluster-autoscaler pod triggered scale-up: [{web-eks-dev-redacted 0->1 (max: 5)}]
After killing the pod, CA also scales this node group down.
So, I'm wondering what tags/labels (if any) are mandatory now for CA? while running in EKS with managed node groups?