Add new apiserver flags for clusterIP (nee portal)

Leave old flags but marked as deprecated
pull/6/head
Tim Hockin 2015-05-23 21:59:46 -07:00
parent 4318ca5a8b
commit 3005471100
24 changed files with 31 additions and 28 deletions

View File

@ -23,7 +23,7 @@
"command": [ "command": [
"/hyperkube", "/hyperkube",
"apiserver", "apiserver",
"--portal_net=10.0.0.1/24", "--service-cluster-ip-range=10.0.0.1/24",
"--address=0.0.0.0", "--address=0.0.0.0",
"--etcd_servers=http://127.0.0.1:4001", "--etcd_servers=http://127.0.0.1:4001",
"--cluster_name=kubernetes", "--cluster_name=kubernetes",

View File

@ -23,7 +23,7 @@
"command": [ "command": [
"/hyperkube", "/hyperkube",
"apiserver", "apiserver",
"--portal_net=10.0.0.1/24", "--service-cluster-ip-range=10.0.0.1/24",
"--address=127.0.0.1", "--address=127.0.0.1",
"--etcd_servers=http://127.0.0.1:4001", "--etcd_servers=http://127.0.0.1:4001",
"--cluster_name=kubernetes", "--cluster_name=kubernetes",

View File

@ -11,7 +11,7 @@ exec /usr/local/bin/apiserver \
--address=%(api_bind_address)s \ --address=%(api_bind_address)s \
--etcd_servers=%(etcd_servers)s \ --etcd_servers=%(etcd_servers)s \
--logtostderr=true \ --logtostderr=true \
--portal_net=10.244.240.0/20 --service-cluster-ip-range=10.244.240.0/20

View File

@ -18,7 +18,7 @@ coreos:
--port=8080 \ --port=8080 \
--etcd_servers=http://127.0.0.1:4001 \ --etcd_servers=http://127.0.0.1:4001 \
--kubelet_port=10250 \ --kubelet_port=10250 \
--portal_net=${PORTAL_NET} --service-cluster-ip-range=${PORTAL_NET}
Restart=always Restart=always
RestartSec=2 RestartSec=2

View File

@ -93,7 +93,7 @@ coreos:
--etcd_servers=http://127.0.0.1:4001 \ --etcd_servers=http://127.0.0.1:4001 \
--logtostderr=true \ --logtostderr=true \
--port=8080 \ --port=8080 \
--portal_net=PORTAL_NET \ --service-cluster-ip-range=PORTAL_NET \
--token-auth-file=/var/lib/kube-apiserver/known_tokens.csv \ --token-auth-file=/var/lib/kube-apiserver/known_tokens.csv \
--v=2 --v=2
Restart=always Restart=always

View File

@ -38,7 +38,7 @@
{% set portal_net = "" -%} {% set portal_net = "" -%}
{% if pillar['portal_net'] is defined -%} {% if pillar['portal_net'] is defined -%}
{% set portal_net = "--portal_net=" + pillar['portal_net'] -%} {% set portal_net = "--service-cluster-ip-range=" + pillar['portal_net'] -%}
{% endif -%} {% endif -%}
{% set cert_file = "--tls_cert_file=/srv/kubernetes/server.cert" -%} {% set cert_file = "--tls_cert_file=/srv/kubernetes/server.cert" -%}

View File

@ -210,7 +210,7 @@ KUBE_APISERVER_OPTS="--address=0.0.0.0 \
--port=8080 \ --port=8080 \
--etcd_servers=http://127.0.0.1:4001 \ --etcd_servers=http://127.0.0.1:4001 \
--logtostderr=true \ --logtostderr=true \
--portal_net=${1}" --service-cluster-ip-range=${1}"
EOF EOF
} }

View File

@ -183,9 +183,12 @@ func (s *APIServer) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.OldEtcdPathPrefix, "old-etcd-prefix", s.OldEtcdPathPrefix, "The previous prefix for all resource paths in etcd, if any.") fs.StringVar(&s.OldEtcdPathPrefix, "old-etcd-prefix", s.OldEtcdPathPrefix, "The previous prefix for all resource paths in etcd, if any.")
fs.Var(&s.CorsAllowedOriginList, "cors-allowed-origins", "List of allowed origins for CORS, comma separated. An allowed origin can be a regular expression to support subdomain matching. If this list is empty CORS will not be enabled.") fs.Var(&s.CorsAllowedOriginList, "cors-allowed-origins", "List of allowed origins for CORS, comma separated. An allowed origin can be a regular expression to support subdomain matching. If this list is empty CORS will not be enabled.")
fs.BoolVar(&s.AllowPrivileged, "allow-privileged", s.AllowPrivileged, "If true, allow privileged containers.") fs.BoolVar(&s.AllowPrivileged, "allow-privileged", s.AllowPrivileged, "If true, allow privileged containers.")
fs.Var(&s.ServiceClusterIPRange, "portal-net", "A CIDR notation IP range from which to assign portal IPs. This must not overlap with any IP ranges assigned to nodes for pods.") fs.Var(&s.ServiceClusterIPRange, "service-cluster-ip-range", "A CIDR notation IP range from which to assign service cluster IPs. This must not overlap with any IP ranges assigned to nodes for pods.")
fs.Var(&s.ServiceNodePortRange, "service-node-ports", "A port range to reserve for services with NodePort visibility. Example: '30000-32767'. Inclusive at both ends of the range.") fs.Var(&s.ServiceClusterIPRange, "portal-net", "Deprecated: see --service-cluster-ip-range instead.")
fs.MarkDeprecated("portal-net", "see --service-cluster-ip-range instead.")
fs.Var(&s.ServiceNodePortRange, "service-node-port-range", "A port range to reserve for services with NodePort visibility. Example: '30000-32767'. Inclusive at both ends of the range.")
fs.Var(&s.ServiceNodePortRange, "service-node-ports", "Deprecated: see --service-node-port-range instead.")
fs.MarkDeprecated("service-node-ports", "see --service-node-port-range instead.")
fs.StringVar(&s.MasterServiceNamespace, "master-service-namespace", s.MasterServiceNamespace, "The namespace from which the kubernetes master services should be injected into pods") fs.StringVar(&s.MasterServiceNamespace, "master-service-namespace", s.MasterServiceNamespace, "The namespace from which the kubernetes master services should be injected into pods")
fs.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to the apiserver. api/<version> key can be used to turn on/off specific api versions. api/all and api/legacy are special keys to control all and legacy api versions respectively.") fs.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to the apiserver. api/<version> key can be used to turn on/off specific api versions. api/all and api/legacy are special keys to control all and legacy api versions respectively.")
client.BindKubeletClientConfigFlags(fs, &s.KubeletConfig) client.BindKubeletClientConfigFlags(fs, &s.KubeletConfig)

