kubelet maxPods value getting wrongly set from Karpenter #7833
Labels
bug
Something isn't working
triage/solved
Mark the issue as solved by a Karpenter maintainer. This gives time for the issue author to confirm.
Description
Observed Behavior:
On setting spec.kubelet.maxPods = "x" on the ec2NodeClass manifest, the nodes that get created using this ec2NodeClass manifest have a different value "y" getting passed to the max-pods arg of kubelet.
This issue is seen only on old ec2NodeClasses that were migrated from v0.37.5 to v1.0.6. The maxPods spec was added to the ec2NodeClass manifest after the migration to v1.0.6. The maxPods value is correctly getting passed to the kubelet on ec2NodeClasses that are newly created after the karpenter version upgrade.
Expected Behavior:
On setting spec.kubelet.maxPods = "x" on the ec2NodeClass manifest, the nodes that get created using this ec2NodeClass manifest should have the same value "x" getting passed to the max-pods arg of "/usr/bin/kubelet" cmd.
Reproduction Steps (Please include YAML):
ec2nc and nodepool YAML:
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
annotations:
karpenter.sh/stored-version-migrated: "true"
finalizers:
name: temp-nodeclass
spec:
amiSelectorTerms:
blockDeviceMappings:
ebs:
deleteOnTermination: true
volumeSize: 500Gi
volumeType: gp3
kubelet:
clusterDNS:
maxPods: 30
metadataOptions:
httpEndpoint: enabled
httpProtocolIPv6: disabled
httpPutResponseHopLimit: 1
httpTokens: required
role: eks-role
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
annotations:
compatibility.karpenter.sh/v1beta1-kubelet-conversion: '{"clusterDNS":["10.42.0.10"]}'
compatibility.karpenter.sh/v1beta1-nodeclass-reference: '{"kind":"EC2NodeClass","name":"temp-nodeclass","apiVersion":"karpenter.k8s.aws/v1beta1"}'
karpenter.sh/nodepool-hash-version: v3
karpenter.sh/stored-version-migrated: "true"
name: temp-nodepool
spec:
disruption:
budgets:
- nodes: 10%
consolidateAfter: 300s
consolidationPolicy: WhenEmpty
template:
metadata:
labels:
node_type: al_node
spec:
expireAfter: Never
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: temp-nodeclass
requirements:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- key: kubernetes.io/os
operator: In
values:
- linux
- key: karpenter.sh/capacity-type
operator: In
values:
- on-demand
- key: karpenter.k8s.aws/instance-category
operator: In
values:
- m
- key: karpenter.k8s.aws/instance-generation
operator: Gt
values:
- "5"
Versions:
v1.0.6
kubectl version
):EKS Kubernetes v1.30
The text was updated successfully, but these errors were encountered: