mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 19:21:37 +00:00
Merge pull request #1133 from jwforres/enable_cors
Add option to enable a simple CORS implementation for the api server
This commit is contained in:
@@ -39,6 +39,8 @@ set +e
|
||||
|
||||
API_PORT=${API_PORT:-8080}
|
||||
API_HOST=${API_HOST:-127.0.0.1}
|
||||
# By default only allow CORS for requests on localhost
|
||||
API_CORS_ALLOWED_ORIGINS=${API_CORS_ALLOWED_ORIGINS:-127.0.0.1:.*,localhost:.*}
|
||||
KUBELET_PORT=${KUBELET_PORT:-10250}
|
||||
|
||||
GO_OUT=$(dirname $0)/../_output/go/bin
|
||||
@@ -48,7 +50,8 @@ APISERVER_LOG=/tmp/apiserver.log
|
||||
--address="${API_HOST}" \
|
||||
--port="${API_PORT}" \
|
||||
--etcd_servers="http://127.0.0.1:4001" \
|
||||
--machines="127.0.0.1" >"${APISERVER_LOG}" 2>&1 &
|
||||
--machines="127.0.0.1" \
|
||||
--cors_allowed_origins="${API_CORS_ALLOWED_ORIGINS}" >"${APISERVER_LOG}" 2>&1 &
|
||||
APISERVER_PID=$!
|
||||
|
||||
CTLRMGR_LOG=/tmp/controller-manager.log
|
||||
|
Reference in New Issue
Block a user