View File

@ -14,7 +14,7 @@ KUBE_API_ADDRESS="--address=0.0.0.0"
# KUBELET_PORT="--kubelet_port=10250" # KUBELET_PORT="--kubelet_port=10250"
# Address range to use for services # Address range to use for services
KUBE_SERVICE_ADDRESSES="--portal_net={{ kube_service_addresses }}" KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range={{ kube_service_addresses }}"
# Location of the etcd cluster # Location of the etcd cluster
KUBE_ETCD_SERVERS="--etcd_servers=http://{{ groups['etcd'][0] }}:2379" KUBE_ETCD_SERVERS="--etcd_servers=http://{{ groups['etcd'][0] }}:2379"

View File

@ -17,7 +17,7 @@ KUBE_API_ADDRESS="--address=127.0.0.1"
KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001" KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001"
# Address range to use for services # Address range to use for services
KUBE_SERVICE_ADDRESSES="--portal_net=10.254.0.0/16" KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# default admission control policies # default admission control policies
KUBE_ADMISSION_CONTROL="--admission_control=NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota" KUBE_ADMISSION_CONTROL="--admission_control=NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"

View File

@ -118,7 +118,7 @@ coreos:
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
ExecStart=/opt/bin/kube-apiserver \ ExecStart=/opt/bin/kube-apiserver \
--insecure-bind-address=0.0.0.0 \ --insecure-bind-address=0.0.0.0 \
--portal-net=10.100.0.0/16 \ --service-cluster-ip-range=10.100.0.0/16 \
--etcd-servers=http://localhost:2379 --etcd-servers=http://localhost:2379
Restart=always Restart=always
RestartSec=10 RestartSec=10

