Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specify advertise-address for api-server #18489

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions cluster/centos/master/scripts/apiserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ KUBE_LOG_LEVEL="--v=4"
# comma separated. Mutually exclusive with -etcd-config
KUBE_ETCD_SERVERS="--etcd-servers=${ETCD_SERVERS}"

# --address=127.0.0.1: DEPRECATED: see --insecure-bind-address instead
KUBE_API_ADDRESS="--address=${MASTER_ADDRESS}"
# --insecure-bind-address=127.0.0.1: The IP address on which to serve the --insecure-port.
KUBE_API_ADDRESS="--insecure-bind-address=${MASTER_ADDRESS}"

# --port=8080: DEPRECATED: see --insecure-port instead
KUBE_API_PORT="--port=8080"
# --insecure-port=8080: The port on which to serve unsecured, unauthenticated access.
KUBE_API_PORT="--insecure-port=8080"

# --kubelet-port=10250: Kubelet port
NODE_PORT="--kubelet-port=10250"

# --advertise-address=<nil>: The IP address on which to advertise
# the apiserver to members of the cluster.
KUBE_ADVERTISE_ADDR="--advertise-address=${MASTER_ADDRESS}"

# --allow-privileged=false: If true, allow privileged containers.
KUBE_ALLOW_PRIV="--allow-privileged=false"

Expand Down Expand Up @@ -75,7 +79,8 @@ KUBE_APISERVER_OPTS=" \${KUBE_LOGTOSTDERR} \\
\${KUBE_ETCD_SERVERS} \\
\${KUBE_API_ADDRESS} \\
\${KUBE_API_PORT} \\
\${NODE_PORT} \\
\${NODE_PORT} \\
\${KUBE_ADVERTISE_ADDR} \\
\${KUBE_ALLOW_PRIV} \\
\${KUBE_SERVICE_ADDRESSES} \\
\${KUBE_ADMISSION_CONTROL} \\
Expand Down
13 changes: 7 additions & 6 deletions cluster/ubuntu/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ KUBE_APISERVER_OPTS="\
--service-cluster-ip-range=${1}\
--admission-control=${2}\
--service-node-port-range=${3}\
--advertise-address=${4}\
--client-ca-file=/srv/kubernetes/ca.crt\
--tls-cert-file=/srv/kubernetes/server.cert\
--tls-private-key-file=/srv/kubernetes/server.key"
Expand Down Expand Up @@ -232,14 +233,12 @@ EOF
function create-kubelet-opts() {
cat <<EOF > ~/kube/default/kubelet
KUBELET_OPTS="\
--address=0.0.0.0\
--port=10250 \
--hostname-override=${1} \
--api-servers=http://${2}:8080 \
--logtostderr=true \
--config=/etc/kubernetes/manifests \
--cluster-dns=$3 \
--cluster-domain=$4"
--cluster-dns=${3} \
--cluster-domain=${4}"
EOF

}
Expand Down Expand Up @@ -383,7 +382,8 @@ function provision-master() {
create-kube-apiserver-opts \
'${SERVICE_CLUSTER_IP_RANGE}' \
'${ADMISSION_CONTROL}' \
'${SERVICE_NODE_PORT_RANGE}'
'${SERVICE_NODE_PORT_RANGE}' \
'${MASTER_IP}'
create-kube-controller-manager-opts '${NODE_IPS}'
create-kube-scheduler-opts
create-flanneld-opts '127.0.0.1' '${MASTER_IP}'
Expand Down Expand Up @@ -487,7 +487,8 @@ function provision-masterandnode() {
create-kube-apiserver-opts \
'${SERVICE_CLUSTER_IP_RANGE}' \
'${ADMISSION_CONTROL}' \
'${SERVICE_NODE_PORT_RANGE}'
'${SERVICE_NODE_PORT_RANGE}' \
'${MASTER_IP}'
create-kube-controller-manager-opts '${NODE_IPS}'
create-kube-scheduler-opts
create-kubelet-opts \
Expand Down