add http redirect

This commit is contained in:
2024-08-21 19:27:22 -05:00
parent a27ed7ad72
commit 464553f65e
2 changed files with 32 additions and 0 deletions

View File

@@ -12,11 +12,15 @@ metadata:
spec: spec:
gatewayClassName: cilium gatewayClassName: cilium
listeners: listeners:
- name: http
protocol: HTTP
port: 80
- name: https - name: https
protocol: HTTPS protocol: HTTPS
port: 443 port: 443
hostname: auth.alexlebens.net hostname: auth.alexlebens.net
tls: tls:
mode: Terminate
certificateRefs: certificateRefs:
- kind: Secret - kind: Secret
name: authentik-tls-gateway name: authentik-tls-gateway

View File

@@ -14,6 +14,7 @@ spec:
- group: gateway.networking.k8s.io - group: gateway.networking.k8s.io
kind: Gateway kind: Gateway
name: authentik-tls-gateway name: authentik-tls-gateway
sectionName: https
hostnames: hostnames:
- auth.alexlebens.net - auth.alexlebens.net
rules: rules:
@@ -31,3 +32,30 @@ spec:
- path: - path:
type: PathPrefix type: PathPrefix
value: / value: /
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: authentik-http-redirect
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: authentik-http-redirect
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: network
app.kubernetes.io/part-of: {{ .Release.Name }}
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: authentik-tls-gateway
sectionName: http
hostnames:
- auth.alexlebens.net
rules:
- filters:
- type: RequestRedirect
requestRedirect:
scheme: https
statusCode: 301