Skip to content

Commit

Permalink
cloud-prepare: Don't open metrics port
Browse files Browse the repository at this point in the history
With the redesign of metrics, we don't need to open metrics port in the
cloud anymore. This also marks the `metrics-ports` flag as deprecated.

Refer submariner-io/enhancements/pull/128
Depends On submariner-io/submariner-operator/pull/2182

Signed-off-by: Vishal Thapar <[email protected]>
  • Loading branch information
vthapar authored and tpantelis committed Aug 24, 2022
1 parent ff61726 commit c4825d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
5 changes: 3 additions & 2 deletions cmd/subctl/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ func init() {
port.NATTDiscovery, "NAT discovery port")
cloudPrepareCmd.PersistentFlags().Uint16Var(&cloudPorts.Vxlan, "vxlan-port", port.IntraClusterVxLAN, "Internal VXLAN port")

cloudPorts.Metrics = append(cloudPorts.Metrics, 8080, 8081)
ports := []uint16{}

cloudPrepareCmd.PersistentFlags().Var(&uint16Slice{value: &cloudPorts.Metrics}, "metrics-ports", "Metrics ports")
cloudPrepareCmd.PersistentFlags().Var(&uint16Slice{value: &ports}, "metrics-ports", "Metrics ports")
_ = cloudPrepareCmd.PersistentFlags().MarkDeprecated("metrics-ports", "Metrics ports are no longer used, this flag is ignored")

cloudCmd.AddCommand(cloudPrepareCmd)

Expand Down
1 change: 0 additions & 1 deletion pkg/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ type Ports struct {
Natt uint16
NatDiscovery uint16
Vxlan uint16
Metrics []uint16
}
7 changes: 0 additions & 7 deletions pkg/cloud/prepare/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ func getPortConfig(restcfg *restconfig.Producer, ports *cloud.Ports, useNumericE

input := api.PrepareForSubmarinerInput{}

for i := range ports.Metrics {
port := api.PortSpec{
Port: ports.Metrics[i], Protocol: "tcp",
}
input.InternalPorts = append(input.InternalPorts, port)
}

nwDetails, err := getNetworkDetails(restcfg)
if err != nil {
return gwPorts, input, errors.Wrapf(err, "failed to discover the network details in the cluster")
Expand Down

0 comments on commit c4825d0

Please sign in to comment.