Skip to content

Commit

Permalink
fix firewalls for openstack
Browse files Browse the repository at this point in the history
  • Loading branch information
zetaab committed Oct 27, 2019
1 parent 1c37a32 commit a09a920
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/model/openstackmodel/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ func (b *FirewallModelBuilder) addETCDRules(c *fi.ModelBuilderContext, sgMap map
addDirectionalGroupRule(c, masterSG, masterSG, etcdRule)
addDirectionalGroupRule(c, masterSG, masterSG, etcdPeerRule)

for _, portRange := range wellknownports.ETCDPortRanges() {
etcdMgmrRule := &openstacktasks.SecurityGroupRule{
Lifecycle: b.Lifecycle,
Direction: s(string(rules.DirIngress)),
Protocol: s(string(rules.ProtocolTCP)),
EtherType: s(string(rules.EtherType4)),
PortRangeMin: i(portRange.Min),
PortRangeMax: i(portRange.Max),
}
addDirectionalGroupRule(c, masterSG, masterSG, etcdMgmrRule)
}

if b.Cluster.Spec.Networking.Romana != nil ||
b.Cluster.Spec.Networking.Calico != nil {

Expand Down
6 changes: 6 additions & 0 deletions pkg/wellknownports/wellknownports.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ func DNSGossipPortRanges() []PortRange {
{Min: 3998, Max: 4000},
}
}

func ETCDPortRanges() []PortRange {
return []PortRange{
{Min: 3994, Max: 3997},
}
}

0 comments on commit a09a920

Please sign in to comment.