1
0
Fork 0

Update gateway api provider to v1alpha2

Co-authored-by: Tom Moulard <tom.moulard@traefik.io>
This commit is contained in:
Kevin Pollet 2021-11-09 11:34:06 +01:00 committed by GitHub
parent e10a82a501
commit 8e32d1913b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 10330 additions and 7789 deletions

View file

@ -11,122 +11,149 @@ data:
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners: # Use GatewayClass defaults for listener definition.
- protocol: HTTP
listeners: # Use GatewayClass defaults for listener definition.
- name: http
protocol: HTTP
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app
- protocol: HTTPS
- name: https
protocol: HTTPS
port: 9443
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: HTTPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app
- protocol: TCP
- name: tcp
protocol: TCP
port: 9000
routes:
kind: TCPRoute
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls-10000
protocol: TLS
port: 10000
hostname: tls.foo.example.com
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: TCPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls-11000
protocol: TLS
port: 11000
hostname: pass.tls.foo.example.com
tls:
mode: Passthrough
routes:
kind: TLSRoute
allowedRoutes:
kinds:
- kind: TLSRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: tls-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-1
namespace: default
labels:
app: http-app
spec:
parentRefs:
- name: my-gateway
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: https
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-1
namespace: default
labels:
app: tcp-app
spec:
parentRefs:
- name: my-gateway
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: tls-10000
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-1
namespace: default
labels:
app: tls-app
spec:
parentRefs:
- name: my-gateway
sectionName: tls-11000
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""

View file

@ -1,41 +1,41 @@
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners:
- protocol: UNKNOWN
- name: unknown
protocol: UNKNOWN
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-1
namespace: default
labels:
app: http-app
spec:
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""

View file

@ -1,41 +1,41 @@
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners:
- protocol: HTTP
- name: http
protocol: HTTP
port: 9080
routes:
kind: UnknownRoute
allowedRoutes:
kinds:
- kind: UnknownRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-1
namespace: default
labels:
app: http-app
spec:
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""

View file

@ -0,0 +1,135 @@
---
apiVersion: v1
kind: Secret
metadata:
name: supersecret
namespace: default
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
kind: GatewayClass
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners: # Use GatewayClass defaults for listener definition.
- name: http
protocol: HTTP
port: 9080
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
- name: https
protocol: HTTPS
port: 9443
tls:
certificateRefs:
- kind: Secret
name: supersecret
group: "core"
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
- name: tcp
protocol: TCP
port: 9000
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
- name: tls
protocol: TLS
port: 10000
hostname: tls.foo.example.com
tls:
certificateRefs:
- kind: Secret
name: supersecret
group: "core"
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
---
kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-default
namespace: default
spec:
parentRefs:
- name: my-gateway
kind: Gateway
group: gateway.networking.k8s.io
rules:
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: core
---
kind: TCPRoute
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-default
namespace: default
spec:
parentRefs:
- name: my-gateway
kind: Gateway
group: gateway.networking.k8s.io
rules:
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: core
---
kind: TLSRoute
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-default
namespace: default
spec:
parentRefs:
- name: my-gateway
kind: Gateway
group: gateway.networking.k8s.io
rules:
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: core

View file

@ -1,41 +1,41 @@
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners:
- protocol: TLS
- name: tls
protocol: TLS
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-1
namespace: default
labels:
app: http-app
spec:
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""

View file

@ -11,130 +11,130 @@ data:
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners: # Use GatewayClass defaults for listener definition.
- protocol: HTTP
listeners: # Use GatewayClass defaults for listener definition.
- name: http1
protocol: HTTP
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app-1
- protocol: HTTP
- name: http2
protocol: HTTP
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
namespaces:
from: Same
selector:
matchLabels:
app: http-app-2
- protocol: TCP
- name: tcp
protocol: TCP
port: 9000
routes:
kind: TCPRoute
allowedRoutes:
kinds:
- kind: TCPRoute
namespaces:
from: Same
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls
protocol: TLS
port: 9000
tls:
mode: Passthrough
routes:
kind: TLSRoute
allowedRoutes:
kinds:
- kind: TLSRoute
namespaces:
from: Same
selector:
matchLabels:
app: tls-app
- protocol: TLS
- name: tls2
protocol: TLS
port: 9000
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: TCPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: TCPRoute
namespaces:
from: Same
selector:
matchLabels:
app: tcp-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-1
namespace: default
labels:
app: http-app
spec:
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-2
namespace: default
labels:
app: http-app
spec:
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-1
namespace: default
labels:
app: tcp-app
spec:
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-1
namespace: default
labels:
app: tls-app
spec:
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""

