Skip to content

Commit

Permalink
Merge pull request kubernetes#19642 from MikeSpreitzer/issue/19618
Browse files Browse the repository at this point in the history
Introduce FLANNEL_OTHER_NET_CONFIG
  • Loading branch information
brendandburns committed Jan 27, 2016
2 parents 2667781 + d4ab966 commit 4f845ad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions cluster/ubuntu/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ export SERVICE_CLUSTER_IP_RANGE=${SERVICE_CLUSTER_IP_RANGE:-192.168.3.0/24} # f
# define the IP range used for flannel overlay network, should not conflict with above SERVICE_CLUSTER_IP_RANGE
export FLANNEL_NET=${FLANNEL_NET:-172.16.0.0/16}

# Optionally add other contents to the Flannel configuration JSON
# object normally stored in etcd as /coreos.com/network/config. Use
# JSON syntax suitable for insertion into a JSON object constructor
# after other field name:value pairs. For example:
# FLANNEL_OTHER_NET_CONFIG=', "SubnetMin": "172.16.10.0", "SubnetMax": "172.16.90.0"'

export FLANNEL_OTHER_NET_CONFIG
FLANNEL_OTHER_NET_CONFIG=''

# Admission Controllers to invoke prior to persisting objects in cluster
export ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota,SecurityContextDeny

Expand Down
2 changes: 1 addition & 1 deletion cluster/ubuntu/reconfDocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function config_etcd {
exit 2
fi

/opt/bin/etcdctl mk /coreos.com/network/config "{\"Network\":\"${FLANNEL_NET}\", \"Backend\": {\"Type\": \"vxlan\"}}"
/opt/bin/etcdctl mk /coreos.com/network/config "{\"Network\":\"${FLANNEL_NET}\", \"Backend\": {\"Type\": \"vxlan\"}${FLANNEL_OTHER_NET_CONFIG}}"
attempt=$((attempt+1))
sleep 3
fi
Expand Down
4 changes: 2 additions & 2 deletions cluster/ubuntu/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function provision-master() {
create-kube-controller-manager-opts '${NODE_IPS}'
create-kube-scheduler-opts
create-flanneld-opts '127.0.0.1' '${MASTER_IP}'
sudo -E -p '[sudo] password to start master: ' -- /bin/bash -ce '
FLANNEL_OTHER_NET_CONFIG='${FLANNEL_OTHER_NET_CONFIG}' sudo -E -p '[sudo] password to start master: ' -- /bin/bash -ce '
${BASH_DEBUG_FLAGS}
cp ~/kube/default/* /etc/default/
Expand Down Expand Up @@ -529,7 +529,7 @@ function provision-masterandnode() {
'${MASTER_IP}'
create-flanneld-opts '127.0.0.1' '${MASTER_IP}'
sudo -E -p '[sudo] password to start master: ' -- /bin/bash -ce '
FLANNEL_OTHER_NET_CONFIG='${FLANNEL_OTHER_NET_CONFIG}' sudo -E -p '[sudo] password to start master: ' -- /bin/bash -ce '
${BASH_DEBUG_FLAGS}
cp ~/kube/default/* /etc/default/
cp ~/kube/init_conf/* /etc/init/
Expand Down
2 changes: 2 additions & 0 deletions docs/getting-started-guides/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ that conflicts with your own private network range.

The `FLANNEL_NET` variable defines the IP range used for flannel overlay network,
should not conflict with above `SERVICE_CLUSTER_IP_RANGE`.
You can optionally provide additional Flannel network configuration
through `FLANNEL_OTHER_NET_CONFIG`, as explained in `cluster/ubuntu/config-default.sh`.

**Note:** When deploying, master needs to be connected to the Internet to download the necessary files.
If your machines are located in a private network that need proxy setting to connect the Internet,
Expand Down

0 comments on commit 4f845ad

Please sign in to comment.