Skip to content

Commit

Permalink
fix(firewall): open node to master ICMP security group
Browse files Browse the repository at this point in the history
Cilium health check mechanism requires ICMP and TCP/4240 port to be opened between every node in the cluster including control plane nodes. If one of these 2 checks fails the node is considered as unreachable.
  • Loading branch information
maximumG committed Apr 20, 2023
1 parent 2ef477f commit 7f5b0dd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/model/awsmodel/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Protocol int

const (
ProtocolIPIP Protocol = 4
ProtocolICMP Protocol = 1
)

// FirewallModelBuilder configures firewall network objects
Expand Down Expand Up @@ -135,9 +136,11 @@ func (b *FirewallModelBuilder) applyNodeToMasterBlockSpecificPorts(c *fi.Cloudup
udpRanges := []portRange{{From: 1, To: 65535}}
protocols := []Protocol{}

if b.Cluster.Spec.Networking.Cilium != nil && b.Cluster.Spec.Networking.Cilium.EtcdManaged {
// Block the etcd peer port
tcpBlocked[2382] = true
if b.Cluster.Spec.Networking.Cilium != nil {
protocols = append(protocols, ProtocolICMP)
if b.Cluster.Spec.Networking.Cilium.EtcdManaged {
tcpBlocked[2382] = true
}
}

if b.Cluster.Spec.Networking.Calico != nil {
Expand Down Expand Up @@ -196,6 +199,8 @@ func (b *FirewallModelBuilder) applyNodeToMasterBlockSpecificPorts(c *fi.Cloudup
switch protocol {
case ProtocolIPIP:
name = "ipip"
case ProtocolICMP:
name = "icmp"
default:
klog.Warningf("unknown protocol %q - naming by number", awsName)
}
Expand Down

0 comments on commit 7f5b0dd

Please sign in to comment.