-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Replace IPVS as the API server LoadBalancer #296
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.
Just a quick pass over. =)
pkg/cluster/clusterLeader.go
Outdated
log.Infof("Starting IPVS LoadBalancer") | ||
portForwarder := loadbalancer.NewServer(c.VIP, c.LoadBalancerPort) | ||
// TODO | ||
lb, err := loadbalancer.NewIPVSLB("1.2.3.4", 6444) |
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.
nit: TODO still need fixed up?
pkg/cluster/clusterLeader.go
Outdated
// TODO | ||
lb, err := loadbalancer.NewIPVSLB("1.2.3.4", 6444) | ||
if err != nil { | ||
log.Error(err) |
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.
nit: Would be nice to have the error explain what's happening (e.g. error creating new IPVSLB or something
).
pkg/cluster/clusterLeader.go
Outdated
@@ -386,6 +366,97 @@ func (cluster *Cluster) StartLeaderCluster(c *kubevip.Config, sm *Manager, bgpSe | |||
return nil | |||
} | |||
|
|||
// present | |||
// LabelsWatcher will watch for labels created on nodes | |||
func (sm *Manager) LabelsWatcher(lb *loadbalancer.IPVSLoadBalancer) error { |
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.
I've been looking at how to best do this. Might be able to throw some things we've done with Contour into the project to centralize this and separate the k8s specific bits out. I can share more as I pick through my GatewayAPI PR.
pkg/kubevip/config_generator.go
Outdated
@@ -365,87 +365,12 @@ func ParseEnvironment(c *Config) error { | |||
} | |||
c.EnableLoadBalancer = b | |||
// Load Balancer configuration | |||
return parseEnvironmentLoadBalancer(c) | |||
// return parseEnvironmentLoadBalancer(c) |
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.
Should this be commented out?
pkg/loadbalancer/ipvs.go
Outdated
err := lb.client.CreateDestination(lb.loadBalancerService, dst) | ||
// TODO: we either parse the IPVS configuration to see if a backend exists | ||
// or if it already exists we just ignore this and continue ons | ||
if err != nil && err != os.ErrExist { |
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.
nit: The err != nil
is redundant
pkg/manager/watcher.go
Outdated
// This file handles the watching of node annotations for configuration, it will exit once the annotations are | ||
// present | ||
// LabelsWatcher will watch for labels created on nodes | ||
func (sm *Manager) LabelsWatcher(lb *loadbalancer.IPVSLoadBalancer) error { |
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.
Is this the same code as in clusterLeader.go
?
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
This re-implements the API-Server Loadbalancer with
IPVS