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

⚠️ ELB uses separate security group #1456

Merged
merged 1 commit into from
Jan 10, 2020
Merged

⚠️ ELB uses separate security group #1456

merged 1 commit into from
Jan 10, 2020

Conversation

aaroniscode
Copy link
Contributor

What this PR does / why we need it:
Currently the ELB provisioned for the Kubernetes API server shares the security group with the control plane nodes. This leverages the existing LB security group that was created but never used. It also exposes the external port as set in Clusters's spec.clusterNetwork.apiServerPort

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 #1452

@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. labels Dec 29, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 29, 2019
@aaroniscode
Copy link
Contributor Author

aaroniscode commented Dec 29, 2019

Took a first stab at this in response to #1452. Interested in feedback if this is the preferred approach.

Also added Path MTU Discovery. This is already done for each new ELB that the AWS cloud provider adds for services of type LoadBalancer.

See: kubernetes/kubernetes#24254
Kops has it as well: kubernetes/kops#6297

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 29, 2019
@aaroniscode aaroniscode changed the title [WIP] ⚠️ ELB uses separate security group [WIP] ⚠️ ELB uses separate security group, adds PMTU Dec 29, 2019
@detiber
Copy link
Member

detiber commented Dec 30, 2019

@aaroniscode we'll need an additional new Security Group for this change, the existing LB that you are re-purposing here is meant for use by the AWS cloud-provider integration (hence the different ownership tag used).

@aaroniscode
Copy link
Contributor Author

aaroniscode commented Dec 30, 2019

@aaroniscode we'll need an additional new Security Group for this change, the existing LB that you are re-purposing here is meant for use by the AWS cloud-provider integration (hence the different ownership tag used).

@detiber I noticed the comment that it was meant for use by the AWS cloud-provider integration but it didn't appear to be used. When testing the AWS cloud-provider it created new security groups for each load balancer. So I can learn, can you point to me where I missed how this is used by the AWS cloud provider?

And I can look at creating a new k8s API load balancer security group.

@detiber
Copy link
Member

detiber commented Dec 30, 2019

@detiber I noticed the comment that it was meant for use by the AWS cloud-provider integration but it didn't appear to be used. When testing the AWS cloud-provider it created new security groups for each load balancer. So I can learn, can you point to me where I missed how this is used by the AWS cloud provider?

It was introduced in #706, there might be additional context as to why in the comments on that PR

@aaroniscode
Copy link
Contributor Author

@detiber I updated the PR based on your feedback. I left the LB that we create for the AWS cloud-provider integration alone and created a new LB just for the K8s API Server.

@aaroniscode aaroniscode changed the title [WIP] ⚠️ ELB uses separate security group, adds PMTU ⚠️ ELB uses separate security group Jan 10, 2020
@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 Jan 10, 2020
@aaroniscode
Copy link
Contributor Author

I believe all review comments have been resolved. Thanks all! Removed the Path MTU for now as it probably belongs in more than just the k8s LB security group and wanted to keep this PR focused. Will open a separate PR for Path MTU shortly.

Also tested both Internet-facing and internal ELB.

@ncdc
Copy link
Contributor

ncdc commented Jan 10, 2020

@aaroniscode what port did you test for the ELBs?

@aaroniscode
Copy link
Contributor Author

@aaroniscode what port did you test for the ELBs?

6443

@ncdc
Copy link
Contributor

ncdc commented Jan 10, 2020

Ok. Think there'd be any issue with 443?

@aaroniscode
Copy link
Contributor Author

Ok. Think there'd be any issue with 443?

I tested with 443 a week or so back by setting in Cluster object:

spec:
  clusterNetwork:
    apiServerPort: 443

@ncdc
Copy link
Contributor

ncdc commented Jan 10, 2020

/lgtm
/assign @vincepri

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

/lgtm too

@vincepri
Copy link
Member

Note for later: given that we're now adding a new security group for the ELB, we should probably consider changing this line https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/1456/files#diff-b0ffc0997fd2bffcad9bd812a56adccbR382 that allows everyone to access the control plane port, regardless of network. We can probably make sure that the control plane security group is allowed to talk to the hardcoded port 6443, and the new ELB security group.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aaroniscode, vincepri

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 10, 2020
@k8s-ci-robot k8s-ci-robot merged commit a9ce8a3 into kubernetes-sigs:master Jan 10, 2020
@ncdc
Copy link
Contributor

ncdc commented Jan 10, 2020

@vincepri we'll never come back to your note unless we file an issue - will you do that?

@vincepri
Copy link
Member

Will do yeah

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. 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.

Wrong security group assigned to load balancer
6 participants