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

Add new local Gateway sharing same deployment as ingress Gateway. #237

Merged
Merged
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
36 changes: 36 additions & 0 deletions config/203-local-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,39 @@ spec:
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: knative-local-gateway
namespace: knative-serving
labels:
serving.knative.dev/release: devel
networking.knative.dev/ingress-provider: istio
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 8081
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: v1
kind: Service
metadata:
name: knative-local-gateway
namespace: knative-serving
labels:
serving.knative.dev/release: devel
networking.knative.dev/ingress-provider: istio
spec:
type: ClusterIP
selector:
istio: ingressgateway
ports:
- name: http2
port: 80
targetPort: 8081
10 changes: 9 additions & 1 deletion pkg/reconciler/ingress/config/istio.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ const (
// KnativeIngressGateway is the name of the ingress gateway
KnativeIngressGateway = "knative-ingress-gateway"

// ClusterLocalGateway is the name of the local gateway
// ClusterLocalGateway is the name of the local gateway (will be deprecated)
ClusterLocalGateway = "cluster-local-gateway"

// KnativeLocalGateway is the name of the local gateway (will be promoted)
KnativeLocalGateway = "knative-local-gateway"
)

func defaultIngressGateways() []Gateway {
Expand All @@ -60,6 +63,11 @@ func defaultLocalGateways() []Gateway {
Name: ClusterLocalGateway,
ServiceURL: fmt.Sprintf(ClusterLocalGateway+".istio-system.svc.%s",
network.GetClusterDomainName()),
}, {
Namespace: system.Namespace(),
Name: KnativeLocalGateway,
ServiceURL: fmt.Sprintf(KnativeLocalGateway+".knative-serving.svc.%s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be using system.Namespace()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, we have a helper for synthesizing service hostnames that this should be using too in place of GetClusterDomainName()

network.GetClusterDomainName()),
}}
}

Expand Down