diff --git a/pkg/router/gloo.go b/pkg/router/gloo.go index dfab730d..3c5c89e0 100644 --- a/pkg/router/gloo.go +++ b/pkg/router/gloo.go @@ -46,6 +46,11 @@ func (gr *GlooRouter) Reconcile(canary *flaggerv1.Canary) error { apexName, primaryName, canaryName := canary.GetServiceNames() canaryUpstreamName := fmt.Sprintf("%s-%s-canaryUpstream-%v", canary.Namespace, apexName, canary.Spec.Service.Port) primaryUpstreamName := fmt.Sprintf("%s-%s-primaryUpstream-%v", canary.Namespace, apexName, canary.Spec.Service.Port) + + // Create upstreams for the canary/primary services created by flagger. + // Previously, we relied on gloo discovery to automaticallycreate these upstreams, but this would no longer work if + // discovery was turned off. + // KubeServiceDestinations can be disabled in gloo configuration, so we don't use those either. canaryUs := getGlooUpstreamForKubeService(canary, canaryUpstreamName, canaryName) primaryUs := getGlooUpstreamForKubeService(canary, primaryUpstreamName, primaryName) _, err := gr.glooClient.GatewayV1().Upstreams(canary.Namespace).Create(context.TODO(), canaryUs, metav1.CreateOptions{}) @@ -285,7 +290,7 @@ func getMethods(canary *flaggerv1.Canary) []string { } func getGlooUpstreamForKubeService(canary *flaggerv1.Canary, upstreamName, svcName string) *gloov1.Upstream{ - return &gloov1.Upstream{ + return &gloov1.Upstream{ ObjectMeta: metav1.ObjectMeta{ Name: upstreamName, Namespace: canary.Namespace, diff --git a/test/gloo/install.sh b/test/gloo/install.sh index 23666fb2..bb33c199 100755 --- a/test/gloo/install.sh +++ b/test/gloo/install.sh @@ -12,6 +12,7 @@ kubectl create ns gloo-system helm repo add gloo https://storage.googleapis.com/solo-public-helm helm upgrade -i gloo gloo/gloo --version ${GLOO_VER} \ --namespace gloo-system \ +--set discovery.enabled=false kubectl -n gloo-system rollout status deployment/gloo kubectl -n gloo-system rollout status deployment/gateway