mirror of
https://github.com/lldap/lldap.git
synced 2026-03-31 15:07:48 +01:00
example_configs: Improve bootstrap.sh and documentation for use with Kubernetes (#1245)
This commit is contained in:
@@ -246,14 +246,14 @@ spec:
|
|||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
containers:
|
containers:
|
||||||
- name: lldap-bootstrap
|
- name: lldap-bootstrap
|
||||||
image: lldap/lldap:v0.5.0
|
image: lldap/lldap:latest
|
||||||
|
|
||||||
command:
|
command:
|
||||||
- /bootstrap/bootstrap.sh
|
- /app/bootstrap.sh
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- name: LLDAP_URL
|
- name: LLDAP_URL
|
||||||
value: "http://lldap:8080"
|
value: "http://lldap:17170"
|
||||||
|
|
||||||
- name: LLDAP_ADMIN_USERNAME
|
- name: LLDAP_ADMIN_USERNAME
|
||||||
valueFrom: { secretKeyRef: { name: lldap-admin-user, key: username } }
|
valueFrom: { secretKeyRef: { name: lldap-admin-user, key: username } }
|
||||||
@@ -265,11 +265,6 @@ spec:
|
|||||||
value: "true"
|
value: "true"
|
||||||
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: bootstrap
|
|
||||||
mountPath: /bootstrap/bootstrap.sh
|
|
||||||
readOnly: true
|
|
||||||
subPath: bootstrap.sh
|
|
||||||
|
|
||||||
- name: user-configs
|
- name: user-configs
|
||||||
mountPath: /bootstrap/user-configs
|
mountPath: /bootstrap/user-configs
|
||||||
readOnly: true
|
readOnly: true
|
||||||
@@ -279,27 +274,9 @@ spec:
|
|||||||
readOnly: true
|
readOnly: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: bootstrap
|
|
||||||
configMap:
|
|
||||||
name: bootstrap
|
|
||||||
defaultMode: 0555
|
|
||||||
items:
|
|
||||||
- key: bootstrap.sh
|
|
||||||
path: bootstrap.sh
|
|
||||||
|
|
||||||
- name: user-configs
|
- name: user-configs
|
||||||
projected:
|
projected:
|
||||||
sources:
|
sources:
|
||||||
- secret:
|
|
||||||
name: lldap-admin-user
|
|
||||||
items:
|
|
||||||
- key: user-config.json
|
|
||||||
path: admin-config.json
|
|
||||||
- secret:
|
|
||||||
name: lldap-password-manager-user
|
|
||||||
items:
|
|
||||||
- key: user-config.json
|
|
||||||
path: password-manager-config.json
|
|
||||||
- secret:
|
- secret:
|
||||||
name: lldap-bootstrap-configs
|
name: lldap-bootstrap-configs
|
||||||
items:
|
items:
|
||||||
|
|||||||
@@ -710,9 +710,9 @@ main() {
|
|||||||
redundant_users="$(printf '%s' "$redundant_users" | jq --compact-output --arg id "$id" '. - [$id]')"
|
redundant_users="$(printf '%s' "$redundant_users" | jq --compact-output --arg id "$id" '. - [$id]')"
|
||||||
|
|
||||||
if [[ "$password_file" != 'null' ]] && [[ "$password_file" != '""' ]]; then
|
if [[ "$password_file" != 'null' ]] && [[ "$password_file" != '""' ]]; then
|
||||||
LLDAP_USER_PASSWORD="$(cat $password_file)" "$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id"
|
"$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id" --password "$(cat $password_file)"
|
||||||
elif [[ "$password" != 'null' ]] && [[ "$password" != '""' ]]; then
|
elif [[ "$password" != 'null' ]] && [[ "$password" != '""' ]]; then
|
||||||
LLDAP_USER_PASSWORD="$password" "$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id"
|
"$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id" --password "$password"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Process custom attributes
|
# Process custom attributes
|
||||||
|
|||||||
Reference in New Issue
Block a user