Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make (cluster-local) DNS work out of the box by default. #1687

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions pkg/reconciler/v1alpha1/route/resources/names/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ var K8sGatewayFullname = reconciler.GetK8sServiceFullname(
"knative-shared-gateway",
system.Namespace)

var K8sGatewayServiceFullname = reconciler.GetK8sServiceFullname(
"knative-ingressgateway",
"istio-system")

func K8sService(route *v1alpha1.Route) string {
return route.Name
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/reconciler/v1alpha1/route/resources/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ func MakeK8sService(route *v1alpha1.Route) *corev1.Service {
},
},
Spec: corev1.ServiceSpec{
Ports: []corev1.ServicePort{{
Name: PortName,
Port: PortNumber,
}},
Type: corev1.ServiceTypeExternalName,
ExternalName: names.K8sGatewayServiceFullname,
},
}
}
7 changes: 3 additions & 4 deletions pkg/reconciler/v1alpha1/route/resources/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/knative/serving/pkg/apis/serving/v1alpha1"
"github.com/knative/serving/pkg/reconciler"
"github.com/knative/serving/pkg/reconciler/v1alpha1/route/resources/names"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -37,10 +38,8 @@ func TestMakeK8SService_ValidSpec(t *testing.T) {
},
}
expectedSpec := corev1.ServiceSpec{
Ports: []corev1.ServicePort{{
Name: "http",
Port: 80,
}},
Type: corev1.ServiceTypeExternalName,
ExternalName: names.K8sGatewayServiceFullname,
}
spec := MakeK8sService(r).Spec
if diff := cmp.Diff(expectedSpec, spec); diff != "" {
Expand Down