Files
homelab-v/k8s/infra/auth/lldap/bootstrap.yaml
T
2025-07-20 13:18:19 +02:00

64 lines
2.2 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: lldap-bootstrap
namespace: lldap
annotations:
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
spec:
template:
spec:
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
containers:
- name: lldap-bootstrap
image: ghcr.io/lldap/lldap:2025-07-10-alpine-rootless # renovate: docker=ghcr.io/lldap/lldap
command: [ /app/bootstrap.sh ]
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: { drop: [ ALL ] }
envFrom:
- configMapRef: { name: lldap-config }
- configMapRef: { name: bootstrap-config }
env:
- name: LLDAP_ADMIN_USERNAME
valueFrom:
secretKeyRef: { name: lldap-credentials, key: LLDAP_LDAP_USER_DN }
- name: LLDAP_ADMIN_PASSWORD
valueFrom:
secretKeyRef: { name: lldap-credentials, key: LLDAP_LDAP_USER_PASS }
volumeMounts:
- { name: tmp, mountPath: /tmp }
- { name: groups, mountPath: /bootstrap/group-configs, readOnly: true }
- { name: user-schemas, mountPath: /bootstrap/user-schemas, readOnly: true }
- { name: users, mountPath: /bootstrap/user-configs, readOnly: true }
volumes:
- { name: tmp, emptyDir: { } }
- name: groups
projected:
sources:
- secret:
name: lldap-bootstrap
items: [ { key: groups.json, path: groups.json } ]
- name: user-schemas
projected:
sources:
- secret:
name: lldap-bootstrap
items: [ { key: user-schemas.json, path: user-schemas.json } ]
- name: users
projected:
sources:
- secret:
name: lldap-bootstrap
items: [ { key: users.json, path: users.json } ]