mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Add gce grain to salt config, change apiserver salt config.
This commit is contained in:
parent
6cebe4443a
commit
cc471c29f3
@ -1,10 +1,10 @@
|
||||
{%- set ips = salt['mine.get']('roles:kubernetes-master', 'network.ip_addrs', 'grain').values() %}
|
||||
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'] }}.*'"
|
||||
{% 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()) }}"
|
||||
{% else %}
|
||||
{% 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 %}
|
||||
|
||||
|
@ -57,7 +57,6 @@ apiserver-build:
|
||||
/etc/init.d/apiserver:
|
||||
file.managed:
|
||||
- source: salt://apiserver/initd
|
||||
- template: jinja
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 755
|
||||
@ -79,4 +78,3 @@ apiserver:
|
||||
- file: /etc/default/apiserver
|
||||
- file: /usr/local/bin/apiserver
|
||||
- file: /etc/init.d/apiserver
|
||||
|
||||
|
@ -17,9 +17,6 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
DESC="The Kubernetes API server"
|
||||
NAME=apiserver
|
||||
DAEMON=/usr/local/bin/apiserver
|
||||
{% if grains['cloud'] is not defined or grains['cloud'] != 'azure' %}
|
||||
DAEMON_ARGS="-cloud_provider gce"
|
||||
{% endif %}
|
||||
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