diff --git a/charts/karpenter_nodes/Chart.yaml b/charts/karpenter_nodes/Chart.yaml index e7e304a..ee2a6be 100644 --- a/charts/karpenter_nodes/Chart.yaml +++ b/charts/karpenter_nodes/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: karpenter_nodes -version: 0.1.1 +version: 0.1.2 description: A Helm chart for generating NodeClasses and NodePools for Karpenter maintainers: - name: nadavbuc diff --git a/charts/karpenter_nodes/templates/nodepool.yaml b/charts/karpenter_nodes/templates/nodepool.yaml index 006a241..427c43a 100644 --- a/charts/karpenter_nodes/templates/nodepool.yaml +++ b/charts/karpenter_nodes/templates/nodepool.yaml @@ -195,7 +195,9 @@ spec: disruption: expireAfter: {{ $v.expireAfter | default $.Values.expireAfter }} consolidationPolicy: {{$v.consolidationPolicy | default $.Values.consolidationPolicy}} + {{- if eq ($v.consolidationPolicy | default $.Values.consolidationPolicy) "WhenEmpty" }} consolidateAfter: {{ $v.consolidateAfter | default $.Values.consolidateAfter }} + {{- end }} {{- if $v.budgets }} budgets: {{- toYaml $v.budgets | nindent 6 }} diff --git a/charts/karpenter_nodes/tests/nodepool_nodes_default_test.yaml b/charts/karpenter_nodes/tests/nodepool_nodes_default_test.yaml index bdf270b..6b9aa48 100644 --- a/charts/karpenter_nodes/tests/nodepool_nodes_default_test.yaml +++ b/charts/karpenter_nodes/tests/nodepool_nodes_default_test.yaml @@ -146,9 +146,8 @@ tests: - equal: path: spec.disruption.consolidationPolicy value: WhenUnderutilized - - equal: + - isNull: path: spec.disruption.consolidateAfter - value: 5m - isNull: path: spec.disruption.budgets - isNull: