Improve vagrant reliablility, fix race condition with openvswitch and docker

This commit is contained in:
derekwaynecarr 2015-02-21 13:31:50 -05:00
parent 86a0193f51
commit 87a41b0934
6 changed files with 34 additions and 12 deletions

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
@ -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