Update salt config for apiserver to support Azure.
This commit is contained in:
parent
f672edd1cf
commit
6cebe4443a
@ -22,6 +22,7 @@ cat <<EOF >/etc/salt/minion.d/grains.conf
|
|||||||
grains:
|
grains:
|
||||||
roles:
|
roles:
|
||||||
- kubernetes-master
|
- kubernetes-master
|
||||||
|
cloud: azure
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Auto accept all keys from minions that try to join
|
# Auto accept all keys from minions that try to join
|
||||||
|
@ -21,12 +21,16 @@ echo "master: $MASTER_NAME" > /etc/salt/minion.d/master.conf
|
|||||||
# Turn on debugging for salt-minion
|
# Turn on debugging for salt-minion
|
||||||
# echo "DAEMON_ARGS=\"\$DAEMON_ARGS --log-file-level=debug\"" > /etc/default/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.
|
# Our minions will have a pool role to distinguish them from the master.
|
||||||
cat <<EOF >/etc/salt/minion.d/grains.conf
|
cat <<EOF >/etc/salt/minion.d/grains.conf
|
||||||
grains:
|
grains:
|
||||||
roles:
|
roles:
|
||||||
- kubernetes-pool
|
- kubernetes-pool
|
||||||
cbr-cidr: $MINION_IP_RANGE
|
cbr-cidr: $MINION_IP_RANGE
|
||||||
|
cloud: azure
|
||||||
|
hostnamef: $hostnamef
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Install Salt
|
# Install Salt
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
{%- set ips = salt['mine.get']('roles:kubernetes-master', 'network.ip_addrs', 'grain').values() %}
|
{%- 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 not defined or grains['cloud'] != 'azure' %}
|
||||||
|
DAEMON_ARGS="$DAEMON_ARGS -minion_regexp='{{ pillar['instance_prefix'] }}.*'"
|
||||||
MACHINES="{{ ','.join(salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', expr_form='grain').keys()) }}"
|
MACHINES="{{ ','.join(salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', expr_form='grain').keys()) }}"
|
||||||
DAEMON_ARGS="$DAEMON_ARGS --machines $MACHINES"
|
{% else %}
|
||||||
|
MACHINES="{{ salt['mine.get']('roles:kubernetes-pool', 'grains.items', expr_form='grain').values()|join(',', attribute='hostnamef') }}"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
DAEMON_ARGS="$DAEMON_ARGS -machines=$MACHINES"
|
||||||
|
@ -57,6 +57,7 @@ apiserver-build:
|
|||||||
/etc/init.d/apiserver:
|
/etc/init.d/apiserver:
|
||||||
file.managed:
|
file.managed:
|
||||||
- source: salt://apiserver/initd
|
- source: salt://apiserver/initd
|
||||||
|
- template: jinja
|
||||||
- user: root
|
- user: root
|
||||||
- group: root
|
- group: root
|
||||||
- mode: 755
|
- mode: 755
|
||||||
|
@ -17,7 +17,9 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
|||||||
DESC="The Kubernetes API server"
|
DESC="The Kubernetes API server"
|
||||||
NAME=apiserver
|
NAME=apiserver
|
||||||
DAEMON=/usr/local/bin/apiserver
|
DAEMON=/usr/local/bin/apiserver
|
||||||
DAEMON_ARGS="-cloud_provider gce"
|
{% if grains['cloud'] is not defined or grains['cloud'] != 'azure' %}
|
||||||
|
DAEMON_ARGS="-cloud_provider gce"
|
||||||
|
{% endif %}
|
||||||
DAEMON_LOG_FILE=/var/log/$NAME.log
|
DAEMON_LOG_FILE=/var/log/$NAME.log
|
||||||
PIDFILE=/var/run/$NAME.pid
|
PIDFILE=/var/run/$NAME.pid
|
||||||
SCRIPTNAME=/etc/init.d/$NAME
|
SCRIPTNAME=/etc/init.d/$NAME
|
||||||
|
Loading…
Reference in New Issue
Block a user