aws-samples / cdk-eks-karpenter

CDK construct for installing and configuring Karpenter on EKS clusters
Apache License 2.0
34 stars 14 forks source link

feat: Adds support for extra helm chart options #100

Closed andskli closed 1 year ago

andskli commented 1 year ago

This can be valuable for adding tolerations, nodeSelector, etc.

new Karpenter(stack, 'Karpenter', {
  cluster: cluster,
  namespace: 'kar-penter',
  helmExtraValues: {
    'foo.key': 'foo.value',
  },
});

Hence, you can add custom values per the values definition in the Karpenter helm chart.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

andskli commented 1 year ago

@deepu-james let me know if you feel this change would allow you to do what you ask for in #99?

deepu-james commented 1 year ago

Thanks, @andskli, I am not well knowledgeable on Helm, but If the taint on the node is

key=application:value=karpenter:effect=NoSchedule

Could you please provide an example of how the configuration would look like? I can't quite figure it out since the toleration is an array.


EDIT Is this a correct sample?

new Karpenter(stack, 'Karpenter', {
  cluster: cluster,
  namespace: 'kar-penter',
  helmExtraValues: {
    tolerations: [{
      key: 'application',
      value: 'karpenter',
      effect: 'NoSchedule',
    }],
  },
});

If this is a right sample, could you please release a version?

andskli commented 1 year ago

@deepu-james yes, that looks about right given https://github.com/aws/karpenter/blob/5a32f9695e7a4327b6bc3b74f5b43cdbd7d17381/charts/karpenter/values.yaml#L83.