From c676f8dabb7bfc768ea353fb7cd529742dc829c6 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Mon, 21 Mar 2016 17:38:08 -0700 Subject: [PATCH] remove unused static-routes from salt --- cluster/saltbase/salt/README.md | 1 - cluster/saltbase/salt/static-routes/if-down | 16 ----------- cluster/saltbase/salt/static-routes/if-up | 16 ----------- cluster/saltbase/salt/static-routes/init.sls | 30 -------------------- cluster/saltbase/salt/static-routes/refresh | 7 ----- 5 files changed, 70 deletions(-) delete mode 100644 cluster/saltbase/salt/static-routes/if-down delete mode 100644 cluster/saltbase/salt/static-routes/if-up delete mode 100644 cluster/saltbase/salt/static-routes/init.sls delete mode 100644 cluster/saltbase/salt/static-routes/refresh diff --git a/cluster/saltbase/salt/README.md b/cluster/saltbase/salt/README.md index 0f9879bac13..0c74b49a155 100644 --- a/cluster/saltbase/salt/README.md +++ b/cluster/saltbase/salt/README.md @@ -24,7 +24,6 @@ Config | GCE | Vagrant | AWS | [kubelet](kubelet/) | M n | M n | M n | [logrotate](logrotate/) | M n | n | M n | [supervisord](supervisor/) | M n | M n | M n | -[static-routes](static-routes/) (vsphere only) | | | | [base](base.sls) | M n | M n | M n | [kube-client-tools](kube-client-tools.sls) | M | M | M | diff --git a/cluster/saltbase/salt/static-routes/if-down b/cluster/saltbase/salt/static-routes/if-down deleted file mode 100644 index 9da2865b04e..00000000000 --- a/cluster/saltbase/salt/static-routes/if-down +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -[ "$IFACE" == "eth0" ] || exit 0 - -{% for host, ip_addrs in salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', 'grain').items() %} - {% set network_ipaddr = None %} - {% if salt['network.ip_addrs']('eth0') is defined %} - {% set network_ipaddr = salt['network.ip_addrs']('eth0')[0] %} - {% elif salt['network.ip_addrs']('local') is defined %} - {% set network_ipaddr = salt['network.ip_addrs']('local')[0] %} - {% endif %} - {% if network_ipaddr is defined and ip_addrs[0] != network_ipaddr %} - {% set cidr = salt['mine.get'](host, 'grains.items')[host]['cbr-cidr'] %} - route del -net {{ cidr }} - {% endif %} -{% endfor %} diff --git a/cluster/saltbase/salt/static-routes/if-up b/cluster/saltbase/salt/static-routes/if-up deleted file mode 100644 index 36614072c20..00000000000 --- a/cluster/saltbase/salt/static-routes/if-up +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -[ "$IFACE" == "eth0" ] || exit 0 - -{% for host, ip_addrs in salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', 'grain').items() %} - {% set network_ipaddr = None %} - {% if salt['network.ip_addrs']('eth0') %} - {% set network_ipaddr = salt['network.ip_addrs']('eth0')[0] %} - {% elif salt['network.ip_addrs']('local') %} - {% set network_ipaddr = salt['network.ip_addrs']('local').first %} - {% endif %} - {% if network_ipaddr and ip_addrs[0] != network_ipaddr %} - {% set cidr = salt['mine.get'](host, 'grains.items')[host]['cbr-cidr'] %} - route add -net {{ cidr }} gw {{ ip_addrs[0] }} - {% endif %} -{% endfor %} diff --git a/cluster/saltbase/salt/static-routes/init.sls b/cluster/saltbase/salt/static-routes/init.sls deleted file mode 100644 index 3a01c55c949..00000000000 --- a/cluster/saltbase/salt/static-routes/init.sls +++ /dev/null @@ -1,30 +0,0 @@ -# Add static routes to every minion to enable pods in the 10.244.x.x range to -# reach each other. This is suboptimal, but necessary to let every pod have -# its IP and have pods between minions be able to talk with each other. -# This will be obsolete when we figure out the right way to make this work. - -/etc/network/if-up.d/static-routes: - file.managed: - - source: salt://static-routes/if-up - - template: jinja - - user: root - - group: root - - mode: 755 - -/etc/network/if-down.d/static-routes: - file.managed: - - source: salt://static-routes/if-down - - template: jinja - - user: root - - group: root - - mode: 755 - -refresh-routes: - cmd.wait_script: - - source: salt://static-routes/refresh - - cwd: /etc/network/ - - user: root - - group: root - - watch: - - file: /etc/network/if-up.d/static-routes - - file: /etc/network/if-down.d/static-routes diff --git a/cluster/saltbase/salt/static-routes/refresh b/cluster/saltbase/salt/static-routes/refresh deleted file mode 100644 index e988269073d..00000000000 --- a/cluster/saltbase/salt/static-routes/refresh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Fake an ifup/ifdown event -export IFACE=eth0 - -if-down.d/static-routes || true -if-up.d/static-routes || true