mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Merge pull request #552 from MSOpenTech/azure-scripts
Update salt config for apiserver to support Azure.
This commit is contained in:
commit
b87ae144ea
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -78,4 +78,3 @@ apiserver:
|
||||
- file: /etc/default/apiserver
|
||||
- file: /usr/local/bin/apiserver
|
||||
- file: /etc/init.d/apiserver
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -31,6 +31,7 @@ grains:
|
||||
roles:
|
||||
- kubernetes-pool
|
||||
cbr-cidr: $MINION_IP_RANGE
|
||||
cloud: gce
|
||||
EOF
|
||||
|
||||
# Install Salt
|
||||
|
Loading…
Reference in New Issue
Block a user