Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 29 additions & 18 deletions pkg/tarmak/cluster/firewall/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ type Rule struct {
}

var (
zeroPort = uint16(0)
sshPort = uint16(22)
bgpPort = uint16(179)
overlayPort = uint16(2359)
k8sEventsPort = uint16(2369)
k8sPort = uint16(2379)
apiPort = uint16(6443)
consulRCPPort = uint16(8300)
consulSerfPort = uint16(8301)
vaultPort = uint16(8200)
calicoMetricsPort = uint16(9091)
nodePort = uint16(9100)
blackboxPort = uint16(9115)
wingPort = uint16(9443)
maxPort = uint16(65535)
zeroPort = uint16(0)
sshPort = uint16(22)
bgpPort = uint16(179)
overlayPort = uint16(2359)
k8sEventsPort = uint16(2369)
k8sPort = uint16(2379)
apiPort = uint16(6443)
consulRCPPort = uint16(8300)
consulSerfPort = uint16(8301)
vaultPort = uint16(8200)
clusterAutoscalerMetricsPort = uint16(8085)
calicoMetricsPort = uint16(9091)
nodePort = uint16(9100)
blackboxPort = uint16(9115)
wingPort = uint16(9443)
maxPort = uint16(65535)

k8sIdentifier = "k8s"
k8sEventsIdentifier = "k8sevents"
Expand Down Expand Up @@ -96,14 +97,24 @@ func newSSHService() Service {

func newCalicoMetricsService() Service {
return Service{
Name: "metrics",
Name: "calico",
Protocol: "tcp",
Ports: []Port{
Port{Single: &calicoMetricsPort},
},
}
}

func newClusterAutoscalerMetricsService() Service {
return Service{
Name: "cluster_autoscaler",
Protocol: "tcp",
Ports: []Port{
Port{Single: &clusterAutoscalerMetricsPort},
},
}
}

func newIPIPService() Service {
return Service{
Name: "ipip",
Expand Down Expand Up @@ -302,8 +313,8 @@ func Rules() (rules []*Rule) {

//// Master
&Rule{
Comment: "allow workers/master to connect to calico's service + api server",
Services: []Service{newBGPService(), newIPIPService(), newCalicoMetricsService(), newAPIService()},
Comment: "allow workers/master to connect to calico's service, cluster autoscaler's service + api server",
Services: []Service{newBGPService(), newIPIPService(), newCalicoMetricsService(), newClusterAutoscalerMetricsService(), newAPIService()},
Direction: "ingress",
Sources: []Host{
Host{Role: "master"},
Expand Down