Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add kubeletConfiguration and weight to provisioners #38

Open
abierbaum opened this issue Feb 16, 2023 · 5 comments
Open

How to add kubeletConfiguration and weight to provisioners #38

abierbaum opened this issue Feb 16, 2023 · 5 comments

Comments

@abierbaum
Copy link

It doesn't look like the current API has support for kubeletConfiguration and weight when adding provisioners.

Is there any way to override the provisioner spec as part of adding a new one?

@robertd
Copy link
Owner

robertd commented Feb 16, 2023 via email

@abierbaum
Copy link
Author

@robertd I can work on a PR that adds support.

I was thinking of adding an escape hatch to allow people to override the Provisioner and AWSNodeTemplate resources before they get passed to addManifest. (ex: https://github.com/robertd/cdk-karpenter/blob/main/src/karpenter.ts#L554)

The idea being that as karpenter moves forward there will always be some little things that aren't supported yet by the simplified API this package provides. So if there was a way to override things after they are built then that could help people add whatever they need.

Maybe something like:

addProvisioner(id: string,  provisionerSpecs?: ProvisionerSpecs, overrideProvisioner?: (r: any) => any, overrideNodeTemplate?: (r: any) => any,)

The code internally would be something like:

const nodeTemplateRes = {
   apiVersion:  'karpenter.k8s.aws/v1alpha1',
      kind: 'AWSNodeTemplate',
      metadata: {
        name: awsNodeTemplateId,
      },
     ...
}
const finalNodeTemplateRes = overrideNodeTemplate == null ? nodeTemplateRes : overrideNodeTemplate(nodeTemplateRes);
this.cluster.addManifest(awsNodeTemplateId, finalNodeTemplateRes)

What would you think about something like this concept? What would you like the addProvisioner method call and arguments to look like?

Note: alternatively, the callbacks could be defined in the ProvisionerSpecs instead.

If you are receptive to any of these options and let me know what path you like here, I could work up a PR.

@abierbaum
Copy link
Author

@robertd See: #39 I put in some ideas that I think should work, but wanted to get some feedback from you on the direction before going further.

@robertd
Copy link
Owner

robertd commented Feb 17, 2023 via email

@abierbaum
Copy link
Author

@robertd Thanks. More than happy to take it a different directly. Really just trying to provide maximum flexibility for people to override anything they want as an escape hatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants