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,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: ""