View file

@ -11,167 +11,222 @@ data:
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners: # Use GatewayClass defaults for listener definition.
- protocol: HTTP
listeners: # Use GatewayClass defaults for listener definition.
- name: http
protocol: HTTP
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: All
selector:
matchLabels:
app: http-app
- protocol: HTTPS
- name: https
protocol: HTTPS
port: 9443
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: HTTPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: All
selector:
matchLabels:
app: http-app
- protocol: TCP
- name: tcp
protocol: TCP
port: 9000
routes:
kind: TCPRoute
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: All
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls-10000
protocol: TLS
port: 10000
hostname: tls.foo.example.com
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: TCPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: All
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls-11000
protocol: TLS
port: 11000
hostname: pass.tls.foo.example.com
tls:
mode: Passthrough
routes:
kind: TLSRoute
allowedRoutes:
kinds:
- kind: TLSRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: tls-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-default
namespace: default
labels:
app: http-app
spec:
parentRefs:
- name: my-gateway
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: https
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-default
namespace: default
labels:
app: tcp-app
spec:
parentRefs:
- name: my-gateway
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: tls-10000
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-default
namespace: default
labels:
app: tls-app
spec:
parentRefs:
- name: my-gateway
sectionName: tls-11000
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-bar
namespace: bar
labels:
app: http-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
namespace: default
sectionName: https
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoami-bar
- backendRefs:
- name: whoami-bar
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-bar
namespace: bar
labels:
app: tcp-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
namespace: default
sectionName: tls-10000
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp-bar
- backendRefs:
- name: whoamitcp-bar
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-bar
namespace: bar
labels:
app: tls-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: tls-11000
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp-bar
- backendRefs:
- name: whoamitcp-bar
port: 9000
weight: 1
kind: Service
group: ""

View file

@ -11,167 +11,222 @@ data:
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners: # Use GatewayClass defaults for listener definition.
- protocol: HTTP
listeners: # Use GatewayClass defaults for listener definition.
- name: http
protocol: HTTP
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app
- protocol: HTTPS
- name: https
protocol: HTTPS
port: 9443
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: HTTPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: http-app
- protocol: TCP
- name: tcp
protocol: TCP
port: 9000
routes:
kind: TCPRoute
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls
protocol: TLS
port: 10000
hostname: tls.foo.example.com
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: TCPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls2
protocol: TLS
port: 11000
hostname: pass.tls.foo.example.com
tls:
mode: Passthrough
routes:
kind: TLSRoute
allowedRoutes:
kinds:
- kind: TLSRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
selector:
matchLabels:
app: tls-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-default
namespace: default
labels:
app: http-app
spec:
parentRefs:
- name: my-gateway
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: https
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-default
namespace: default
labels:
app: tcp-app
spec:
parentRefs:
- name: my-gateway
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: tls
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-default
namespace: default
labels:
app: tls-app
spec:
parentRefs:
- name: my-gateway
sectionName: tls2
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-bar
namespace: bar
labels:
app: http-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
namespace: default
sectionName: https
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoami-bar
- backendRefs:
- name: whoami-bar
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-bar
namespace: bar
labels:
app: tcp-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
namespace: default
sectionName: tls
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp-bar
- backendRefs:
- name: whoamitcp-bar
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-bar
namespace: bar
labels:
app: tls-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: tls2
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp-bar
- backendRefs:
- name: whoamitcp-bar
port: 9000
weight: 1
kind: Service
group: ""

View file

