Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ clusters:
metadata: {}
name: kube_gwtest_gateway-pool-endpoint-picker_9002
type: EDS
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicitHttpConfig:
http2ProtocolOptions: {}
- connectTimeout: 5s
edsClusterConfig:
edsConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ clusters:
metadata: {}
name: kube_gwtest_ext-authz_9000
type: EDS
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicitHttpConfig:
http2ProtocolOptions: {}
- connectTimeout: 5s
edsClusterConfig:
edsConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ clusters:
metadata: {}
name: kube_gwtest_app-team-ext-authz_9000
type: EDS
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicitHttpConfig:
http2ProtocolOptions: {}
- connectTimeout: 5s
edsClusterConfig:
edsConfig:
Expand All @@ -23,6 +28,11 @@ clusters:
metadata: {}
name: kube_gwtest_ext-authz_9000
type: EDS
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicitHttpConfig:
http2ProtocolOptions: {}
- connectTimeout: 5s
edsClusterConfig:
edsConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ clusters:
metadata: {}
name: kube_gwtest_ext-authz_9000
type: EDS
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicitHttpConfig:
http2ProtocolOptions: {}
- connectTimeout: 5s
edsClusterConfig:
edsConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ clusters:
metadata: {}
name: kube_gwtest_ext-authz_9000
type: EDS
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicitHttpConfig:
http2ProtocolOptions: {}
- connectTimeout: 5s
edsClusterConfig:
edsConfig:
Expand Down
46 changes: 43 additions & 3 deletions internal/kgateway/translator/gateway/gateway_translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,49 @@ var _ = DescribeTable("Basic GatewayTranslator Tests",
Name: "example-gateway",
},
}),
Entry("WS upgrade for backend", translatorTestCase{
inputFile: "https-listener-pol/ws-backend.yaml",
outputFile: "https-listener-pol/ws-backend.yaml",
Entry("Service with appProtocol=kubernetes.io/h2c", translatorTestCase{
inputFile: "backend-protocol/h2c.yaml",
outputFile: "backend-protocol/h2c.yaml",
gwNN: types.NamespacedName{
Namespace: "default",
Name: "example-gateway",
},
}),
Entry("Service with appProtocol=http2", translatorTestCase{
inputFile: "backend-protocol/http2.yaml",
outputFile: "backend-protocol/http2.yaml",
gwNN: types.NamespacedName{
Namespace: "default",
Name: "example-gateway",
},
}),
Entry("Service with appProtocol=grpc", translatorTestCase{
inputFile: "backend-protocol/grpc.yaml",
outputFile: "backend-protocol/grpc.yaml",
gwNN: types.NamespacedName{
Namespace: "default",
Name: "example-gateway",
},
}),
Entry("Service with appProtocol=grpc-web", translatorTestCase{
inputFile: "backend-protocol/grpc-web.yaml",
outputFile: "backend-protocol/grpc-web.yaml",
gwNN: types.NamespacedName{
Namespace: "default",
Name: "example-gateway",
},
}),
Entry("Service with appProtocol=kubernetes.io/ws", translatorTestCase{
inputFile: "backend-protocol/ws.yaml",
outputFile: "backend-protocol/ws.yaml",
gwNN: types.NamespacedName{
Namespace: "default",
Name: "example-gateway",
},
}),
Entry("Service with appProtocol=anything", translatorTestCase{
inputFile: "backend-protocol/default.yaml",
outputFile: "backend-protocol/default.yaml",
gwNN: types.NamespacedName{
Namespace: "default",
Name: "example-gateway",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: example-gateway
spec:
gatewayClassName: example-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
spec:
parentRefs:
- name: example-gateway
hostnames:
- "example.com"
rules:
- backendRefs:
- name: example-svc
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
spec:
selector:
test: test
ports:
- protocol: TCP
appProtocol: anything
port: 80
targetPort: test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: example-gateway
spec:
gatewayClassName: example-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
spec:
parentRefs:
- name: example-gateway
hostnames:
- "example.com"
rules:
- backendRefs:
- name: example-svc
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
spec:
selector:
test: test
ports:
- protocol: TCP
appProtocol: grpc-web
port: 80
targetPort: test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: example-gateway
spec:
gatewayClassName: example-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
spec:
parentRefs:
- name: example-gateway
hostnames:
- "example.com"
rules:
- backendRefs:
- name: example-svc
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
spec:
selector:
test: test
ports:
- protocol: TCP
appProtocol: grpc
port: 80
targetPort: test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: example-gateway
spec:
gatewayClassName: example-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
spec:
parentRefs:
- name: example-gateway
hostnames:
- "example.com"
rules:
- backendRefs:
- name: example-svc
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
spec:
selector:
test: test
ports:
- protocol: TCP
appProtocol: kubernetes.io/h2c
port: 80
targetPort: test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: example-gateway
spec:
gatewayClassName: example-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
spec:
parentRefs:
- name: example-gateway
hostnames:
- "example.com"
rules:
- backendRefs:
- name: example-svc
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
spec:
selector:
test: test
ports:
- protocol: TCP
appProtocol: http2
port: 80
targetPort: test
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,10 @@ spec:
protocol: HTTP
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
spec:
selector:
test: test
ports:
- protocol: HTTP
appProtocol: kubernetes.io/ws
port: 80
targetPort: test
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route-timeout
name: example-route
spec:
parentRefs:
- name: example-gateway
Expand All @@ -35,3 +22,16 @@ spec:
- backendRefs:
- name: example-svc
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
spec:
selector:
test: test
ports:
- protocol: TCP
appProtocol: kubernetes.io/ws
port: 80
targetPort: test
Loading