mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Improve vagrant reliablility, fix race condition with openvswitch and docker
This commit is contained in:
parent
86a0193f51
commit
87a41b0934
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user