Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the scripts to handle master/minion salt setups (e.g. AWS) #18198

Merged
merged 1 commit into from
Dec 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion cluster/saltbase/salt/kube-node-unpacker/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,29 @@
- group: root
- mode: 755

{% if grains.cloud is defined and grains.cloud == 'gce' %}
node-docker-image-tags:
file.touch:
- name: /srv/pillar/docker-images.sls
{% else %}
kube-proxy-tar:
file.managed:
- name: /srv/salt/kube-bins/kube-proxy.tar
- source: salt://kube-bins/kube-proxy.tar
- makedirs: True
- user: root
- group: root
- mode: 755
{% endif %}

{% if pillar.get('is_systemd') %}
{% set is_helium = '0' %}
# Super annoying, the salt version on GCE is old enough that 'salt.cmd.run'
# isn't supported
{% if grains.cloud is defined and grains.cloud == 'aws' %}
{% set is_helium = salt.cmd.run('salt --version | grep -c Helium') %}
{% endif %}
# Salt Helium doesn't support systemd modules for service running
{% if pillar.get('is_systemd') and is_helium == '0' %}

{{ pillar.get('systemd_system_path') }}/kube-node-unpacker.service:
file.managed:
Expand All @@ -20,7 +38,11 @@ node-docker-image-tags:
cmd.wait:
- name: /opt/kubernetes/helpers/services bounce kube-node-unpacker
- watch:
{% if grains.cloud is defined and grains.cloud == 'gce' %}
- file: node-docker-image-tags
{% else %}
- file: kube-proxy-tar
{% endif %}
- file: /etc/kubernetes/kube-node-unpacker.sh
- file: {{ pillar.get('systemd_system_path') }}/kube-node-unpacker.service

Expand All @@ -38,7 +60,11 @@ kube-node-unpacker:
- enable: True
- restart: True
- watch:
{% if grains.cloud is defined and grains.cloud == 'gce' %}
- file: node-docker-image-tags
{% else %}
- file: kube-proxy-tar
{% endif %}
- file: /etc/kubernetes/kube-node-unpacker.sh

{% endif %}