@ -17,185 +17,250 @@ data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
apiVersion: v1
kind: Secret
metadata:
name: supersecret
namespace: default
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners: # Use GatewayClass defaults for listener definition.
- protocol: HTTP
listeners: # Use GatewayClass defaults for listener definition.
- name: http
protocol: HTTP
port: 9080
routes:
kind: HTTPRoute
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Selector
selector:
matchLabels:
foo: bar
selector:
matchLabels:
app: http-app
- protocol: HTTPS
- name: https
protocol: HTTPS
port: 9443
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: HTTPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Selector
selector:
matchLabels:
foo: bar
selector:
matchLabels:
app: http-app
- protocol: TCP
- name: tcp
protocol: TCP
port: 9000
routes:
kind: TCPRoute
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Selector
selector:
matchLabels:
foo: bar
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls
protocol: TLS
port: 10000
hostname: tls.foo.example.com
tls:
certificateRef:
kind: Secret
name: supersecret
group: core
routes:
kind: TCPRoute
certificateRefs:
- kind: Secret
name: supersecret
group: ""
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Selector
selector:
matchLabels:
foo: bar
selector:
matchLabels:
app: tcp-app
- protocol: TLS
- name: tls2
protocol: TLS
port: 11000
hostname: pass.tls.foo.example.com
tls:
mode: Passthrough
routes:
kind: TLSRoute
allowedRoutes:
kinds:
- kind: TLSRoute
group: gateway.networking.k8s.io
namespaces:
from: Selector
selector:
matchLabels:
foo: bar
selector:
matchLabels:
app: tls-app
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-default
namespace: default
labels:
app: http-app
spec:
parentRefs:
- name: my-gateway
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: https
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoami
- backendRefs:
- name: whoami
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-default
namespace: default
labels:
app: tcp-app
spec:
parentRefs:
- name: my-gateway
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
sectionName: tls
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-default
namespace: default
labels:
app: tls-app
spec:
parentRefs:
- name: my-gateway
sectionName: tls2
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-bar
namespace: bar
labels:
app: http-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
namespace: default
sectionName: https
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoami-bar
- backendRefs:
- name: whoami-bar
port: 80
weight: 1
kind: Service
group: ""
---
kind: TCPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tcp-app-bar
namespace: bar
labels:
app: tcp-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
- name: my-gateway
namespace: default
sectionName: tls
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp-bar
- backendRefs:
- name: whoamitcp-bar
port: 9000
weight: 1
kind: Service
group: ""
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-bar
namespace: bar
labels:
app: tls-app
spec:
parentRefs:
- name: my-gateway
namespace: default
sectionName: tls2
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp-bar
- backendRefs:
- name: whoamitcp-bar
port: 9000
weight: 1
kind: Service
group: ""

View file

@ -1,75 +1,99 @@
---
kind: GatewayClass
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-gateway-class
namespace: default
spec:
controller: traefik.io/gateway-controller
controllerName: traefik.io/gateway-controller
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: my-mixed-gateway
namespace: default
spec:
gatewayClassName: my-gateway-class
listeners: # Use GatewayClass defaults for listener definition.
- protocol: HTTP
listeners: # Use GatewayClass defaults for listener definition.
- name: http
protocol: HTTP
port: 80
routes:
kind: HTTPRoute
selector:
matchLabels:
app: label-tls-app-1
- protocol: TCP
allowedRoutes:
kinds:
- kind: HTTPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
- name: tcp
protocol: TCP
port: 9000
routes:
kind: TCPRoute
selector:
matchLabels:
app: label-tls-app-1
- protocol: TLS
allowedRoutes:
kinds:
- kind: TCPRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
- name: tls
protocol: TLS
port: 9443
tls:
mode: Passthrough
routes:
kind: TLSRoute
selector:
matchLabels:
app: label-http-app-1
allowedRoutes:
kinds:
- kind: TLSRoute
group: gateway.networking.k8s.io
namespaces:
from: Same
---
kind: TLSRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: tls-app-1
namespace: default
labels:
app: label-tls-app-1
spec:
parentRefs:
- name: my-mixed-gateway
sectionName: http
kind: Gateway
group: gateway.networking.k8s.io
- name: my-mixed-gateway
sectionName: tcp
kind: Gateway
group: gateway.networking.k8s.io
rules:
- forwardTo:
- serviceName: whoamitcp
- backendRefs:
- name: whoamitcp
port: 9000
weight: 1
kind: Service
group: ""
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: http-app-1
namespace: default
labels:
app: label-http-app-1
spec:
parentRefs:
- name: my-mixed-gateway
sectionName: tls
kind: Gateway
group: gateway.networking.k8s.io
rules:
- matches:
- path:
type: Exact
value: /bar
forwardTo:
- serviceName: whoamitcp
backendRefs:
- name: whoamitcp
port: 80
weight: 1
kind: Service
group: ""