mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #1760 from derekwaynecarr/docker_servicee
Clean-up docker configuration changes for openvswitch
This commit is contained in:
commit
155b56d860
@ -12,5 +12,4 @@ sdn:
|
||||
- watch:
|
||||
- pkg: docker-io
|
||||
- pkg: openvswitch
|
||||
|
||||
{% endif %}
|
||||
|
@ -86,12 +86,17 @@ cat <<EOF > /${NETWORK_CONF_PATH}route-${DOCKER_BRIDGE}
|
||||
${BRIDGE_BASE}.0.0/16 dev ${DOCKER_BRIDGE} scope link src ${BRIDGE_ADDRESS}
|
||||
EOF
|
||||
|
||||
|
||||
# generate the post-configure script to be called by salt as cmd.wait
|
||||
cat <<EOF > ${POST_NETWORK_SCRIPT}
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Only do this operation once, otherwise, we get docker.servicee files output on disk, and the command line arguments get applied multiple times
|
||||
grep -q kbr0 /etc/sysconfig/docker || {
|
||||
# Stop docker before making these updates
|
||||
systemctl stop docker
|
||||
|
||||
# NAT interface fails to revive on network restart, so OR-gate to true
|
||||
systemctl restart network.service || true
|
||||
|
||||
@ -100,7 +105,8 @@ ip link set dev ${DOCKER_BRIDGE} up
|
||||
ovs-vsctl set Bridge ${OVS_SWITCH} stp_enable=true
|
||||
|
||||
# modify the docker service file such that it uses the kube docker bridge and not its own
|
||||
sed -ie "s/ExecStart=\/usr\/bin\/docker -d/ExecStart=\/usr\/bin\/docker -d -b=${DOCKER_BRIDGE} --iptables=false/g" /usr/lib/systemd/system/docker.service
|
||||
#echo "OPTIONS=-b=kbr0 --iptables=false --selinux-enabled" > /etc/sysconfig/docker
|
||||
echo "OPTIONS='-b=kbr0 --iptables=false --selinux-enabled'" >/etc/sysconfig/docker
|
||||
systemctl daemon-reload
|
||||
systemctl restart docker.service
|
||||
|
||||
@ -110,6 +116,7 @@ iptables -t nat -A POSTROUTING -s ${BRIDGE_BASE}.0.0/16 ! -d ${BRIDGE_BASE}.0.0/
|
||||
# persist please
|
||||
iptables-save >& /etc/sysconfig/iptables
|
||||
|
||||
}
|
||||
EOF
|
||||
|
||||
chmod +x ${POST_NETWORK_SCRIPT}
|
||||
|
Loading…
Reference in New Issue
Block a user