Skip to content

Commit

Permalink
Minion->Node rename: KUBERNETES_NODE_MEMORY, VAGRANT_NODE_NAMES, etc
Browse files Browse the repository at this point in the history
ENABLE_NODE_PUBLIC_IP
NODE_ADDRESS
NODE_BLOCK_DEVICE_MAPPINGS
NODE_CONTAINER_ADDRS
NODE_CONTAINER_NETMASKS
NODE_CONTAINER_SUBNET_BASE
NODE_CONTAINER_SUBNETS
NODE_CPU
  • Loading branch information
13rac1 committed Nov 25, 2015
1 parent ae314ad commit a36d339
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ end
# When doing Salt provisioning, we copy approximately 200MB of content in /tmp before anything else happens.
# This causes problems if anything else was in /tmp or the other directories that are bound to tmpfs device (i.e /run, etc.)
$vm_master_mem = (ENV['KUBERNETES_MASTER_MEMORY'] || ENV['KUBERNETES_MEMORY'] || 1280).to_i
$vm_minion_mem = (ENV['KUBERNETES_MINION_MEMORY'] || ENV['KUBERNETES_MEMORY'] || 1024).to_i
$vm_minion_mem = (ENV['KUBERNETES_NODE_MEMORY'] || ENV['KUBERNETES_MEMORY'] || 1024).to_i

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
def setvmboxandurl(config, provider)
Expand Down
2 changes: 1 addition & 1 deletion cluster/aws/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAcco

# Optional: Enable/disable public IP assignment for minions.
# Important Note: disable only if you have setup a NAT instance for internet access and configured appropriate routes!
ENABLE_MINION_PUBLIC_IP=${KUBE_ENABLE_NODE_PUBLIC_IP:-true}
ENABLE_NODE_PUBLIC_IP=${KUBE_ENABLE_NODE_PUBLIC_IP:-true}

# OS options for minions
KUBE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION:-vivid}"
Expand Down
2 changes: 1 addition & 1 deletion cluster/aws/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAcco

# Optional: Enable/disable public IP assignment for minions.
# Important Note: disable only if you have setup a NAT instance for internet access and configured appropriate routes!
ENABLE_MINION_PUBLIC_IP=${KUBE_ENABLE_NODE_PUBLIC_IP:-true}
ENABLE_NODE_PUBLIC_IP=${KUBE_ENABLE_NODE_PUBLIC_IP:-true}

# OS options for minions
KUBE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION:-vivid}"
Expand Down
8 changes: 4 additions & 4 deletions cluster/aws/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ MINION_SG_NAME="kubernetes-minion-${CLUSTER_ID}"
# only affects the big storage instance types, which aren't a typical use case right now.
BLOCK_DEVICE_MAPPINGS_BASE="{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral0\"},{\"DeviceName\": \"/dev/sdd\",\"VirtualName\":\"ephemeral1\"},{\"DeviceName\": \"/dev/sde\",\"VirtualName\":\"ephemeral2\"},{\"DeviceName\": \"/dev/sdf\",\"VirtualName\":\"ephemeral3\"}"
MASTER_BLOCK_DEVICE_MAPPINGS="[{\"DeviceName\":\"/dev/sda1\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":${MASTER_ROOT_DISK_SIZE},\"VolumeType\":\"${MASTER_ROOT_DISK_TYPE}\"}}, ${BLOCK_DEVICE_MAPPINGS_BASE}]"
MINION_BLOCK_DEVICE_MAPPINGS="[{\"DeviceName\":\"/dev/sda1\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":${MINION_ROOT_DISK_SIZE},\"VolumeType\":\"${MINION_ROOT_DISK_TYPE}\"}}, ${BLOCK_DEVICE_MAPPINGS_BASE}]"
NODE_BLOCK_DEVICE_MAPPINGS="[{\"DeviceName\":\"/dev/sda1\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":${MINION_ROOT_DISK_SIZE},\"VolumeType\":\"${MINION_ROOT_DISK_TYPE}\"}}, ${BLOCK_DEVICE_MAPPINGS_BASE}]"

# TODO (bburns) Parameterize this for multiple cluster per project

