feat(consul): add HTTP→HTTPS redirect on port 80
This commit is contained in:
@@ -18,6 +18,13 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
gatewayClassName: traefik-internal
|
gatewayClassName: traefik-internal
|
||||||
listeners:
|
listeners:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
protocol: HTTP
|
||||||
|
hostname: consul.k8s.syd1.au.unkin.net
|
||||||
|
allowedRoutes:
|
||||||
|
namespaces:
|
||||||
|
from: Same
|
||||||
- name: https
|
- name: https
|
||||||
port: 443
|
port: 443
|
||||||
protocol: HTTPS
|
protocol: HTTPS
|
||||||
|
|||||||
@@ -1,6 +1,31 @@
|
|||||||
---
|
---
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
apiVersion: gateway.networking.k8s.io/v1
|
||||||
kind: HTTPRoute
|
kind: HTTPRoute
|
||||||
|
metadata:
|
||||||
|
name: consul-http-redirect
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: consul
|
||||||
|
app.kubernetes.io/instance: consul
|
||||||
|
spec:
|
||||||
|
hostnames:
|
||||||
|
- consul.k8s.syd1.au.unkin.net
|
||||||
|
parentRefs:
|
||||||
|
- name: consul
|
||||||
|
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:
|
metadata:
|
||||||
name: consul
|
name: consul
|
||||||
namespace: consul
|
namespace: consul
|
||||||
|
|||||||
Reference in New Issue
Block a user