97345a8628
Route /ui to the UI service, everything else (/, /api, /v2, /health, etc.) to the API service. Eliminates the need to add a new route rule for every API path prefix.
60 lines
1.2 KiB
YAML
60 lines
1.2 KiB
YAML
---
|
|
apiVersion: gateway.networking.k8s.io/v1
|
|
kind: HTTPRoute
|
|
metadata:
|
|
name: http-redirect
|
|
namespace: artifactapi
|
|
spec:
|
|
hostnames:
|
|
- artifactapi.k8s.syd1.au.unkin.net
|
|
parentRefs:
|
|
- group: gateway.networking.k8s.io
|
|
kind: Gateway
|
|
name: artifactapi
|
|
sectionName: http
|
|
rules:
|
|
- filters:
|
|
- type: RequestRedirect
|
|
requestRedirect:
|
|
scheme: https
|
|
statusCode: 301
|
|
matches:
|
|
- path:
|
|
type: PathPrefix
|
|
value: /
|
|
---
|
|
apiVersion: gateway.networking.k8s.io/v1
|
|
kind: HTTPRoute
|
|
metadata:
|
|
name: api-route
|
|
namespace: artifactapi
|
|
spec:
|
|
hostnames:
|
|
- artifactapi.k8s.syd1.au.unkin.net
|
|
parentRefs:
|
|
- group: gateway.networking.k8s.io
|
|
kind: Gateway
|
|
name: artifactapi
|
|
sectionName: https
|
|
rules:
|
|
- backendRefs:
|
|
- group: ""
|
|
kind: Service
|
|
name: ui
|
|
port: 80
|
|
weight: 1
|
|
matches:
|
|
- path:
|
|
type: PathPrefix
|
|
value: /ui
|
|
- backendRefs:
|
|
- group: ""
|
|
kind: Service
|
|
name: artifactapi
|
|
port: 80
|
|
weight: 1
|
|
matches:
|
|
- path:
|
|
type: PathPrefix
|
|
value: /
|