mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #41526 from xilabao/add-swagger-ui-option
Automatic merge from submit-queue (batch tested with PRs 41756, 36344, 34259, 40843, 41526) add swagger ui in local cluster use `ENABLE_SWAGGER_UI=true hack/local-up-cluster.sh`
This commit is contained in:
commit
caa9bd137b
@ -65,6 +65,9 @@ CLOUD_PROVIDER=${CLOUD_PROVIDER:-""}
|
|||||||
CLOUD_CONFIG=${CLOUD_CONFIG:-""}
|
CLOUD_CONFIG=${CLOUD_CONFIG:-""}
|
||||||
FEATURE_GATES=${FEATURE_GATES:-"AllAlpha=true"}
|
FEATURE_GATES=${FEATURE_GATES:-"AllAlpha=true"}
|
||||||
|
|
||||||
|
# enable swagger ui
|
||||||
|
ENABLE_SWAGGER_UI=${ENABLE_SWAGGER_UI:-false}
|
||||||
|
|
||||||
# RBAC Mode options
|
# RBAC Mode options
|
||||||
ALLOW_ANY_TOKEN=${ALLOW_ANY_TOKEN:-false}
|
ALLOW_ANY_TOKEN=${ALLOW_ANY_TOKEN:-false}
|
||||||
ENABLE_RBAC=${ENABLE_RBAC:-false}
|
ENABLE_RBAC=${ENABLE_RBAC:-false}
|
||||||
@ -376,6 +379,11 @@ function start_apiserver {
|
|||||||
# This is the default dir and filename where the apiserver will generate a self-signed cert
|
# 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
|
# 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=""
|
anytoken_arg=""
|
||||||
if [[ "${ALLOW_ANY_TOKEN}" = true ]]; then
|
if [[ "${ALLOW_ANY_TOKEN}" = true ]]; then
|
||||||
anytoken_arg="--insecure-allow-any-token "
|
anytoken_arg="--insecure-allow-any-token "
|
||||||
@ -426,7 +434,7 @@ function start_apiserver {
|
|||||||
|
|
||||||
|
|
||||||
APISERVER_LOG=/tmp/kube-apiserver.log
|
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} \
|
${advertise_address} \
|
||||||
--v=${LOG_LEVEL} \
|
--v=${LOG_LEVEL} \
|
||||||
--cert-dir="${CERT_DIR}" \
|
--cert-dir="${CERT_DIR}" \
|
||||||
|
Loading…
Reference in New Issue
Block a user