Expand Down Expand Up @@ -203,7 +203,7 @@ function detect-minions () {
KUBE_NODE_IP_ADDRESSES=()
for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
local minion_ip
if [[ "${ENABLE_MINION_PUBLIC_IP}" == "true" ]]; then
if [[ "${ENABLE_NODE_PUBLIC_IP}" == "true" ]]; then
minion_ip=$(get_instance_public_ip ${MINION_NAMES[$i]})
else
minion_ip=$(get_instance_private_ip ${MINION_NAMES[$i]})
Expand Down Expand Up @@ -990,7 +990,7 @@ function start-minions() {
echo "Creating minion configuration"
generate-minion-user-data > "${KUBE_TEMP}/minion-user-data"
local public_ip_option
if [[ "${ENABLE_MINION_PUBLIC_IP}" == "true" ]]; then
if [[ "${ENABLE_NODE_PUBLIC_IP}" == "true" ]]; then
public_ip_option="--associate-public-ip-address"
else
public_ip_option="--no-associate-public-ip-address"
Expand All @@ -1003,7 +1003,7 @@ function start-minions() {
--key-name ${AWS_SSH_KEY_NAME} \
--security-groups ${MINION_SG_ID} \
${public_ip_option} \
--block-device-mappings "${MINION_BLOCK_DEVICE_MAPPINGS}" \
--block-device-mappings "${NODE_BLOCK_DEVICE_MAPPINGS}" \
--user-data "file://${KUBE_TEMP}/minion-user-data"

echo "Creating autoscaling group"
Expand Down
4 changes: 2 additions & 2 deletions cluster/centos/node/scripts/kubelet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ KUBE_LOGTOSTDERR="--logtostderr=true"
KUBE_LOG_LEVEL="--v=4"
# --address=0.0.0.0: The IP address for the Kubelet to serve on (set to 0.0.0.0 for all interfaces)
MINION_ADDRESS="--address=${NODE_ADDRESS}"
NODE_ADDRESS="--address=${NODE_ADDRESS}"
# --port=10250: The port for the Kubelet to serve on. Note that "kubectl logs" will not work if you set this flag.
MINION_PORT="--port=10250"
Expand All @@ -48,7 +48,7 @@ EOF

KUBE_PROXY_OPTS=" \${KUBE_LOGTOSTDERR} \\
\${KUBE_LOG_LEVEL} \\
\${MINION_ADDRESS} \\
\${NODE_ADDRESS} \\
\${MINION_PORT} \\
\${MINION_HOSTNAME} \\
\${KUBELET_API_SERVER} \\
Expand Down
16 changes: 8 additions & 8 deletions cluster/vagrant/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-false}

# Map out the IPs, names and container subnets of each minion
export MINION_IP_BASE=${MINION_IP_BASE-"10.245.1."}
MINION_CONTAINER_SUBNET_BASE="10.246"
NODE_CONTAINER_SUBNET_BASE="10.246"
MASTER_CONTAINER_NETMASK="255.255.255.0"
MASTER_CONTAINER_ADDR="${MINION_CONTAINER_SUBNET_BASE}.0.1"
MASTER_CONTAINER_SUBNET="${MINION_CONTAINER_SUBNET_BASE}.0.1/24"
CONTAINER_SUBNET="${MINION_CONTAINER_SUBNET_BASE}.0.0/16"
MASTER_CONTAINER_ADDR="${NODE_CONTAINER_SUBNET_BASE}.0.1"
MASTER_CONTAINER_SUBNET="${NODE_CONTAINER_SUBNET_BASE}.0.1/24"
CONTAINER_SUBNET="${NODE_CONTAINER_SUBNET_BASE}.0.0/16"
for ((i=0; i < NUM_MINIONS; i++)) do
MINION_IPS[$i]="${MINION_IP_BASE}$((i+3))"
MINION_NAMES[$i]="${INSTANCE_PREFIX}-minion-$((i+1))"
MINION_CONTAINER_SUBNETS[$i]="${MINION_CONTAINER_SUBNET_BASE}.$((i+1)).1/24"
MINION_CONTAINER_ADDRS[$i]="${MINION_CONTAINER_SUBNET_BASE}.$((i+1)).1"
MINION_CONTAINER_NETMASKS[$i]="255.255.255.0"
VAGRANT_MINION_NAMES[$i]="minion-$((i+1))"
NODE_CONTAINER_SUBNETS[$i]="${NODE_CONTAINER_SUBNET_BASE}.$((i+1)).1/24"
NODE_CONTAINER_ADDRS[$i]="${NODE_CONTAINER_SUBNET_BASE}.$((i+1)).1"
NODE_CONTAINER_NETMASKS[$i]="255.255.255.0"
VAGRANT_NODE_NAMES[$i]="minion-$((i+1))"
done

SERVICE_CLUSTER_IP_RANGE=10.247.0.0/16 # formerly PORTAL_NET
Expand Down
14 changes: 7 additions & 7 deletions cluster/vagrant/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ function create-provision-scripts {
echo "CONTAINER_NETMASK='${MASTER_CONTAINER_NETMASK}'"
echo "MASTER_CONTAINER_SUBNET='${MASTER_CONTAINER_SUBNET}'"
echo "CONTAINER_ADDR='${MASTER_CONTAINER_ADDR}'"
echo "MINION_CONTAINER_NETMASKS='${MINION_CONTAINER_NETMASKS[@]}'"
echo "MINION_CONTAINER_SUBNETS=(${MINION_CONTAINER_SUBNETS[@]})"
echo "NODE_CONTAINER_NETMASKS='${NODE_CONTAINER_NETMASKS[@]}'"
echo "NODE_CONTAINER_SUBNETS=(${NODE_CONTAINER_SUBNETS[@]})"
echo "SERVICE_CLUSTER_IP_RANGE='${SERVICE_CLUSTER_IP_RANGE}'"
echo "MASTER_USER='${MASTER_USER}'"
echo "MASTER_PASSWD='${MASTER_PASSWD}'"
Expand Down Expand Up @@ -175,9 +175,9 @@ function create-provision-scripts {
echo "MINION_ID='$i'"
echo "NODE_IP='${MINION_IPS[$i]}'"
echo "MASTER_CONTAINER_SUBNET='${MASTER_CONTAINER_SUBNET}'"
echo "CONTAINER_ADDR='${MINION_CONTAINER_ADDRS[$i]}'"
echo "CONTAINER_NETMASK='${MINION_CONTAINER_NETMASKS[$i]}'"
echo "MINION_CONTAINER_SUBNETS=(${MINION_CONTAINER_SUBNETS[@]})"
echo "CONTAINER_ADDR='${NODE_CONTAINER_ADDRS[$i]}'"
echo "CONTAINER_NETMASK='${NODE_CONTAINER_NETMASKS[$i]}'"
echo "NODE_CONTAINER_SUBNETS=(${NODE_CONTAINER_SUBNETS[@]})"
echo "CONTAINER_SUBNET='${CONTAINER_SUBNET}'"
echo "DOCKER_OPTS='${EXTRA_DOCKER_OPTS:-}'"
echo "VAGRANT_DEFAULT_PROVIDER='${VAGRANT_DEFAULT_PROVIDER:-}'"
Expand Down Expand Up @@ -223,8 +223,8 @@ function verify-cluster {
# verify each minion has all required daemons
local i
for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
echo "Validating ${VAGRANT_MINION_NAMES[$i]}"
local machine=${VAGRANT_MINION_NAMES[$i]}
echo "Validating ${VAGRANT_NODE_NAMES[$i]}"
local machine=${VAGRANT_NODE_NAMES[$i]}
local -a required_daemon=("salt-minion" "kubelet" "docker")
local validated="1"
until [[ "$validated" == "0" ]]; do
Expand Down
2 changes: 1 addition & 1 deletion cluster/vsphere/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MASTER_CPU=1
MINION_NAMES=($(eval echo ${INSTANCE_PREFIX}-minion-{1..${NUM_MINIONS}}))
MINION_IP_RANGES=($(eval echo "10.244.{1..${NUM_MINIONS}}.0/24"))
MINION_MEMORY_MB=2048
MINION_CPU=1
NODE_CPU=1

SERVICE_CLUSTER_IP_RANGE="10.244.240.0/20" # formerly PORTAL_NET

Expand Down
2 changes: 1 addition & 1 deletion cluster/vsphere/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MASTER_CPU=1
MINION_NAMES=($(eval echo ${INSTANCE_PREFIX}-minion-{1..${NUM_MINIONS}}))
MINION_IP_RANGES=($(eval echo "10.244.{1..${NUM_MINIONS}}.0/24"))
MINION_MEMORY_MB=1024
MINION_CPU=1
NODE_CPU=1

SERVICE_CLUSTER_IP_RANGE="10.244.240.0/20" # formerly PORTAL_NET

Expand Down
2 changes: 1 addition & 1 deletion cluster/vsphere/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function kube-up {
) > "${KUBE_TEMP}/minion-start-${i}.sh"

(
kube-up-vm "${MINION_NAMES[$i]}" -c ${MINION_CPU-1} -m ${MINION_MEMORY_MB-1024}
kube-up-vm "${MINION_NAMES[$i]}" -c ${NODE_CPU-1} -m ${MINION_MEMORY_MB-1024}
kube-run "${MINION_NAMES[$i]}" "${KUBE_TEMP}/minion-start-${i}.sh"
) &
done
Expand Down
2 changes: 1 addition & 1 deletion docs/devel/developer-guides/vagrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ If you need more granular control, you can set the amount of memory for the mast

```sh
export KUBERNETES_MASTER_MEMORY=1536
export KUBERNETES_MINION_MEMORY=2048
export KUBERNETES_NODE_MEMORY=2048
```

#### I ran vagrant suspend and nothing works!
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/vagrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ If you need more granular control, you can set the amount of memory for the mast
```sh
export KUBERNETES_MASTER_MEMORY=1536
export KUBERNETES_MINION_MEMORY=2048
export KUBERNETES_NODE_MEMORY=2048
```
#### I ran vagrant suspend and nothing works!
Expand Down

0 comments on commit a36d339

Please sign in to comment.