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

Improve vagrant reliability #4699

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions cluster/saltbase/salt/kubelet/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,3 @@ kubelet:
- file: /etc/init.d/kubelet
{% endif %}
- file: /var/lib/kubelet/kubernetes_auth
{% if grains.network_mode is defined and grains.network_mode == 'openvswitch' %}
- sls: sdn
{% endif %}

9 changes: 1 addition & 8 deletions cluster/saltbase/salt/sdn/init.sls
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{% if grains.network_mode is defined and grains.network_mode == 'openvswitch' %}

openvswitch:
pkg:
- installed
service.running:
- enable: True

sdn:
cmd.wait:
- name: /kubernetes-vagrant/network_closure.sh
- watch:
- pkg: docker-io
- pkg: openvswitch
- sls: docker
{% endif %}
2 changes: 2 additions & 0 deletions cluster/saltbase/salt/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ base:
- monit
- nginx
- kube-client-tools
{% if grains['cloud'] is defined and grains['cloud'] != 'vagrant' %}
- logrotate
{% endif %}
- kube-addons
{% if grains['cloud'] is defined and grains['cloud'] == 'azure' %}
- openvpn
Expand Down
8 changes: 8 additions & 0 deletions cluster/vagrant/provision-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ done
mkdir -p /etc/salt/minion.d
cat <<EOF >/etc/salt/minion.d/master.conf
master: '$(echo "$MASTER_NAME" | sed -e "s/'/''/g")'
master: '$(echo "$MASTER_NAME" | sed -e "s/'/''/g")'
auth_timeout: 10
auth_tries: 2
auth_safemode: True
ping_interval: 1
random_reauth_delay: 3
state_aggregrate:
- pkg
EOF

cat <<EOF >/etc/salt/minion.d/grains.conf
Expand Down
17 changes: 17 additions & 0 deletions cluster/vagrant/provision-minion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,26 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
done

# Let the minion know who its master is
# Recover the salt-minion if the salt-master network changes
## auth_timeout - how long we want to wait for a time out
## auth_tries - how many times we will retry before restarting salt-minion
## auth_safemode - if our cert is rejected, we will restart salt minion
## ping_interval - restart the minion if we cannot ping the master after 1 minute
## random_reauth_delay - wait 0-3 seconds when reauthenticating
## recon_default - how long to wait before reconnecting
## recon_max - how long you will wait upper bound
## state_aggregrate - try to do a single yum command to install all referenced packages where possible at once, should improve startup times
##
mkdir -p /etc/salt/minion.d
cat <<EOF >/etc/salt/minion.d/master.conf
master: '$(echo "$MASTER_NAME" | sed -e "s/'/''/g")'
auth_timeout: 10
auth_tries: 2
auth_safemode: True
ping_interval: 1
random_reauth_delay: 3
state_aggregrate:
- pkg
EOF

cat <<EOF >/etc/salt/minion.d/log-level-debug.conf
Expand Down
6 changes: 6 additions & 0 deletions cluster/vagrant/provision-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ grep -q kbr0 /etc/sysconfig/docker || {
# Stop docker before making these updates
systemctl stop docker

# Install openvswitch
yum install -y openvswitch
systemctl enable openvswitch
systemctl start openvswitch

# create new docker bridge
ip link set dev ${DOCKER_BRIDGE} down || true
brctl delbr ${DOCKER_BRIDGE} || true
Expand Down Expand Up @@ -85,6 +90,7 @@ grep -q kbr0 /etc/sysconfig/docker || {
echo "OPTIONS='-b=kbr0 --selinux-enabled ${DOCKER_OPTS}'" >/etc/sysconfig/docker
systemctl daemon-reload
systemctl start docker

}
EOF

Expand Down