-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add support for specifying maxPods as a bootstrap option #216
Conversation
b0b9289
to
183e460
Compare
Codecov Report
@@ Coverage Diff @@
## master #216 +/- ##
==========================================
+ Coverage 88.04% 88.15% +0.10%
==========================================
Files 17 17
Lines 2166 2186 +20
==========================================
+ Hits 1907 1927 +20
Misses 159 159
Partials 100 100
Continue to review full report at Codecov.
|
@@ -125,6 +129,9 @@ func (ctx *EksInstanceGroupContext) GetBasicUserData(clusterName, args string, k | |||
api-server = "{{ .ApiEndpoint }}" | |||
cluster-certificate = "{{ .ClusterCA }}" | |||
cluster-name = "{{ .ClusterName }}" | |||
{{- if .MaxPods}} |
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.
Will this default to 0 if not provided? should we have a better default?
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.
it will default to 0 and be falsey
I thought the agreement in #184 was only to add structure around bootstrap arguments vs. kubelet arguments which might be difficult to keep track of. Can you add a full design of how this should look like after we support all os families, what options we want to support and how the API will look like? Since this adds a new API I want to make sure we are in full agreement on how it will look like, and potential use cases along with |
Going off of this ^ proposal (changed useMaxPods to maxPods). The example spec provided above would translate as follows: AL2 bootstrap.sh <clustername> --dns-cluster-ip 10.0.0.1 --use-max-pods 'false' --docker-config-json "<JSON payload>" --kubelet-extra-args '--max-pods "20" --eviction-hard "memory.available<300mi" --foo="bar" ' BottleRocket [settings.kubernetes]
api-server = <autogenerated>
cluster-certificate = <autogenerated>
cluster-name = <clustername>
cluster-dns-ip = "10.0.0.1"
max-pods = 20 Windows $EKSBootstrapScriptFile -EKSClusterName {{ .ClusterName }} -KubeletExtraArgs '--max-pods "20" --eviction-hard "memory.available<300mi" --foo="bar" ' I'd advocate for sticking to this small surface area of properties, as they are all shared by at least 2 of the 3 OS families. |
Signed-off-by: Jonah Back <[email protected]>
Signed-off-by: Jonah Back <[email protected]>
Signed-off-by: Jonah Back <[email protected]>
Signed-off-by: Jonah Back <[email protected]>
dfda04f
to
32d0409
Compare
@@ -179,6 +179,10 @@ type EKSManagedSpec struct { | |||
EKSManagedConfiguration *EKSManagedConfiguration `json:"configuration"` | |||
} | |||
|
|||
type BootstrapOptions struct { | |||
MaxPods int64 `json:"maxPods,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.
are we planning to add a KubeletArguments
element struct down the road to support all possible kubelet options in free form? if so how would we handle a --max-pods
flag provided there directly?
e.g.
configuration:
bootstrapOptions:
kubeletArguments: "--max-pods 10 --eviction-hard memory.available<300mi"
maxPods: 20
Since you are abstracting the UseMaxPods bool into just taking the maxPods (which is definitely nicer), we need to think of what to do in case of 'conflict' (this is only a problem in non-bottlerocket OS).
Also, what will we do in cases where we get both bootstrapArguments
and kubeletArguments
prior to deprecation of bootstrapArguments
? e.g.
configuration:
bootstrapArguments: "--eviction-hard memory.available<600mi"
bootstrapOptions:
kubeletArguments: "--eviction-hard memory.available<300mi"
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.
Great questions!
Given that we don't have an API for BottleRocket kubelet args at the moment, I don't want to get too deep into designing an API for it. I think a freeform string for now works - it's likely that for bottlerocket, we could leverage the same field to just pass in TOML.
I'm thinking that we just allow duplicate flags. I ran into this while testing, actually - Kubelet just uses the last argument passed in. With that in mind, I think we should go the following strategy:
--kubelet-extra-args '<bootstrapArguments> <kubeletArguments> <generatedArguments'
This will result in:
- Generated kubelet args having the highest priority
- The 'new' kubeletArguments having normal priority
- The to-be-deprecated bootstrapArguments having the lower priority.
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.
Awesome, this approach should be good !
@backjo |
Sounds good! |
This PR builds off of conversation in #184 . This support is initially only added for BottleRocket nodes. In a later PR, additional fields will be added, as well as support for these fields on any/all compatible OS families.