Merge pull request #552 from MSOpenTech/azure-scripts

Update salt config for apiserver to support Azure.
This commit is contained in:
Daniel Smith 2014-07-24 12:46:53 -07:00
commit b87ae144ea
7 changed files with 15 additions and 4 deletions

View File

@ -22,6 +22,7 @@ cat <<EOF >/etc/salt/minion.d/grains.conf
grains:
roles:
- kubernetes-master
cloud: azure
EOF
# Auto accept all keys from minions that try to join

View File

@ -21,12 +21,16 @@ echo "master: $MASTER_NAME" > /etc/salt/minion.d/master.conf
# Turn on debugging for salt-minion
# echo "DAEMON_ARGS=\"\$DAEMON_ARGS --log-file-level=debug\"" > /etc/default/salt-minion
hostnamef=$(hostname -f)
# Our minions will have a pool role to distinguish them from the master.
cat <<EOF >/etc/salt/minion.d/grains.conf
grains:
roles:
- kubernetes-pool
cbr-cidr: $MINION_IP_RANGE
cloud: azure
hostnamef: $hostnamef
EOF
# Install Salt

View File

@ -1,5 +1,11 @@
{%- set ips = salt['mine.get']('roles:kubernetes-master', 'network.ip_addrs', 'grain').values() %}
DAEMON_ARGS="$DAEMON_ARGS -etcd_servers=http://{{ ips[0][0] }}:4001 -minion_regexp '{{ pillar['instance_prefix'] }}.*'"
DAEMON_ARGS="$DAEMON_ARGS -etcd_servers=http://{{ ips[0][0] }}:4001"
{% if grains['cloud'] is defined and grains['cloud'] == 'gce' %}
DAEMON_ARGS="$DAEMON_ARGS -cloud_provider=gce -minion_regexp='{{ pillar['instance_prefix'] }}.*'"
MACHINES="{{ ','.join(salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', expr_form='grain').keys()) }}"
DAEMON_ARGS="$DAEMON_ARGS --machines $MACHINES"
{% elif grains['cloud'] is defined and grains['cloud'] == 'azure' %}
MACHINES="{{ salt['mine.get']('roles:kubernetes-pool', 'grains.items', expr_form='grain').values()|join(',', attribute='hostnamef') }}"
{% endif %}
DAEMON_ARGS="$DAEMON_ARGS -machines=$MACHINES"

View File

@ -78,4 +78,3 @@ apiserver:
- file: /etc/default/apiserver
- file: /usr/local/bin/apiserver
- file: /etc/init.d/apiserver

View File

@ -17,7 +17,6 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="The Kubernetes API server"
NAME=apiserver
DAEMON=/usr/local/bin/apiserver
DAEMON_ARGS="-cloud_provider gce"
DAEMON_LOG_FILE=/var/log/$NAME.log
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

View File

@ -25,6 +25,7 @@ cat <<EOF >/etc/salt/minion.d/grains.conf
grains:
roles:
- kubernetes-master
cloud: gce
EOF
# Auto accept all keys from minions that try to join

View File

@ -31,6 +31,7 @@ grains:
roles:
- kubernetes-pool
cbr-cidr: $MINION_IP_RANGE
cloud: gce
EOF
# Install Salt