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

[feat] - add support for cilium-backed loadbalancers #208

Merged
merged 10 commits into from
Jun 3, 2024
Merged

Conversation

AshleyDumaine
Copy link
Contributor

@AshleyDumaine AshleyDumaine commented May 3, 2024

This PR is to support cases where the linode-CCM is installed but instead of backing a LoadBalancer Service via NodeBalancers, the user wants to leverage Cilium's BGP load balancing with automatically requested and assigned shared IPs.

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

@AshleyDumaine AshleyDumaine force-pushed the shared-ip branch 13 times, most recently from 96cf0c0 to 269bca3 Compare May 8, 2024 21:02
@AshleyDumaine AshleyDumaine marked this pull request as ready for review May 8, 2024 21:37

ipHolder, err = l.client.CreateInstance(ctx, linodego.InstanceCreateOptions{
Region: l.zone,
Type: "g6-nanode-1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we have this configurable via a variable? Though plans don't change frequently, just wondering if it does get updated in future to g7, we can just set the variable than changing and building again. Same for image.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a temporary workaround while there's no way to request IPs that are not attached to a Linode. I'm hoping that changes by the time there is a g7 plan or ubuntu 22.04 goes EOL 😳

# sharedIPLoadBalancing:
# defaultLoadBalancerClass: <linode-nodebalancer or io.cilium/bgp-control-plane>
# bgpNodeLabel: <node label for CiliumBGPPeeringPolicy>

Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we also add some documentation regarding these flags in readme?

AddInstanceIPAddress(ctx context.Context, linodeID int, public bool) (*linodego.InstanceIP, error)
DeleteInstanceIPAddress(ctx context.Context, linodeID int, ipAddress string) error

ShareIPAddresses(ctx context.Context, opts linodego.IPAddressesShareOptions) error
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we can remove parameter names and just keep parameter types to keep it consistent with other lines in file. There are some lines which still have both parameter name and types, but in general I see folks trying to just keep parameter types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want to keep it consistent, I would prefer adding parameter names for clarity

Copy link
Contributor

Choose a reason for hiding this comment

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

Make it consistent! By converging on my standard...

I love it :D

@AshleyDumaine AshleyDumaine force-pushed the shared-ip branch 3 times, most recently from 51e2f6e to bd542af Compare May 16, 2024 17:20
@AshleyDumaine AshleyDumaine force-pushed the shared-ip branch 2 times, most recently from c2a6c94 to ecf72ad Compare May 16, 2024 17:54
README.md Show resolved Hide resolved
// These values come from https://www.linode.com/docs/products/compute/compute-instances/guides/failover/#ip-sharing-availability
var (
regionIDMap = map[string]int{
"us-southeast": 4, // Atlanta, GA (USA)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this to a configmap as a followup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would a configmap help? I think we'd still need to cut a new release if we did add/remove a DC, it would just be a difference of if the image version changes vs the k8s resources

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess i was thinking more from a internal customer pov - modifying a configmap in place vs picking up a new version - but you're right, doesn't give us much

README.md Outdated
- image: linode/linode-cloud-controller-manager:latest
name: ccm-linode
args:
- --leader-elect-resource-lock=endpoints
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: example args needs an update as they have changed recently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to just include the args that need to be added for the feature

Copy link
Collaborator

@rahulait rahulait left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding these.

cloud/linode/cilium_loadbalancers.go Outdated Show resolved Hide resolved
cloud/linode/cilium_loadbalancers.go Show resolved Hide resolved
cloud/linode/loadbalancers.go Outdated Show resolved Hide resolved
@AshleyDumaine AshleyDumaine merged commit 836eec0 into main Jun 3, 2024
5 checks passed
@AshleyDumaine AshleyDumaine deleted the shared-ip branch June 3, 2024 14:51
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.

6 participants