2020-12-15 15:40:05 +00:00
|
|
|
---
|
|
|
|
kind: GatewayClass
|
|
|
|
apiVersion: networking.x-k8s.io/v1alpha1
|
|
|
|
metadata:
|
|
|
|
name: my-gateway-class
|
2021-05-20 09:50:12 +00:00
|
|
|
namespace: default
|
2020-12-15 15:40:05 +00:00
|
|
|
spec:
|
|
|
|
controller: traefik.io/gateway-controller
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: Gateway
|
|
|
|
apiVersion: networking.x-k8s.io/v1alpha1
|
|
|
|
metadata:
|
2021-05-20 09:50:12 +00:00
|
|
|
name: my-tcp-gateway
|
2020-12-15 15:40:05 +00:00
|
|
|
namespace: default
|
|
|
|
spec:
|
|
|
|
gatewayClassName: my-gateway-class
|
|
|
|
listeners: # Use GatewayClass defaults for listener definition.
|
2021-05-20 09:50:12 +00:00
|
|
|
- protocol: TCP
|
|
|
|
port: 9000
|
2020-12-15 15:40:05 +00:00
|
|
|
routes:
|
2021-05-20 09:50:12 +00:00
|
|
|
kind: TCPRoute
|
2020-12-15 15:40:05 +00:00
|
|
|
selector:
|
2021-05-20 09:50:12 +00:00
|
|
|
matchLabels:
|
|
|
|
app: label-tcp-app
|
2020-12-15 15:40:05 +00:00
|
|
|
|
|
|
|
---
|
2021-05-20 09:50:12 +00:00
|
|
|
kind: TCPRoute
|
2020-12-15 15:40:05 +00:00
|
|
|
apiVersion: networking.x-k8s.io/v1alpha1
|
|
|
|
metadata:
|
2021-05-20 09:50:12 +00:00
|
|
|
name: tcp-app
|
2020-12-15 15:40:05 +00:00
|
|
|
namespace: default
|
|
|
|
labels:
|
2021-05-20 09:50:12 +00:00
|
|
|
app: label-tcp-app
|
2020-12-15 15:40:05 +00:00
|
|
|
spec:
|
|
|
|
rules:
|
2021-05-20 09:50:12 +00:00
|
|
|
- forwardTo:
|
|
|
|
- serviceName: whoamitcp
|
2020-12-15 15:40:05 +00:00
|
|
|
port: 9000
|
2021-05-20 09:50:12 +00:00
|
|
|
weight: 1
|
|
|
|
- forwardTo:
|
|
|
|
- serviceName: whoamitcp
|
|
|
|
port: 10000
|
|
|
|
weight: 1
|