From 9a4d535f09c08a39470bdcc3b3bb37ee2e053d65 Mon Sep 17 00:00:00 2001 From: Alex Flom Date: Sat, 6 Jun 2020 21:58:23 -0400 Subject: [PATCH] ceph: hardcode service port and container port names When integrating rook with istio, service port names need to be prefixed by their protocol. Trying to fix this by removing static port names in favor of configurable names. Closes: #5587 add protocol prefix to service port names, hardcoded as discussed. renamed container ports Signed-off-by: Alex Flom --- pkg/operator/ceph/cluster/mgr/spec.go | 2 +- pkg/operator/ceph/cluster/mon/service.go | 4 ++-- pkg/operator/ceph/cluster/mon/spec.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/operator/ceph/cluster/mgr/spec.go b/pkg/operator/ceph/cluster/mgr/spec.go index b7540d153..fe23880f2 100644 --- a/pkg/operator/ceph/cluster/mgr/spec.go +++ b/pkg/operator/ceph/cluster/mgr/spec.go @@ -283,7 +283,7 @@ func (c *Cluster) makeDashboardService(name string) *v1.Service { labels := controller.AppLabels(AppName, c.Namespace) portName := "https-dashboard" if !c.dashboard.SSL { - portName = "dashboard" + portName = "http-dashboard" } svc := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/operator/ceph/cluster/mon/service.go b/pkg/operator/ceph/cluster/mon/service.go index 25ec4bc0b..7f13fe12e 100644 --- a/pkg/operator/ceph/cluster/mon/service.go +++ b/pkg/operator/ceph/cluster/mon/service.go @@ -36,7 +36,7 @@ func (c *Cluster) createService(mon *monConfig) (string, error) { Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{ { - Name: "msgr1", + Name: "tcp-msgr1", Port: mon.Port, // --public-bind-addr=IP with no IP:port has the mon listen on port 6789 // regardless of what port the mon advertises (--public-addr) to the outside. @@ -50,7 +50,7 @@ func (c *Cluster) createService(mon *monConfig) (string, error) { k8sutil.SetOwnerRef(&svcDef.ObjectMeta, &c.ownerRef) // If deploying Nautilus or newer we need a new port for the monitor service - addServicePort(svcDef, "msgr2", DefaultMsgr2Port) + addServicePort(svcDef, "tcp-msgr2", DefaultMsgr2Port) s, err := k8sutil.CreateOrUpdateService(c.context.Clientset, c.Namespace, svcDef) if err != nil { diff --git a/pkg/operator/ceph/cluster/mon/spec.go b/pkg/operator/ceph/cluster/mon/spec.go index 0ef9444bd..b4d5d6fb6 100644 --- a/pkg/operator/ceph/cluster/mon/spec.go +++ b/pkg/operator/ceph/cluster/mon/spec.go @@ -265,7 +265,7 @@ func (c *Cluster) makeMonDaemonContainer(monConfig *monConfig) v1.Container { SecurityContext: PodSecurityContext(), Ports: []v1.ContainerPort{ { - Name: "client", + Name: "tcp-msgr1", ContainerPort: monConfig.Port, Protocol: v1.ProtocolTCP, }, @@ -287,7 +287,7 @@ func (c *Cluster) makeMonDaemonContainer(monConfig *monConfig) v1.Container { } // Add messenger 2 port - addContainerPort(container, "msgr2", 3300) + addContainerPort(container, "tcp-msgr2", 3300) return container }