-
Notifications
You must be signed in to change notification settings - Fork 199
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
update kube-proxy to auto choose version #750
Conversation
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.
@zjaco13 Have a minor comment. Also the doc is not updated.
@shapirov103 Is this approach good. CA uses helm approach and coreaddon props is readonly.
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.
@zjaco13 It is a great start, I like the map. Please see my comment on the design. Happy to discuss if needed.
lib/addons/kube-proxy/index.ts
Outdated
this.version = version ?? "auto"; | ||
} | ||
|
||
deploy(clusterInfo: ClusterInfo): Promise<Construct> { |
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.
Hey Zach, while this implementation works, it almost nullifies the inheritance - there is very little reason to derive this from a core addon.
I think we what we should do in this case is to enable this type of version selection for any core addon.
That means that the core addon should be able to accept optionally something like a versionProviderFunction that takes cluster info and spits out the version.
The kubeproxy will supply its function that will use the map. However, the default function will to just return whatever customers passed.
In this way, other core addons, the number of which will grow, will be able to address this aspect without sacrificing the central implementation component of such addons.
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.
Yep, that approach makes a ton of sense. We should discuss implementation.
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.
All good, one small nit.
lib/addons/core-addon/index.ts
Outdated
provideVersion(clusterInfo: ClusterInfo, versionMap: Map<KubernetesVersion, string>) : string { | ||
let version: string; | ||
if(!versionMap.get(clusterInfo.version)) { |
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.
nitpick: no need to get from the map twice on line 144 and 147.
let version = versionMap.get();
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.
resolved
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.
LGTM
pending e2e tests
@elamaran11 please review the latest |
/do-e2e-tests |
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.
LGTM
We can merge after e2e. |
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.
end to end tests passed
Issue #, if available: #747
Description of changes:
Added version map for kube-proxy addon
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.