View File

@ -260,7 +260,7 @@
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver\n", " ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver\n",
" ExecStart=/opt/bin/kube-apiserver \\\n", " ExecStart=/opt/bin/kube-apiserver \\\n",
" --insecure-bind-address=0.0.0.0 \\\n", " --insecure-bind-address=0.0.0.0 \\\n",
" --portal-net=10.100.0.0/16 \\\n", " --service-cluster-ip-range=10.100.0.0/16 \\\n",
" --etcd-servers=http://localhost:2379\n", " --etcd-servers=http://localhost:2379\n",
" Restart=always\n", " Restart=always\n",
" RestartSec=10\n", " RestartSec=10\n",

View File

@ -97,7 +97,7 @@ KUBE_MASTER="--master=http://centos-master:8080"
KUBELET_PORT="--kubelet_port=10250" KUBELET_PORT="--kubelet_port=10250"
# Address range to use for services # Address range to use for services
KUBE_SERVICE_ADDRESSES="--portal_net=10.254.0.0/16" KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# Add your own! # Add your own!
KUBE_API_ARGS="" KUBE_API_ARGS=""

View File

@ -273,7 +273,7 @@ coreos:
--address=0.0.0.0 \ --address=0.0.0.0 \
--port=8080 \ --port=8080 \
$ETCD_SERVERS \ $ETCD_SERVERS \
--portal_net=10.1.0.0/16 \ --service-cluster-ip-range=10.1.0.0/16 \
--cloud_provider=vagrant \ --cloud_provider=vagrant \
--logtostderr=true --v=3 --logtostderr=true --v=3
Restart=always Restart=always

View File

@ -363,7 +363,7 @@ On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe-
ExecStart=/opt/bin/kube-apiserver \ ExecStart=/opt/bin/kube-apiserver \
--address=0.0.0.0 \ --address=0.0.0.0 \
--port=8080 \ --port=8080 \
--portal_net=10.100.0.0/16 \ --service-cluster-ip-range=10.100.0.0/16 \
--etcd_servers=http://127.0.0.1:4001 \ --etcd_servers=http://127.0.0.1:4001 \
--logtostderr=true --logtostderr=true
Restart=always Restart=always

View File

@ -116,7 +116,7 @@ coreos:
--insecure_port=8080 \ --insecure_port=8080 \
--kubelet_https=true \ --kubelet_https=true \
--secure_port=6443 \ --secure_port=6443 \
--portal_net=10.100.0.0/16 \ --service-cluster-ip-range=10.100.0.0/16 \
--etcd_servers=http://127.0.0.1:4001 \ --etcd_servers=http://127.0.0.1:4001 \
--public_address_override=${DEFAULT_IPV4} \ --public_address_override=${DEFAULT_IPV4} \
--logtostderr=true --logtostderr=true

View File

@ -84,7 +84,7 @@ coreos:
--insecure_port=8080 \ --insecure_port=8080 \
--kubelet_https=true \ --kubelet_https=true \
--secure_port=6443 \ --secure_port=6443 \
--portal_net=10.100.0.0/16 \ --service-cluster-ip-range=10.100.0.0/16 \
--etcd_servers=http://127.0.0.1:4001 \ --etcd_servers=http://127.0.0.1:4001 \
--public_address_override=127.0.0.1 \ --public_address_override=127.0.0.1 \
--logtostderr=true --logtostderr=true

View File

@ -71,7 +71,7 @@ KUBE_API_ADDRESS="--address=0.0.0.0"
KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001" KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001"
# Address range to use for services # Address range to use for services
KUBE_SERVICE_ADDRESSES="--portal_net=10.254.0.0/16" KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# Add your own! # Add your own!
KUBE_API_ARGS="" KUBE_API_ARGS=""

View File

@ -69,7 +69,7 @@ $ ./bin/km apiserver \
--address=${servicehost} \ --address=${servicehost} \
--mesos_master=${mesos_master} \ --mesos_master=${mesos_master} \
--etcd_servers=http://${servicehost}:4001 \ --etcd_servers=http://${servicehost}:4001 \
--portal_net=10.10.10.0/24 \ --service-cluster-ip-range=10.10.10.0/24 \
--port=8888 \ --port=8888 \
--cloud_provider=mesos \ --cloud_provider=mesos \
--v=1 >apiserver.log 2>&1 & --v=1 >apiserver.log 2>&1 &

