diff --git a/cluster/vagrant/provision-master.sh b/cluster/vagrant/provision-master.sh index 7c68cb89755..812db6f11a3 100755 --- a/cluster/vagrant/provision-master.sh +++ b/cluster/vagrant/provision-master.sh @@ -307,6 +307,28 @@ if ! which salt-minion >/dev/null 2>&1; then # Install Salt minion curl -sS -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s + # Edit the Salt minion unit file to do restart always + # needed because vagrant uses this as basis for registration of nodes in cloud provider + # set a oom_score_adj to -999 to prevent our node from being killed with salt-master and then making kubelet NotReady + # because its not found in salt cloud provider call + cat </usr/lib/systemd/system/salt-minion.service +[Unit] +Description=The Salt Minion +After=syslog.target network.target + +[Service] +Type=simple +ExecStart=/usr/bin/salt-minion +Restart=Always +OOMScoreAdjust=-999 + +[Install] +WantedBy=multi-user.target +EOF + + systemctl daemon-reload + systemctl restart salt-minion.service + else # Only run highstate when updating the config. In the first-run case, Salt is # set up to run highstate as new minions join for the first time. diff --git a/cluster/vagrant/provision-minion.sh b/cluster/vagrant/provision-minion.sh index 1469febc53e..f0cebe264ae 100755 --- a/cluster/vagrant/provision-minion.sh +++ b/cluster/vagrant/provision-minion.sh @@ -163,6 +163,29 @@ swapoff -a if ! which salt-minion >/dev/null 2>&1; then # Install Salt curl -sS -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s + + # Edit the Salt minion unit file to do restart always + # needed because vagrant uses this as basis for registration of nodes in cloud provider + # set a oom_score_adj to -999 to prevent our node from being killed with salt-master and then making kubelet NotReady + # because its not found in salt cloud provider call + cat </usr/lib/systemd/system/salt-minion.service +[Unit] +Description=The Salt Minion +After=syslog.target network.target + +[Service] +Type=simple +ExecStart=/usr/bin/salt-minion +Restart=Always +OOMScoreAdjust=-999 + +[Install] +WantedBy=multi-user.target +EOF + + systemctl daemon-reload + systemctl restart salt-minion.service + else # Sometimes the minion gets wedged when it comes up along with the master. # Restarting it here un-wedges it.