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

update kube-proxy to auto choose version #750

Merged
merged 5 commits into from
Jul 10, 2023

Conversation

zjaco13
Copy link
Contributor

@zjaco13 zjaco13 commented Jun 29, 2023

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.

Copy link
Collaborator

@elamaran11 elamaran11 left a 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.

lib/addons/kube-proxy/index.ts Show resolved Hide resolved
Copy link
Collaborator

@shapirov103 shapirov103 left a 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.

this.version = version ?? "auto";
}

deploy(clusterInfo: ClusterInfo): Promise<Construct> {
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

@shapirov103 shapirov103 left a 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.

provideVersion(clusterInfo: ClusterInfo, versionMap: Map<KubernetesVersion, string>) : string {
let version: string;
if(!versionMap.get(clusterInfo.version)) {
Copy link
Collaborator

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();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Collaborator

@shapirov103 shapirov103 left a 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

@shapirov103
Copy link
Collaborator

@elamaran11 please review the latest

@shapirov103
Copy link
Collaborator

/do-e2e-tests

Copy link
Collaborator

@elamaran11 elamaran11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elamaran11
Copy link
Collaborator

@elamaran11 please review the latest

We can merge after e2e.

Copy link

@aws-ia-ci aws-ia-ci left a 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

@elamaran11 elamaran11 merged commit ebef7d3 into aws-quickstart:main Jul 10, 2023
8 checks passed
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

Successfully merging this pull request may close these issues.

4 participants