View File

@ -134,7 +134,7 @@ The the kube-apiserver several options.
**--port**=8080 **--port**=8080
DEPRECATED: see --insecure-port instead DEPRECATED: see --insecure-port instead
**--portal-net**=<nil> **--service-cluster-ip-range**=<nil>
A CIDR notation IP range from which to assign service cluster IPs. This must not overlap with any IP ranges assigned to nodes for pods. A CIDR notation IP range from which to assign service cluster IPs. This must not overlap with any IP ranges assigned to nodes for pods.
**--profiling**=true **--profiling**=true
@ -184,7 +184,7 @@ The the kube-apiserver several options.
# EXAMPLES # EXAMPLES
``` ```
/usr/bin/kube-apiserver --logtostderr=true --v=0 --etcd_servers=http://127.0.0.1:4001 --insecure_bind_address=127.0.0.1 --insecure_port=8080 --kubelet_port=10250 --portal_net=11.1.1.0/24 --allow_privileged=false /usr/bin/kube-apiserver --logtostderr=true --v=0 --etcd_servers=http://127.0.0.1:4001 --insecure_bind_address=127.0.0.1 --insecure_port=8080 --kubelet_port=10250 --service-cluster-ip-range=10.1.1.0/24 --allow_privileged=false
``` ```
# HISTORY # HISTORY

View File

@ -166,7 +166,7 @@ sudo -E "${GO_OUT}/kube-apiserver" \
--port="${API_PORT}" \ --port="${API_PORT}" \
--runtime_config=api/v1beta3 \ --runtime_config=api/v1beta3 \
--etcd_servers="http://127.0.0.1:4001" \ --etcd_servers="http://127.0.0.1:4001" \
--portal_net="10.0.0.0/24" \ --service-cluster-ip-range="10.0.0.0/24" \
--cors_allowed_origins="${API_CORS_ALLOWED_ORIGINS}" >"${APISERVER_LOG}" 2>&1 & --cors_allowed_origins="${API_CORS_ALLOWED_ORIGINS}" >"${APISERVER_LOG}" 2>&1 &
APISERVER_PID=$! APISERVER_PID=$!

View File

@ -94,7 +94,7 @@ kube::log::status "Starting kube-apiserver"
--kubelet_port=${KUBELET_PORT} \ --kubelet_port=${KUBELET_PORT} \
--runtime_config=api/v1beta3 \ --runtime_config=api/v1beta3 \
--cert_dir="${TMPDIR:-/tmp/}" \ --cert_dir="${TMPDIR:-/tmp/}" \
--portal_net="10.0.0.0/24" 1>&2 & --service-cluster-ip-range="10.0.0.0/24" 1>&2 &
APISERVER_PID=$! APISERVER_PID=$!
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: " kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: "

View File

@ -53,7 +53,7 @@ function startApiServer() {
--kubelet_port=${KUBELET_PORT} \ --kubelet_port=${KUBELET_PORT} \
--runtime_config="${RUNTIME_CONFIG}" \ --runtime_config="${RUNTIME_CONFIG}" \
--cert_dir="${TMPDIR:-/tmp/}" \ --cert_dir="${TMPDIR:-/tmp/}" \
--portal_net="10.0.0.0/24" 1>&2 & --service-cluster-ip-range="10.0.0.0/24" 1>&2 &
APISERVER_PID=$! APISERVER_PID=$!
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: " kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: "

View File

@ -54,7 +54,7 @@ kube::log::status "Starting kube-apiserver"
--public_address_override="127.0.0.1" \ --public_address_override="127.0.0.1" \
--kubelet_port=${KUBELET_PORT} \ --kubelet_port=${KUBELET_PORT} \
--runtime_config=api/v1beta3 \ --runtime_config=api/v1beta3 \
--portal_net="10.0.0.0/24" 1>&2 & --service-cluster-ip-range="10.0.0.0/24" 1>&2 &
APISERVER_PID=$! APISERVER_PID=$!
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: " kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver: "