-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Allow additional SGs to be added to API loadbalancer #4036
Changes from 9 commits
1dbc606
60a90bf
6e76277
e1ccc33
5a46228
d181ecf
16ed898
22194c9
2746b88
5b4c9e2
4b0aa1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,6 +184,21 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error { | |
} | ||
} | ||
|
||
// Add precreated additional security groups to the ELB | ||
{ | ||
for _, id := range b.Cluster.Spec.API.LoadBalancer.AdditionalSecurityGroups { | ||
t := &awstasks.SecurityGroup{ | ||
Name: fi.String(id), | ||
ID: fi.String(id), | ||
Shared: fi.Bool(true), | ||
} | ||
if err := c.EnsureTask(t); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The should be add task not ensure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chrislovecnm The reason for It is used also used in autoscalinggroup https://github.com/kubernetes/kops/blob/master/pkg/model/awsmodel/autoscalinggroup.go#L97-L107 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand now. Excellent |
||
return err | ||
} | ||
elb.SecurityGroups = append(elb.SecurityGroups, t) | ||
} | ||
} | ||
|
||
// Allow HTTPS to the master instances from the ELB | ||
{ | ||
t := &awstasks.SecurityGroupRule{ | ||
|
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.
One last nitpick ... should have mentioned it earlier. Can we get some code level docs? Once we generate the api server docs they will show up like: https://github.com/kubernetes/kops/blob/master/docs/apireference/build/index.html ~ we need to get that hosted.
Here is a good guide, https://blog.golang.org/godoc-documenting-go-code, but I assume that you are an experienced gopher.
Docs here and in cluster would be AWESOME!!