Support 'Context' on ec2.CreateFleet API call#1395
Conversation
|
✅ Deploy Preview for karpenter-docs-prod canceled. 🔨 Explore the source changes: fc7adc1 🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/6238d2c60ad4c200089c7049 |
|
I think making the Fleet Context a CLI parameter might be better since not many users will need to touch it. Here's where the CLI args are defined: https://github.com/aws/karpenter/blob/main/pkg/utils/options/options.go#L43-L45 The options struct is injected into the context so that the cloud provider can use them. Here's an example: |
|
I'd like to hold on this feature, since it tightly couples Karpenter to the fleet API and leaks Fleet details through the API. This will break if Karpenter ever decides to use ASG for RunInstances. |
FYI ASG supports Context as well :) |
Probably we would then change the options var from |
|
Given that this is also included in ASG, I'm much more comfortable with the idea of exposing it through the API. or |
pkg/utils/options/options.go
Outdated
| AWSNodeNameConvention string | ||
| AWSENILimitedPodDensity bool | ||
| AWSDefaultInstanceProfile string | ||
| AWSEC2FleetContext string |
There was a problem hiding this comment.
If we're serious about exposing this, we should absolutely do so at the provisioner level. The only reason to make this a CLI arg is to enable this without promoting to the full API. There are compatibility concerns with CLI args too, so it doesn't get it fully out of the woods.
Is it interesting to use multiple fleet contexts in a single cluster?
Reverted to the original code changes and renamed |
bwagner5
left a comment
There was a problem hiding this comment.
a few comments to simplify the code a bit.
Done ;) |
bwagner5
left a comment
There was a problem hiding this comment.
can you run make verify as well
receiving the following error: |
|
It looks like the author of that package re-tagged it. Try the following:
|
This is a bug upstream with helm-docs. You can just comment it out from toolchain.sh |
|
|
||
| The `Context` parameter that all underlying calls to [EC2 CreateFleet](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet.html) made by the Provisioner would use. | ||
|
|
||
| Note: Only use this parameter if advised by AWS. |
There was a problem hiding this comment.
I'd prefer to simply not document this if this is the case.
|
I was testing this out and noticed that Context cannot be used with |
|
Rebased and added test in a new PR (with all of your commits as well). Will test and get that new PR merged soon: #2007 |
1. Issue, if available:
#1394
2. Description of changes:
When the AWS Cloud Provider issues a
CreateFleetAPI call as part ofinstance.launchInstances()aContextparameter as string will be added iffleetContextwas set3. How was this change tested?
N/A
4. Does this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.