Commit f98af5b3 authored by xilabao's avatar xilabao

create psp policy in local-up-cluster.sh

parent f1c8b758
...@@ -633,6 +633,13 @@ function start_kubedns { ...@@ -633,6 +633,13 @@ function start_kubedns {
fi 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 { function print_success {
if [[ "${START_MODE}" != "kubeletonly" ]]; then if [[ "${START_MODE}" != "kubeletonly" ]]; then
cat <<EOF cat <<EOF
...@@ -720,6 +727,10 @@ if [[ "${START_MODE}" != "nokubelet" ]]; then ...@@ -720,6 +727,10 @@ if [[ "${START_MODE}" != "nokubelet" ]]; then
start_kubelet start_kubelet
fi fi
if [[ -n "${PSP_ADMISSION}" && "${ENABLE_RBAC}" = true ]]; then
create_psp_policy
fi
print_success print_success
if [[ "${ENABLE_DAEMON}" = false ]]; then if [[ "${ENABLE_DAEMON}" = false ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment