mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
create psp policy in local-up-cluster.sh
This commit is contained in:
parent
f1c8b7581d
commit
f98af5b325
@ -633,6 +633,13 @@ function start_kubedns {
|
||||
fi
|
||||
}
|
||||
|
||||
function create_psp_policy {
|
||||
echo "Create podsecuritypolicy policies for RBAC."
|
||||
${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" create -f ${KUBE_ROOT}/examples/podsecuritypolicy/rbac/policies.yaml
|
||||
${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" create -f ${KUBE_ROOT}/examples/podsecuritypolicy/rbac/roles.yaml
|
||||
${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" create -f ${KUBE_ROOT}/examples/podsecuritypolicy/rbac/bindings.yaml
|
||||
}
|
||||
|
||||
function print_success {
|
||||
if [[ "${START_MODE}" != "kubeletonly" ]]; then
|
||||
cat <<EOF
|
||||
@ -720,6 +727,10 @@ if [[ "${START_MODE}" != "nokubelet" ]]; then
|
||||
start_kubelet
|
||||
fi
|
||||
|
||||
if [[ -n "${PSP_ADMISSION}" && "${ENABLE_RBAC}" = true ]]; then
|
||||
create_psp_policy
|
||||
fi
|
||||
|
||||
print_success
|
||||
|
||||
if [[ "${ENABLE_DAEMON}" = false ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user