2020-12-15 15:40:05 +00:00
|
|
|
---
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2020-12-15 15:40:05 +00:00
|
|
|
kind: GatewayClass
|
|
|
|
metadata:
|
|
|
|
name: my-gateway-class
|
|
|
|
spec:
|
2021-11-09 10:34:06 +00:00
|
|
|
controllerName: traefik.io/gateway-controller
|
2020-12-15 15:40:05 +00:00
|
|
|
|
|
|
|
---
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2020-12-15 15:40:05 +00:00
|
|
|
kind: Gateway
|
|
|
|
metadata:
|
|
|
|
name: my-gateway
|
|
|
|
namespace: default
|
|
|
|
spec:
|
|
|
|
gatewayClassName: my-gateway-class
|
2021-11-09 10:34:06 +00:00
|
|
|
listeners: # Use GatewayClass defaults for listener definition.
|
|
|
|
- name: http
|
|
|
|
protocol: HTTP
|
2020-12-15 15:40:05 +00:00
|
|
|
port: 80
|
2021-11-09 10:34:06 +00:00
|
|
|
|
|
|
|
- name: https
|
|
|
|
protocol: HTTPS
|
|
|
|
port: 443
|
|
|
|
tls:
|
|
|
|
certificateRefs:
|
|
|
|
- kind: Secret
|
|
|
|
name: mysecret
|
|
|
|
|
|
|
|
- name: tcp
|
|
|
|
protocol: TCP
|
2021-05-20 09:50:12 +00:00
|
|
|
port: 9000
|
2021-11-09 10:34:06 +00:00
|
|
|
allowedRoutes:
|
|
|
|
kinds:
|
|
|
|
- kind: TCPRoute
|
|
|
|
|
|
|
|
- name: tls
|
|
|
|
protocol: TLS
|
2021-05-20 09:50:12 +00:00
|
|
|
port: 9443
|
|
|
|
hostname: example.com
|
|
|
|
tls:
|
2022-04-15 11:52:08 +00:00
|
|
|
certificateRefs:
|
|
|
|
- kind: Secret
|
|
|
|
name: mysecret
|
2020-12-15 15:40:05 +00:00
|
|
|
|
|
|
|
---
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2020-12-15 15:40:05 +00:00
|
|
|
kind: HTTPRoute
|
|
|
|
metadata:
|
2021-11-09 10:34:06 +00:00
|
|
|
name: http-app
|
2020-12-15 15:40:05 +00:00
|
|
|
namespace: default
|
2021-11-09 10:34:06 +00:00
|
|
|
|
2020-12-15 15:40:05 +00:00
|
|
|
spec:
|
2021-11-09 10:34:06 +00:00
|
|
|
parentRefs:
|
|
|
|
- name: my-gateway
|
|
|
|
|
2020-12-15 15:40:05 +00:00
|
|
|
hostnames:
|
2021-11-09 10:34:06 +00:00
|
|
|
- foo.com
|
|
|
|
|
2020-12-15 15:40:05 +00:00
|
|
|
rules:
|
|
|
|
- matches:
|
|
|
|
- path:
|
|
|
|
type: Exact
|
|
|
|
value: /bar
|
2021-11-09 10:34:06 +00:00
|
|
|
|
|
|
|
backendRefs:
|
|
|
|
- name: whoami
|
2020-12-15 15:40:05 +00:00
|
|
|
port: 80
|
|
|
|
weight: 1
|
2021-11-09 10:34:06 +00:00
|
|
|
|
2021-02-02 18:36:04 +00:00
|
|
|
- matches:
|
|
|
|
- path:
|
2021-11-09 10:34:06 +00:00
|
|
|
type: PathPrefix
|
2021-02-02 18:36:04 +00:00
|
|
|
value: /foo
|
2021-11-09 10:34:06 +00:00
|
|
|
|
|
|
|
backendRefs:
|
2023-03-20 14:38:08 +00:00
|
|
|
- group: traefik.io
|
2021-11-09 10:34:06 +00:00
|
|
|
kind: TraefikService
|
|
|
|
name: myservice@file
|
2021-02-02 18:36:04 +00:00
|
|
|
weight: 1
|
|
|
|
port: 80
|
2021-05-20 09:50:12 +00:00
|
|
|
|
|
|
|
---
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2021-05-20 09:50:12 +00:00
|
|
|
kind: TCPRoute
|
|
|
|
metadata:
|
2021-11-09 10:34:06 +00:00
|
|
|
name: tcp-app
|
2021-05-20 09:50:12 +00:00
|
|
|
namespace: default
|
2021-11-09 10:34:06 +00:00
|
|
|
|
2021-05-20 09:50:12 +00:00
|
|
|
spec:
|
2021-11-09 10:34:06 +00:00
|
|
|
parentRefs:
|
|
|
|
- name: my-gateway
|
|
|
|
|
2021-05-20 09:50:12 +00:00
|
|
|
rules:
|
2021-11-09 10:34:06 +00:00
|
|
|
- backendRefs:
|
|
|
|
- name: whoamitcp
|
2021-05-20 09:50:12 +00:00
|
|
|
port: 9000
|
|
|
|
weight: 1
|
|
|
|
|
|
|
|
---
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2021-05-20 09:50:12 +00:00
|
|
|
kind: TLSRoute
|
|
|
|
metadata:
|
2021-11-09 10:34:06 +00:00
|
|
|
name: tls-app
|
2021-05-20 09:50:12 +00:00
|
|
|
namespace: default
|
2021-11-09 10:34:06 +00:00
|
|
|
|
2021-05-20 09:50:12 +00:00
|
|
|
spec:
|
2021-11-09 10:34:06 +00:00
|
|
|
parentRefs:
|
|
|
|
- name: my-gateway
|
|
|
|
sectionName: tls
|
|
|
|
|
2021-05-20 09:50:12 +00:00
|
|
|
rules:
|
2021-11-09 10:34:06 +00:00
|
|
|
- backendRefs:
|
|
|
|
- name: whoamitcp
|
2021-05-20 09:50:12 +00:00
|
|
|
port: 9000
|
|
|
|
weight: 1
|