authentik: serve LDAP via an outpost behind the internal gateway

Adds the LDAP outpost deployment and routes ports 389 and 636 on
gateway-internal to it. 636 is a TLS listener in Terminate mode so
cert-manager renews the LDAPS certificate automatically, and both
listeners forward to the outpost's plaintext 3389.

allowedRoutes.kinds is set explicitly on both listeners: a TCP listener
permits no route kinds by default and a TLS listener defaults to
TLSRoute, so the TCPRoute would not attach otherwise.
This commit is contained in:
2026-09-13 11:24:23 +02:00
parent 7ee7db2346
commit c1287fa343
7 changed files with 165 additions and 0 deletions
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: authentik-ldap
namespace: authentik
spec:
replicas: 1
selector:
matchLabels:
app: authentik-ldap
template:
metadata:
labels:
app: authentik-ldap
spec:
containers:
- name: ldap
image: ghcr.io/goauthentik/ldap:2026.8.0
ports:
- containerPort: 3389
name: ldap
- containerPort: 6636
name: ldaps
- containerPort: 9300
name: metrics
envFrom:
- secretRef:
name: authentik-ldap-secrets
livenessProbe:
httpGet:
path: /outpost.goauthentik.io/ping
port: 9300
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /outpost.goauthentik.io/ping
port: 9300
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
memory: 256Mi
@@ -0,0 +1,24 @@
apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalSecret
metadata:
name: authentik-ldap-secrets
namespace: infisical
spec:
hostAPI: https://infisical.jsme.be
resyncInterval: 30
authentication:
kubernetesAuth:
identityId: "5458def7-7c63-40d2-95da-41c614d0933a"
serviceAccountRef:
name: infisical-auth
namespace: infisical
autoCreateServiceAccountToken: true
secretsScope:
projectSlug: "kubernetes"
envSlug: "prod"
secretsPath: "/authentik/authentik-ldap"
recursive: false
managedSecretReference:
secretName: authentik-ldap-secrets
secretNamespace: authentik
secretType: Opaque
+15
View File
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: authentik-ldap
namespace: authentik
spec:
selector:
app: authentik-ldap
ports:
- name: ldap
port: 3389
targetPort: 3389
- name: metrics
port: 9300
targetPort: 9300
+22
View File
@@ -0,0 +1,22 @@
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
name: authentik-ldap
namespace: authentik
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: gateway-internal
namespace: envoy-gateway
sectionName: authentik-ldap
- group: gateway.networking.k8s.io
kind: Gateway
name: gateway-internal
namespace: envoy-gateway
sectionName: authentik-ldaps
rules:
# The gateway terminates TLS on 636, so both listeners hit the plaintext port
- backendRefs:
- name: authentik-ldap
port: 3389