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

[WIP] ClusterActuator: support ELB for api server #115

Conversation

ashish-amarnath
Copy link
Contributor

What this PR does / why we need it:
The cluster actuator should create and manage a load balancer for the apiserver if a user does not provide an existing load balancer.

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

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 26, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ashish-amarnath
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: ingvagabund

If they are not already assigned, you can assign the PR to them by writing /assign @ingvagabund in a comment when ready.

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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. 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 Sep 26, 2018
@ashish-amarnath
Copy link
Contributor Author

@vincepri Starting out with some skeletal code here to get a conversation started.
/cc @detiber

@@ -15,13 +15,15 @@ package ec2

import (
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
"github.com/aws/aws-sdk-go/service/elb/elbiface"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this maybe directly start with ELBv2 aka NLBs or ALBs?

Copy link
Member

Choose a reason for hiding this comment

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

We discussed this as we were scoping out the MVP and decided to go with an ELB Classic configured for tcp-passthrough. The main reason for this is to avoid hitting hairpining-related issues when an API server attempts to talk to itself through the NLB.

If we can sufficiently work through those issues, then we can move towards an NLB-based approach. ALB is more difficult because we need to allow client-cert based authentication.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the chiming in @detiber.
Yes, this was captured in #52

The load balancer should be a classic ELB configured for tcp-passthrough.

@detiber
Copy link
Member

detiber commented Sep 26, 2018

/ok-to-test
/assign @vincepri

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 26, 2018
@k8s-ci-robot
Copy link
Contributor

@ashish-amarnath: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-cluster-api-provider-aws-build 2e12ee2 link /test pull-cluster-api-provider-aws-build
pull-cluster-api-provider-aws-test 2e12ee2 link /test pull-cluster-api-provider-aws-test
pull-cluster-api-provider-aws-make 2e12ee2 link /test pull-cluster-api-provider-aws-make

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

ID string `json:"id"`

// TODO: figure out other fields for the loadbalancer
Name string `json:"name`
Copy link
Member

Choose a reason for hiding this comment

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

I believe the json tag is missing a closing " here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FIxed locally. Thanks!

"sigs.k8s.io/cluster-api-provider-aws/cloud/aws/providerconfig/v1alpha1"
)

func (s *Service) reconcileLoadbalancer(lb v1alpha1.LoadBalancer) error {
Copy link
Member

Choose a reason for hiding this comment

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

Should this support multiple load balancers? Or is this supposed to be called in a loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the idea here was to support the loadbalancer for the API server only. I don't think the cluster network status should track other loadbalancers.

},
}

out, err := s.ELB.DescribeLoadBalancers(req)
Copy link
Member

Choose a reason for hiding this comment

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

The error here should be wrapped using errors.Wrapf(...) from github.com/pkg/errors.

Copy link
Contributor Author

@ashish-amarnath ashish-amarnath Sep 26, 2018

Choose a reason for hiding this comment

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

Thanks for reminding! will keep that in mind :)

@vincepri
Copy link
Member

vincepri commented Oct 2, 2018

@ashish-amarnath Any updates on this PR? I'd prefer to move the elb logic in another package possibly, this is addressed in #147.

@vincepri
Copy link
Member

vincepri commented Oct 4, 2018

@ashish-amarnath given the urgency of the ELB work, I'll cherry-pick your commit and work on another branch tomorrow, let me know if there is any pushback.

@ashish-amarnath
Copy link
Contributor Author

ashish-amarnath commented Oct 4, 2018 via email

@detiber
Copy link
Member

detiber commented Oct 5, 2018

closing, since #158 was merged

@detiber detiber closed this Oct 5, 2018
paulfantom pushed a commit to paulfantom/cluster-api-provider-aws that referenced this pull request Dec 3, 2018
Update actuator Interface based on upstream changes
@dlipovetsky dlipovetsky mentioned this pull request Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cluster actuator] Reconcile apiserver Load Balancer
5 participants