From e346560d6c147fc3252795a00419a671987833f2 Mon Sep 17 00:00:00 2001 From: Nate Sweet Date: Tue, 26 Apr 2022 11:18:46 -0500 Subject: [PATCH] bug: Correct Peer Service Filename; Create Before Relay The Peer Service file will exist under the hubble subdirectory in the Cilium Helm chart. Additionally, we should create the Peer Service before Hubble-Relay is created, as Relay relies on the Peer Service for communication. Signed-off-by: Nate Sweet --- hubble/hubble.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hubble/hubble.go b/hubble/hubble.go index b758cba785..8a398fb352 100644 --- a/hubble/hubble.go +++ b/hubble/hubble.go @@ -185,9 +185,9 @@ func (k *K8sHubble) generatePeerService() *corev1.Service { ciliumVer := k.semVerCiliumVersion switch { case versioncheck.MustCompile(">1.11.0")(ciliumVer): - svcFilename = "templates/cilium-agent/peer-service.yaml" + svcFilename = "templates/hubble/peer-service.yaml" case versioncheck.MustCompile(">1.9.0")(ciliumVer): - svcFilename = "templates/cilium-agent-peer-service.yaml" + svcFilename = "templates/hubble-peer-service.yaml" } if svcFilename == "" { return nil @@ -558,6 +558,12 @@ func (k *K8sHubble) Enable(ctx context.Context) error { } } + if peerSvc := k.generatePeerService(); peerSvc != nil { + if _, err := k.client.CreateService(ctx, k.params.Namespace, peerSvc, metav1.CreateOptions{}); err != nil { + return err + } + } + var warnFreePods []string if k.params.Relay { podsName, err := k.enableRelay(ctx) @@ -568,12 +574,6 @@ func (k *K8sHubble) Enable(ctx context.Context) error { warnFreePods = append(warnFreePods, podsName) } - if peerSvc := k.generatePeerService(); peerSvc != nil { - if _, err := k.client.CreateService(ctx, k.params.Namespace, peerSvc, metav1.CreateOptions{}); err != nil { - return err - } - } - if k.params.UI { podsName, err := k.enableUI(ctx) if err != nil {