mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Adding legacy ABAC for 1.6
This commit is contained in:
parent
6d9e2afeda
commit
3adac0dace
@ -1051,6 +1051,21 @@ function start-kube-apiserver {
|
||||
|
||||
|
||||
local authorization_mode="RBAC"
|
||||
|
||||
# Create the ABAC file only if it's explicitly requested.
|
||||
if [[ -n "${ENABLE_LEGACY_ABAC_16_ONLY:-}" ]]; then
|
||||
if [[ -n "${KUBE_USER:-}" || ! -e /etc/srv/kubernetes/abac-authz-policy.jsonl ]]; then
|
||||
local -r abac_policy_json="${src_dir}/abac-authz-policy.jsonl"
|
||||
remove-salt-config-comments "${abac_policy_json}"
|
||||
if [[ -n "${KUBE_USER:-}" ]]; then
|
||||
sed -i -e "s/{{kube_user}}/${KUBE_USER}/g" "${abac_policy_json}"
|
||||
else
|
||||
sed -i -e "/{{kube_user}}/d" "${abac_policy_json}"
|
||||
fi
|
||||
cp "${abac_policy_json}" /etc/srv/kubernetes/
|
||||
fi
|
||||
fi
|
||||
|
||||
# Load existing ABAC policy files written by versions < 1.6 of this script
|
||||
# TODO: only default to this legacy path when in upgrade mode
|
||||
ABAC_AUTHZ_FILE="${ABAC_AUTHZ_FILE:-/etc/srv/kubernetes/abac-authz-policy.jsonl}"
|
||||
|
Loading…
Reference in New Issue
Block a user