-
Notifications
You must be signed in to change notification settings - Fork 960
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
feat: Dedicated host api structure #3859
feat: Dedicated host api structure #3859
Conversation
✅ Deploy Preview for karpenter-docs-prod ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I would favor the second approach that maps directly for this feature. The reason you mentioned seems strong; i.e. a license config without a placement. There are some fields missing from the placement structure as well. I don't think we'd want to add |
Thanks @bwagner5 , the use cases is the same as described in #3182 In order to utilise aws dedicated hosts for financial control reasons, we use LaunchTemplates to configure those 3 fields only (license, host group, tenancy). My understanding of your comment is you'd prefer to see those fields added to https://github.com/aws/karpenter/blob/main/pkg/apis/v1alpha1/provider.go#L51 @njtran This work would be covered by https://github.com/aws/karpenter/blob/main/designs/aws-launch-templates-v2.md I believe, as we're really only talking about
do you agree? |
f318aa4
to
e0f9a8f
Compare
@bwagner5 @njtran I've added a design document for dedicated hosts following the examples of some of the other designs. Please let me know how I can help with the design process. I'm going to look at what an implementation needs in terms of effort, so I'm in a better position to implement whatever the decided design is. |
e0f9a8f
to
52a32c5
Compare
I've just pushed up some MVP/basic plumbing to validate getting the fields from the
with expected error:
|
0656c2d
to
a1c7fbc
Compare
5aee1af
to
7a93222
Compare
Maybe good here to consider #3324 as the probable API surface looks similar. Any thoughts here @preflightsiren ? |
So far I've only implemented |
d1fe300
to
868150a
Compare
868150a
to
5de57f8
Compare
1d93a3d
to
f8b8f1e
Compare
Added fix for #3324 as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! great progress! I just made a few comments, mostly some casing nits and some simplifications :) Nice work!
f8b8f1e
to
68d0bc6
Compare
Thanks @bwagner5 appreciate it. |
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-placement | ||
type Placement struct { | ||
// +optional | ||
HostResourceGroupARN *string `json:"hostResourceGroupARN,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this PR with the team today. Currently, we don't have any other api fields in Karpenter's CRDs that reference an ARN. Could we make the HostResourceGroup referenced by name and then construct the arn for input within Karpenter?
Same question for the License Configuration. It seems a little different since the name is generated. It may be a good place the use of a selector
similar to the subnetSelector
and securityGroupSelector
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, it does feel a bit odd writing selectors for things that aren't collections (in the Kubernetes sense).
Sometimes, when what you want is an ARN, and the API is AWS-specific, an ARN is going to be the right fit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do some research into the AWS APIs but I don't believe these resources have any searchable properties. For example LicenseConfigurations are just ARNs - https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LicenseConfiguration.html they don't have anything look-up-able.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think this is the right conclusion. I would agree with your direction if there was some ability to query and discover license configurations, and host resource groups, but the APIs do not have anything I could find. Happy to be corrected if someone can provide the reference docs.
The reason we want ARNs and not just name's like "If you provide the license id 12345, karpenter will rewrite this as an arn", but this won't work in a number of scenarios:
- the resource is shared between AWS accounts (RAM)
- can we even find the account ID? what about aws partition for aws-gov environments?
Providing the full ARN bypasses all of these issues, and I think is the simplest and safest way to provide this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synced in slack, @preflightsiren is kind enough to come to WG this Thursday at 2PM PDT to present this doc. Let's review there and sync up on this decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you share the results of your deliberation on this topic? If possible, I would like to help with the delivery of this particular feature. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm picking this up again this week, just refamiliarising myself and will push the new API up, perhaps as a new PR
bdc03fe
to
c906c2c
Compare
c906c2c
to
418c33d
Compare
// +optional | ||
HostResourceGroupARN *string `json:"hostResourceGroupARN,omitempty"` | ||
// +optional | ||
GroupID *string `json:"groupdID,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to be ID or name? https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreatePlacementGroup.html. Seems like name is more discoverable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was basing this off of #3324 (comment) I guess we could pull this apart and reimplement with the select model (assuming we can find appropriate aws APIs)
metadata: | ||
name: default | ||
spec: | ||
licenseConfiguration: arn:aws:license-manager:eu-east-1:123456789012:license-configuration:lic-edf7f9e241f5e16f29996c842111f448 # optional, arn of the license configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the APIs very briefly but I see that you can tag both license configurations and resource groups. I think we may be able to achieve discovery here since both resource groups and license configuration have tags and naming.
Granted, we may have to do some client-side filtering for the license configuration since it looks like you can't filter on tags directly from the server-side.
Ensure that the data in awsnodetemplates ends up in the requests to create launchtemplates
418c33d
to
dd38aa1
Compare
Created #4553 to track the new approach (selectors) and keep all the review comments from the original approach isolated. |
Fixes #3182
Description
Wanted to create a draft PR to start a conversation about the approach. I believe following https://karpenter.sh/v0.27.3/contributing/design-guide/ that adding to the AWSNodeTemplate best follows "Identify an opinionated default that solves the majority of use cases."
Of course I'd appreciate any and all help to mould this design.
This design focuses on a simplified configuration, just the minimum needed to use host resource groups.
This design directly maps https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-placement and would therefore allow more reuse of features - eg. if people wanted to use licenses without dedicated hosts.
How was this change tested?
Does this change impact docs?
Release Note
** Questions for the maintainers **
ec2.CreateFleet()
call.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.