diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index e86fbaa7c3..d237804485 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -62,6 +62,9 @@ CLOUD_PROVIDER=${CLOUD_PROVIDER:-""} CLOUD_CONFIG=${CLOUD_CONFIG:-""} FEATURE_GATES=${FEATURE_GATES:-"AllAlpha=true"} +# enable swagger ui +ENABLE_SWAGGER_UI=${ENABLE_SWAGGER_UI:-false} + # RBAC Mode options ALLOW_ANY_TOKEN=${ALLOW_ANY_TOKEN:-false} ENABLE_RBAC=${ENABLE_RBAC:-false} @@ -372,6 +375,11 @@ function start_apiserver { # This is the default dir and filename where the apiserver will generate a self-signed cert # which should be able to be used as the CA to verify itself + swagger_arg="" + if [[ "${ENABLE_SWAGGER_UI}" = true ]]; then + swagger_arg="--enable-swagger-ui=true " + fi + anytoken_arg="" if [[ "${ALLOW_ANY_TOKEN}" = true ]]; then anytoken_arg="--insecure-allow-any-token " @@ -422,7 +430,7 @@ function start_apiserver { APISERVER_LOG=/tmp/kube-apiserver.log - ${CONTROLPLANE_SUDO} "${GO_OUT}/hyperkube" apiserver ${anytoken_arg} ${authorizer_arg} ${priv_arg} ${runtime_config}\ + ${CONTROLPLANE_SUDO} "${GO_OUT}/hyperkube" apiserver ${swagger_arg} ${anytoken_arg} ${authorizer_arg} ${priv_arg} ${runtime_config}\ ${advertise_address} \ --v=${LOG_LEVEL} \ --cert-dir="${CERT_DIR}" \