Files
kubernetes/cluster/saltbase/salt/kube-controller-manager/default
Zach Loafman 120dba474e Change GCE to use standalone Saltstack config:
Change provisioning to pass all variables to both master and node. Run
Salt in a masterless setup on all nodes ala
http://docs.saltstack.com/en/latest/topics/tutorials/quickstart.html,
which involves ensuring Salt daemon is NOT running after install. Kill
Salt master install. And fix push to actually work in this new flow.

As part of this, the GCE Salt config no longer has access to the Salt
mine, which is primarily obnoxious for two reasons: - The minions
can't use Salt to see the master: this is easily fixed by static
config. - The master can't see the list of all the minions: this is
fixed temporarily by static config in util.sh, but later, by other
means (see
https://github.com/GoogleCloudPlatform/kubernetes/issues/156, which
should eventually remove this direction).

As part of it, flatten all of cluster/gce/templates/* into
configure-vm.sh, using a single, separate piece of YAML to drive the
environment variables, rather than constantly rewriting the startup
script.
2015-03-10 09:04:29 -07:00

52 lines
2.1 KiB
Plaintext

{% set cloud_config = "" -%}
{% set daemon_args = "$DAEMON_ARGS" -%}
{% if grains['os_family'] == 'RedHat' -%}
{% set daemon_args = "" -%}
{% endif -%}
{% set master="--master=127.0.0.1:8080" -%}
{% set machines = ""-%}
{% set cloud_provider = "" -%}
{% set minion_regexp = "--minion_regexp=.*" -%}
{% set sync_nodes = "--sync_nodes=true" -%}
{% if grains.cloud_provider is defined -%}
{% set cloud_provider = "--cloud_provider=" + grains.cloud_provider -%}
{% endif -%}
{% if pillar['node_instance_prefix'] is defined -%}
{% set minion_regexp = "--minion_regexp='" + pillar['node_instance_prefix'] + ".*'" -%}
{% endif -%}
{% if grains.cloud is defined -%}
{% if grains.cloud == 'gce' -%}
{% set cloud_provider = "--cloud_provider=gce" -%}
{% set machines = "--machines=" + pillar['gce_node_names'] -%}
{% endif -%}
{% if grains.cloud == 'aws' -%}
{% set cloud_provider = "--cloud_provider=aws" -%}
{% set cloud_config = "--cloud_config=/etc/aws.conf" -%}
{% set minion_regexp = "" -%}
{% set machines = "--machines=" + ','.join(salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', expr_form='grain').keys()) -%}
{% endif -%}
{% if grains.cloud == 'azure' -%}
MACHINES="{{ salt['mine.get']('roles:kubernetes-pool', 'grains.items', expr_form='grain').values()|join(',', attribute='hostnamef') }}"
{% set machines = "--machines=$MACHINES" -%}
{% endif -%}
{% if grains.cloud == 'vsphere' -%}
# Collect IPs of minions as machines list.
#
# Use a bash array to build the value we need. Jinja 2.7 does support a 'map'
# filter that would simplify this. However, some installations (specifically
# Debian Wheezy) only install Jinja 2.6.
MACHINE_IPS=()
{% for addrs in salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', expr_form='grain').values() -%}
MACHINE_IPS+=( {{ addrs[0] }} )
{% endfor -%}
{% set machines = "--machines=$(echo ${MACHINE_IPS[@]} | xargs -n1 echo | paste -sd,)" -%}
{% set minion_regexp = "" -%}
{% endif -%}
{% endif -%}
DAEMON_ARGS="{{daemon_args}} {{master}} {{machines}} {{ minion_regexp }} {{ cloud_provider }} {{ sync_nodes }} {{ cloud_config }} {{pillar['log_level']}}"