diff --git a/cluster/saltbase/salt/kube-node-unpacker/init.sls b/cluster/saltbase/salt/kube-node-unpacker/init.sls index db93b91755dc2..868271eadee5a 100644 --- a/cluster/saltbase/salt/kube-node-unpacker/init.sls +++ b/cluster/saltbase/salt/kube-node-unpacker/init.sls @@ -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: @@ -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 @@ -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 %}