-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add envoy gateway * set gateway svc namespace * set the svc name of the gateway for testing reasons * test in kind * external gateway needs LB * install envoy-gateway gateways * include config to use the right gateways * fix no service test * disable host-rewrite - it uses K8s Service type=ExternalName * update envoy config to work with latest * add port 443 to the listener * include a test for the config changes
- Loading branch information
Showing
10 changed files
with
271 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ jobs: | |
ingress: | ||
- istio | ||
- contour | ||
- envoy-gateway | ||
|
||
env: | ||
KO_DOCKER_REPO: kind.local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright 2024 The Knative Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-gateway | ||
namespace: knative-serving | ||
labels: | ||
app.kubernetes.io/component: net-gateway-api | ||
app.kubernetes.io/name: knative-serving | ||
serving.knative.dev/release: devel | ||
data: | ||
external-gateways: | | ||
- class: eg-external | ||
gateway: eg-external/eg-external | ||
supported-features: | ||
- HTTPRouteRequestTimeout | ||
# local-gateways defines the Gateway to be used for cluster local traffic | ||
local-gateways: | | ||
- class: eg-internal | ||
gateway: eg-internal/eg-internal | ||
service: envoy-gateway-system/knative-internal | ||
supported-features: | ||
- HTTPRouteRequestTimeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2024 The Knative Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-gateway | ||
namespace: knative-serving | ||
labels: | ||
app.kubernetes.io/component: net-gateway-api | ||
app.kubernetes.io/name: knative-serving | ||
serving.knative.dev/release: devel | ||
data: | ||
external-gateways: | | ||
- class: eg-external | ||
gateway: eg-external/eg-external | ||
service: envoy-gateway-system/knative-external | ||
supported-features: | ||
- HTTPRouteRequestTimeout | ||
# local-gateways defines the Gateway to be used for cluster local traffic | ||
local-gateways: | | ||
- class: eg-internal | ||
gateway: eg-internal/eg-internal | ||
service: envoy-gateway-system/knative-internal | ||
supported-features: | ||
- HTTPRouteRequestTimeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Copyright 2024 The Knative Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
"sigs.k8s.io/yaml" | ||
|
||
"knative.dev/net-gateway-api/pkg/reconciler/ingress/config" | ||
) | ||
|
||
func TestFromConfigMap(t *testing.T) { | ||
bytes, err := os.ReadFile(config.GatewayConfigName + ".yaml") | ||
if err != nil { | ||
t.Fatalf("failed to read %q: %s", config.GatewayConfigName, err) | ||
} | ||
|
||
cm := &corev1.ConfigMap{} | ||
err = yaml.Unmarshal(bytes, cm) | ||
if err != nil { | ||
t.Fatalf("failed to unmarshal %q: %s", config.GatewayConfigName, err) | ||
} | ||
|
||
if _, err := config.FromConfigMap(cm); err != nil { | ||
t.Error("FromConfigMap(actual) =", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: eg-external | ||
--- | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyProxy | ||
metadata: | ||
name: knative-external-config | ||
namespace: envoy-gateway-system | ||
spec: | ||
provider: | ||
type: Kubernetes | ||
kubernetes: | ||
envoyService: | ||
name: knative-external | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: GatewayClass | ||
metadata: | ||
name: eg-external | ||
spec: | ||
controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
parametersRef: | ||
group: gateway.envoyproxy.io | ||
kind: EnvoyProxy | ||
name: knative-external-config | ||
namespace: envoy-gateway-system | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: eg-external | ||
namespace: eg-external | ||
spec: | ||
gatewayClassName: eg-external | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
allowedRoutes: | ||
namespaces: | ||
from: All | ||
# We've observed when adding and removing a listener on port 443 this | ||
# causes the GKE LB to have downtime. By adding this tls listener | ||
# we keep that LB port open. | ||
- name: tls | ||
port: 443 | ||
protocol: TLS | ||
tls: | ||
mode: Passthrough | ||
allowedRoutes: | ||
namespaces: | ||
from: All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: eg-internal | ||
--- | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyProxy | ||
metadata: | ||
name: knative-internal-config | ||
namespace: envoy-gateway-system | ||
spec: | ||
provider: | ||
type: Kubernetes | ||
kubernetes: | ||
envoyService: | ||
type: ClusterIP | ||
name: knative-internal | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: GatewayClass | ||
metadata: | ||
name: eg-internal | ||
spec: | ||
controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
parametersRef: | ||
group: gateway.envoyproxy.io | ||
kind: EnvoyProxy | ||
name: knative-internal-config | ||
namespace: envoy-gateway-system | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: eg-internal | ||
namespace: eg-internal | ||
spec: | ||
gatewayClassName: eg-internal | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
allowedRoutes: | ||
namespaces: | ||
from: All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters