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

Move networking in nodeup to dedicated subpackage #9137

Merged
merged 6 commits into from
Jun 4, 2020

Conversation

olemarkus
Copy link
Member

As discussed in a previous PR, the networking builders should be in its own package. It went a bit further than intended when trying to clean up the NetworkBuilder. The CNI plugin installations were a bit messy. If a CNI requires kops to install plugins, it will be handled in specific builders instead.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 17, 2020
@k8s-ci-robot k8s-ci-robot added area/nodeup size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 17, 2020
@rifelpet
Copy link
Member

/retest

@johngmyers
Copy link
Member

This is turning into a real pain to review. It would have been much easier to cross-check if there were a commit per CNI builder.

loader.Builders = append(loader.Builders, &model.SysctlBuilder{NodeupModelContext: modelContext})
loader.Builders = append(loader.Builders, &model.KubeAPIServerBuilder{NodeupModelContext: modelContext})
loader.Builders = append(loader.Builders, &model.KubeControllerManagerBuilder{NodeupModelContext: modelContext})
loader.Builders = append(loader.Builders, &model.KubeSchedulerBuilder{NodeupModelContext: modelContext})
loader.Builders = append(loader.Builders, &model.EtcdManagerTLSBuilder{NodeupModelContext: modelContext})
loader.Builders = append(loader.Builders, &model.KubeProxyBuilder{NodeupModelContext: modelContext})
loader.Builders = append(loader.Builders, &model.EtcdTLSBuilder{NodeupModelContext: modelContext})
Copy link
Member

Choose a reason for hiding this comment

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

EtcdTLSBuilder needs to be changed to not act when networking is not Calico.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps rename it to CalicoBuilder.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Will look into this

Copy link
Member Author

Choose a reason for hiding this comment

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

This one is a bit misleading. It creates certs named calico, but it is used by any provider that accesses legacy etcd with TLS enabled. For Romana, this seems to be broken, for cilium, I have removed support for this. Calico could probably work if the user works really hard to to configure this. Would have to use calico V2 ++. I think we can just leave this as is and rather work on deprecating legacy etcd further.

Copy link
Member

Choose a reason for hiding this comment

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

I do not want to start creating that cert when it previously was not. The appending of EtcdTLSBuilder was previously conditional on networking being set to Calico. So either the appending should remain conditional or the builder should only act for Calico.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed.

Copy link
Member

Choose a reason for hiding this comment

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

Comment resolved by subsequent commit.

@johngmyers
Copy link
Member

That review took way too long. For future refactors, please submit a series of commits, each designed to permit a reviewer to see when logic changes and when it does not. Please see #9130 as an example.

@olemarkus
Copy link
Member Author

Sorry for putting all of this into one commit. It was quite a journey cleaning all of this up and the original commits reflected that.
I could/should have rewritten the changes from scratch and commit patches more easier to review.

@johngmyers
Copy link
Member

/retest

1 similar comment
@olemarkus
Copy link
Member Author

/retest

@johngmyers
Copy link
Member

/retest
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2020
@johngmyers
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2020
@olemarkus
Copy link
Member Author

Thanks for spotting those @rdrgmnzs

@@ -22,7 +22,7 @@ import (
"k8s.io/kops/upup/pkg/fi"
)

// KuberouterBuilder installs kube-router
// Kubenet installs kube-router
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Kubenet installs kube-router
// KubenetBuilder installs kube-router.

Copy link
Member

@johngmyers johngmyers left a comment

Choose a reason for hiding this comment

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

/lgtm

"k8s.io/kops/upup/pkg/fi"
)

// KubenetBuilder installs Kubenet networking provider
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
// KubenetBuilder installs Kubenet networking provider
// KubenetBuilder installs the Kubenet networking provider.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2020
@johngmyers
Copy link
Member

/assign @rdrgmnzs

Ole Markus With added 3 commits June 4, 2020 17:32
* remove portmap as it is not used by kubenet
* use generalised function for checking whether a provider uses kubenet
EtcdTLSBuilder is now only used in legacy configurations of calico so renaming appropriatly
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2020
@rdrgmnzs
Copy link
Contributor

rdrgmnzs commented Jun 4, 2020

Thanks for all the work you put into this @olemarkus!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olemarkus, rdrgmnzs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2020
@k8s-ci-robot k8s-ci-robot merged commit 5762f65 into kubernetes:master Jun 4, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api area/nodeup cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants