-
Notifications
You must be signed in to change notification settings - Fork 40
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
✨ Add support for kube-vip #320
Conversation
Welcome @davidspek! |
@cprivitere I still need to validate that nothing went wrong during the rebase, but here is the PR in any case. |
@cprivitere Looks like nothing strange happened during the rebasing. I will do a test deployment though to be sure, but it should be good to continue on from here. |
/easycla |
@davidspek So I recently changed my Github username from @cprivite to @cprivitere . Because of this the email address associated with my github is now 23177737+cprivitere@users.noreply.github.com. This is causing EasyCLA to not be able to validate that I've signed the CLA and thus block this PR from going through. It sounds like you either need to squash all the commits to just be from you or have you update the author of each commit to be my new username. Do you have a preference? |
Signed-off-by: Chris Privitere <cprivite@users.noreply.github.com>
Signed-off-by: Chris Privitere <cprivite@users.noreply.github.com>
Signed-off-by: Chris Privitere <cprivite@users.noreply.github.com>
Signed-off-by: Chris Privitere <cprivite@users.noreply.github.com>
Signed-off-by: Chris Privitere <cprivite@users.noreply.github.com>
Signed-off-by: Chris Privitere <cprivite@users.noreply.github.com>
Yeah, I've already messaged @detiber for help. |
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.
It looks like my review comments are a little late and some discussion has already happened about making kube-vip non-default. I have some concerns about BGP being enabled by default.
// - bgpConfig struct does not have Status=="disabled" | ||
if err == nil && bgpConfig != nil && bgpConfig.ID != "" && strings.ToLower(bgpConfig.Status) != "disabled" { | ||
return nil | ||
} |
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.
What will we do if the BGPConfig Get request fails? Invalid project or token, timeout, API availability issues?
Let's handle err != nil
here. We should log at the very least.
If BGP can not be enabled, we can return that error and this error will cascade through the reconciliation loop and we will await the next reconciliation loop to attempt to enable BGP. That sounds good. The log messages will be helpful if the resource can not resolve because of this.
// when the node is a control plan we should check if the elastic ip | ||
// for this cluster is not assigned. If it is free we can prepare the | ||
// current node to use it. | ||
// when the node is a control plan we need the elastic IP |
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.
// when the node is a control plan we need the elastic IP | |
// when a node is a control plane node we need the elastic IP |
@@ -137,6 +137,11 @@ func (r *PacketClusterReconciler) reconcileNormal(ctx context.Context, clusterSc | |||
} | |||
} | |||
|
|||
if err := r.PacketClient.EnableProjectBGP(packetCluster.Spec.ProjectID); err != nil { |
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.
BGP + KubeVIP mode should be optional
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.
Once enabled in a project, BGP can not be easily disabled and some of the initial settings can not be modified. We shouldn't enable this by default for everyone.
@@ -362,6 +353,11 @@ func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *s | |||
machineScope.SetProviderID(dev.ID) | |||
machineScope.SetInstanceStatus(infrav1.PacketResourceStatus(dev.State)) | |||
|
|||
if err := r.PacketClient.EnsureNodeBGPEnabled(dev.ID); err != nil { |
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.
This should be optional, based on a CAPP setting.
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.
You'll want to look at the latest version.
@@ -222,7 +223,7 @@ func (r *PacketMachineReconciler) PacketClusterToPacketMachines(ctx context.Cont | |||
} | |||
} | |||
|
|||
func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *scope.MachineScope) (ctrl.Result, error) { //nolint:gocyclo | |||
func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *scope.MachineScope) (ctrl.Result, 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.
func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *scope.MachineScope) (ctrl.Result, error) { | |
func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *scope.MachineScope) (ctrl.Result, error) { //nolint:gocyclo |
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 think we need to add this nolint comment back in.
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
@cprivitere @displague Sorry for the slow response here. I've just pushed the suggested changes. |
@davidspek can you make generate and re-push? |
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
@cprivitere The lint error should be resolved now |
I've just come across this error during the creation of a control plane node:
This error should probably trigger a reconciliation so it will retry enabling BGP on the node. EDIT: |
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
…uster Type (#5) * Convert to having the EIP_MANAGEMENT variable as part of the packetcluster type * Make vipmanager field immutable. Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com> * Rename field to VIPManager Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com> * rename to vipmanager, fix defaults, rm services Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com> * Fix typo and make VIPManager an enum Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cprivitere, DavidSpek 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 |
/retest |
Replacement of: detiber#65.
What this PR does / why we need it:
This replaces the binding of an elastic IP to one of the control plane nodes with deploying kube-vip and having it load balance the Kubernetes API between the various control plane nodes.