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:
gatewayClassName: cilium
listeners:
- name: http
protocol: HTTP
port: 80
- name: https
protocol: HTTPS
port: 443
hostname: auth.alexlebens.net
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: authentik-tls-gateway

View File

@@ -14,6 +14,7 @@ spec:
- group: gateway.networking.k8s.io
kind: Gateway
name: authentik-tls-gateway
sectionName: https
hostnames:
- auth.alexlebens.net
rules:
@@ -31,3 +32,30 @@ spec:
- path:
type: PathPrefix
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