Skip to content

Support for NSX-T based Load Balancers#292

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
mandelsoft:master
Mar 4, 2020
Merged

Support for NSX-T based Load Balancers#292
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
mandelsoft:master

Conversation

@mandelsoft
Copy link
Contributor

What this PR does / why we need it:
This PR adds support for the NSX-T loadbalancers to the vsphere cloud-controller-manager.
It must explicitly be enabled by additional configuration options in the configuration file.

  • If enabled, it manages the load balancer service and virtual servers for TCP/UDP kubernetes services, including health checks.
  • It also includes a cleanup feature for deleting/releasing obsolete NSX-T elements of formerly available services in the case of a crash recovery or services deleted without a running controller manager.
  • By configuring dedicated load balancer classes, it is possible to refer by annotations to various IP Pools for the allocated IP of the virtual server.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 27, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @mandelsoft!

It looks like this is your first PR to kubernetes/cloud-provider-vsphere 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-vsphere has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @mandelsoft. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 27, 2020
@andrewsykim
Copy link
Member

/assign

Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

Did a first pass, just left some minor comments will go through it again soon

@andrewsykim
Copy link
Member

/assign @yastij

@mandelsoft
Copy link
Contributor Author

@andrewsykim the dedicated lock per service might be useful to avoid the global reorg go routine to block all service reconcilations

@andrewsykim
Copy link
Member

/unassign @yastij

@andrewsykim
Copy link
Member

/assign

Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

Some more comments, thanks again for driving this

Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

Overall I think this is looking good, I still don't understand the use-case around ReorgServices, can you expand on that please?

Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

/ok-to-test

A few more comments, the most important is getting the feature gate there. Otherwise I'm okay to merge and iterate on the other comments as a follow-up

pflag.CommandLine.VisitAll(func(flag *pflag.Flag) {
if flag.Name == "version" {
switch flag.Name {
case "cluster-name":
Copy link
Member

Choose a reason for hiding this comment

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

nit: I actually prefer this to be cluster-id to match with the cluster ID flag in the CSI driver

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I prefer we don't use this flag, it has some implications that aren't so obvious (the flag description is already telling).

I think what would be best is adding a cluster-id field to the global config https://github.com/kubernetes/cloud-provider-vsphere/blob/master/pkg/common/config/types.go#L21 and then using that value for "cluster name" for LBs.

Copy link
Contributor

Choose a reason for hiding this comment

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

introduced new flag cluster-id

Copy link
Contributor Author

@mandelsoft mandelsoft Feb 28, 2020

Choose a reason for hiding this comment

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

The reference docu for the cloud-controller maneger (https://kubernetes.io/docs/reference/command-line-tools-reference/cloud-controller-manager/) explains the option cluster-namewith

--cluster-name string     Default: "kubernetes"
The instance prefix for the cluster.

which is exactly the use case we want to use. Therefore it really seems to be the right choice. It is also already passed by the load balancer interface of the cloud controller manager. That's another clear indicator that we are using it as intended.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 25, 2020
Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

Just a few more comments, almost there :) Appreciate your patience.

Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

/approve

One more minor comment, lgtm otherwise!

if lb == nil {
klog.Infof("NSX-T load balancer support disabled")
} else {
klog.Infof("NSX-T load balancer support enabled")
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a warning log here saying something like "this feature is alpha, use in production at your own risk"

Copy link
Contributor

@davidvonthenen davidvonthenen Mar 2, 2020

Choose a reason for hiding this comment

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

I second this as well. Also since this is an alpha feature, I would also recommend adding something to the effect of "since this is an alpha feature, this implementation is a work in progress and the underlying implementation details can change."

Copy link
Contributor

Choose a reason for hiding this comment

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

Changed logging to klog.Infof("NSX-T load balancer support enabled. This feature is alpha, use in production at your own risk."). Also added the sentence "since this is an alpha feature... can change." to the README.md.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewsykim

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

The pull request process is described here

Details 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 Feb 29, 2020
@andrewsykim
Copy link
Member

also if you can squash commits that'd be great!

@MartinWeindel MartinWeindel force-pushed the master branch 2 times, most recently from 31e2720 to dca6a2f Compare March 2, 2020 07:49
@andrewsykim
Copy link
Member

andrewsykim commented Mar 2, 2020

Can we update this PR to be a normal PR and not a draft? I don't think it'll merge otherwise

@davidvonthenen
Copy link
Contributor

I left a comment as well, but looks good to me as an initial commit! Nice job!

@davidvonthenen
Copy link
Contributor

/lgtm

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

andrewsykim commented Mar 3, 2020

This will merge automatically once it's no longer a draft

@mandelsoft mandelsoft marked this pull request as ready for review March 4, 2020 12:53
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 4, 2020
@k8s-ci-robot k8s-ci-robot merged commit 7d77c09 into kubernetes:master Mar 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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants