Recently I have upgraded Karpenter version to v0.34.0 and along with that disruption feature comes where we can schedule the node consolidation to specific hours. I have added the disruption policy but even after that karpenter is consolidating nodes on unscheduled hours.
Below is the code, I am using. Is there anything needs to be fixed in code
apiVersion: karpenter.sh/v1beta1
kind: NodePool
metadata:
name: application
spec:
template:
metadata:
labels:
provisioner: karpenter
nodegroup: application
usage: application
spec:
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
kind: EC2NodeClass
name: default
requirements:
– key: “karpenter.k8s.aws/instance-category”
operator: In
values: [“c”, “m”, “r”]
taints:
– key: usage
value: application
effect: NoSchedule
%{ if var.consolidation_enabled }
disruption:
consolidationPolicy: WhenUnderutilized
budgets:
– nodes: “1”
schedule: “05 7 * * *” # Schedule for 5:40 AM EST
duration: 30m
%{ endif }
limits:
cpu: 600
Expecting the nodes consolidation should happen on scheduled time i.e “05 7 * * *” but it is consolidating on non-scheduled time as well.
Akshay Rathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.