gateway api: support RouteNamespaces
Co-authored-by: Jean-Baptiste Doumenjou <925513+jbdoumenjou@users.noreply.github.com>
This commit is contained in:
parent
9ef3fc84f9
commit
969dd088a2
24 changed files with 2629 additions and 95 deletions
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: HTTP
|
||||
port: 80
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: All
|
||||
selector:
|
||||
matchLabels:
|
||||
app: foo
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: foo
|
||||
spec:
|
||||
hostnames:
|
||||
- "foo.com"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: Exact
|
||||
value: /foo
|
||||
forwardTo:
|
||||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: foo
|
||||
spec:
|
||||
hostnames:
|
||||
- "bar.com"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: Exact
|
||||
value: /bar
|
||||
forwardTo:
|
||||
- serviceName: whoami-bar
|
||||
port: 80
|
||||
weight: 1
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: HTTP
|
||||
port: 80
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: foo
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: foo
|
||||
spec:
|
||||
hostnames:
|
||||
- "foo.com"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: Exact
|
||||
value: /foo
|
||||
forwardTo:
|
||||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: foo
|
||||
spec:
|
||||
hostnames:
|
||||
- "bar.com"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: Exact
|
||||
value: /bar
|
||||
forwardTo:
|
||||
- serviceName: whoami-bar
|
||||
port: 80
|
||||
weight: 1
|
|
@ -0,0 +1,79 @@
|
|||
---
|
||||
kind: Namespace
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: bar
|
||||
labels:
|
||||
foo: bar
|
||||
|
||||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: HTTP
|
||||
port: 80
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: foo
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: foo
|
||||
spec:
|
||||
hostnames:
|
||||
- "foo.com"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: Exact
|
||||
value: /foo
|
||||
forwardTo:
|
||||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: foo
|
||||
spec:
|
||||
hostnames:
|
||||
- "bar.com"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: Exact
|
||||
value: /bar
|
||||
forwardTo:
|
||||
- serviceName: whoami-bar
|
||||
port: 80
|
||||
weight: 1
|
|
@ -100,6 +100,7 @@ spec:
|
|||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
|
|
|
@ -93,6 +93,7 @@ spec:
|
|||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
|
|
|
@ -0,0 +1,177 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: supersecret
|
||||
namespace: default
|
||||
|
||||
data:
|
||||
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
|
||||
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
|
||||
|
||||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: HTTP
|
||||
port: 9080
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: All
|
||||
selector:
|
||||
matchLabels:
|
||||
app: http-app
|
||||
- protocol: HTTPS
|
||||
port: 9443
|
||||
tls:
|
||||
certificateRef:
|
||||
kind: Secret
|
||||
name: supersecret
|
||||
group: core
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: All
|
||||
selector:
|
||||
matchLabels:
|
||||
app: http-app
|
||||
- protocol: TCP
|
||||
port: 9000
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: All
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tcp-app
|
||||
- protocol: TLS
|
||||
port: 10000
|
||||
hostname: tls.foo.example.com
|
||||
tls:
|
||||
certificateRef:
|
||||
kind: Secret
|
||||
name: supersecret
|
||||
group: core
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: All
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tcp-app
|
||||
- protocol: TLS
|
||||
port: 11000
|
||||
hostname: pass.tls.foo.example.com
|
||||
tls:
|
||||
mode: Passthrough
|
||||
routes:
|
||||
kind: TLSRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tls-app
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: http-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tcp-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: http-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoami-bar
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tcp-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
|
@ -0,0 +1,177 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: supersecret
|
||||
namespace: default
|
||||
|
||||
data:
|
||||
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
|
||||
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
|
||||
|
||||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: HTTP
|
||||
port: 9080
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: http-app
|
||||
- protocol: HTTPS
|
||||
port: 9443
|
||||
tls:
|
||||
certificateRef:
|
||||
kind: Secret
|
||||
name: supersecret
|
||||
group: core
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: http-app
|
||||
- protocol: TCP
|
||||
port: 9000
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tcp-app
|
||||
- protocol: TLS
|
||||
port: 10000
|
||||
hostname: tls.foo.example.com
|
||||
tls:
|
||||
certificateRef:
|
||||
kind: Secret
|
||||
name: supersecret
|
||||
group: core
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tcp-app
|
||||
- protocol: TLS
|
||||
port: 11000
|
||||
hostname: pass.tls.foo.example.com
|
||||
tls:
|
||||
mode: Passthrough
|
||||
routes:
|
||||
kind: TLSRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tls-app
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: http-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tcp-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: http-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoami-bar
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tcp-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
|
@ -0,0 +1,201 @@
|
|||
---
|
||||
kind: Namespace
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: bar
|
||||
labels:
|
||||
foo: bar
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: supersecret
|
||||
namespace: default
|
||||
|
||||
data:
|
||||
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
|
||||
tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
|
||||
|
||||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: HTTP
|
||||
port: 9080
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: http-app
|
||||
- protocol: HTTPS
|
||||
port: 9443
|
||||
tls:
|
||||
certificateRef:
|
||||
kind: Secret
|
||||
name: supersecret
|
||||
group: core
|
||||
routes:
|
||||
kind: HTTPRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: http-app
|
||||
- protocol: TCP
|
||||
port: 9000
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tcp-app
|
||||
- protocol: TLS
|
||||
port: 10000
|
||||
hostname: tls.foo.example.com
|
||||
tls:
|
||||
certificateRef:
|
||||
kind: Secret
|
||||
name: supersecret
|
||||
group: core
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tcp-app
|
||||
- protocol: TLS
|
||||
port: 11000
|
||||
hostname: pass.tls.foo.example.com
|
||||
tls:
|
||||
mode: Passthrough
|
||||
routes:
|
||||
kind: TLSRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tls-app
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: http-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoami
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tcp-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: HTTPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: http-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: http-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoami-bar
|
||||
port: 80
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tcp-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
|
@ -33,6 +33,42 @@ subsets:
|
|||
- name: web2
|
||||
port: 8000
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: whoami-bar
|
||||
namespace: bar
|
||||
|
||||
spec:
|
||||
ports:
|
||||
- name: web2
|
||||
port: 8000
|
||||
targetPort: web2
|
||||
- name: web
|
||||
port: 80
|
||||
targetPort: web
|
||||
selector:
|
||||
app: containous
|
||||
task: whoami
|
||||
|
||||
---
|
||||
kind: Endpoints
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: whoami-bar
|
||||
namespace: bar
|
||||
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 10.10.0.11
|
||||
- ip: 10.10.0.12
|
||||
ports:
|
||||
- name: web
|
||||
port: 80
|
||||
- name: web2
|
||||
port: 8000
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
@ -164,7 +200,6 @@ spec:
|
|||
protocol: TCP
|
||||
port: 443
|
||||
|
||||
|
||||
---
|
||||
kind: Endpoints
|
||||
apiVersion: v1
|
||||
|
@ -199,3 +234,38 @@ spec:
|
|||
- protocol: TCP
|
||||
port: 10000
|
||||
name: tcp-2
|
||||
|
||||
---
|
||||
kind: Endpoints
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: whoamitcp-bar
|
||||
namespace: bar
|
||||
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 10.10.0.13
|
||||
- ip: 10.10.0.14
|
||||
ports:
|
||||
- name: tcp-1
|
||||
protocol: TCP
|
||||
port: 9000
|
||||
- name: tcp-2
|
||||
protocol: TCP
|
||||
port: 10000
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: whoamitcp-bar
|
||||
namespace: bar
|
||||
|
||||
spec:
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 9000
|
||||
name: tcp-1
|
||||
- protocol: TCP
|
||||
port: 10000
|
||||
name: tcp-2
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
namespace: default
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-tcp-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: TCP
|
||||
port: 9000
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: All
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whoamitcp
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: whoamitcp
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: whoamitcp
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
namespace: default
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-tcp-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: TCP
|
||||
port: 9000
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whoamitcp
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: whoamitcp
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: whoamitcp
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
kind: Namespace
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: bar
|
||||
labels:
|
||||
foo: bar
|
||||
|
||||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
namespace: default
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-tcp-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: TCP
|
||||
port: 9000
|
||||
routes:
|
||||
kind: TCPRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whoamitcp
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: whoamitcp
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tcp-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: whoamitcp
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
|
@ -50,7 +50,6 @@ spec:
|
|||
matchLabels:
|
||||
app: label-tls-app-1
|
||||
|
||||
|
||||
---
|
||||
kind: TCPRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: TLS
|
||||
port: 9001
|
||||
hostname: foo.example.com
|
||||
tls:
|
||||
mode: Passthrough
|
||||
routes:
|
||||
kind: TLSRoute
|
||||
namespaces:
|
||||
from: All
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tls-app
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
matches:
|
||||
- snis:
|
||||
- foo.default
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
||||
matches:
|
||||
- snis:
|
||||
- foo.bar
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: TLS
|
||||
port: 9001
|
||||
hostname: foo.example.com
|
||||
tls:
|
||||
mode: Passthrough
|
||||
routes:
|
||||
kind: TLSRoute
|
||||
namespaces:
|
||||
from: Same
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tls-app
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
matches:
|
||||
- snis:
|
||||
- foo.default
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
||||
matches:
|
||||
- snis:
|
||||
- foo.bar
|
|
@ -0,0 +1,76 @@
|
|||
---
|
||||
kind: Namespace
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: bar
|
||||
labels:
|
||||
foo: bar
|
||||
|
||||
---
|
||||
kind: GatewayClass
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway-class
|
||||
spec:
|
||||
controller: traefik.io/gateway-controller
|
||||
|
||||
---
|
||||
kind: Gateway
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: my-gateway
|
||||
namespace: default
|
||||
spec:
|
||||
gatewayClassName: my-gateway-class
|
||||
listeners: # Use GatewayClass defaults for listener definition.
|
||||
- protocol: TLS
|
||||
port: 9001
|
||||
hostname: foo.example.com
|
||||
tls:
|
||||
mode: Passthrough
|
||||
routes:
|
||||
kind: TLSRoute
|
||||
namespaces:
|
||||
from: Selector
|
||||
selector:
|
||||
matchLabels:
|
||||
foo: bar
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tls-app
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-default
|
||||
namespace: default
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp
|
||||
port: 9000
|
||||
weight: 1
|
||||
matches:
|
||||
- snis:
|
||||
- foo.default
|
||||
|
||||
---
|
||||
kind: TLSRoute
|
||||
apiVersion: networking.x-k8s.io/v1alpha1
|
||||
metadata:
|
||||
name: tls-app-bar
|
||||
namespace: bar
|
||||
labels:
|
||||
app: tls-app
|
||||
spec:
|
||||
rules:
|
||||
- forwardTo:
|
||||
- serviceName: whoamitcp-bar
|
||||
port: 9000
|
||||
weight: 1
|
||||
matches:
|
||||
- snis:
|
||||
- foo.bar
|
Loading…
Add table
Add a link
Reference in a new issue