Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
155b56d8
Commit
155b56d8
authored
Oct 22, 2014
by
Filipe Brandenburger
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1760 from derekwaynecarr/docker_servicee
Clean-up docker configuration changes for openvswitch
parents
97dd7302
b836e31c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
15 deletions
+21
-15
init.sls
cluster/saltbase/salt/sdn/init.sls
+0
-1
provision-network.sh
cluster/vagrant/provision-network.sh
+21
-14
No files found.
cluster/saltbase/salt/sdn/init.sls
View file @
155b56d8
...
@@ -12,5 +12,4 @@ sdn:
...
@@ -12,5 +12,4 @@ sdn:
- watch:
- watch:
- pkg: docker-io
- pkg: docker-io
- pkg: openvswitch
- pkg: openvswitch
{% endif %}
{% endif %}
cluster/vagrant/provision-network.sh
View file @
155b56d8
...
@@ -86,30 +86,37 @@ cat <<EOF > /${NETWORK_CONF_PATH}route-${DOCKER_BRIDGE}
...
@@ -86,30 +86,37 @@ cat <<EOF > /${NETWORK_CONF_PATH}route-${DOCKER_BRIDGE}
${
BRIDGE_BASE
}
.0.0/16 dev
${
DOCKER_BRIDGE
}
scope link src
${
BRIDGE_ADDRESS
}
${
BRIDGE_BASE
}
.0.0/16 dev
${
DOCKER_BRIDGE
}
scope link src
${
BRIDGE_ADDRESS
}
EOF
EOF
# generate the post-configure script to be called by salt as cmd.wait
# generate the post-configure script to be called by salt as cmd.wait
cat
<<
EOF
>
${
POST_NETWORK_SCRIPT
}
cat
<<
EOF
>
${
POST_NETWORK_SCRIPT
}
#!/bin/bash
#!/bin/bash
set -e
set -e
# NAT interface fails to revive on network restart, so OR-gate to true
systemctl restart network.service || true
# set docker bridge up, and set stp on the ovs bridge
# Only do this operation once, otherwise, we get docker.servicee files output on disk, and the command line arguments get applied multiple times
ip link set dev
${
DOCKER_BRIDGE
}
up
grep -q kbr0 /etc/sysconfig/docker || {
ovs-vsctl set Bridge
${
OVS_SWITCH
}
stp_enable=true
# 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
# set docker bridge up, and set stp on the ovs bridge
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
# 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
systemctl daemon-reload
echo "OPTIONS='-b=kbr0 --iptables=false --selinux-enabled'" >/etc/sysconfig/docker
systemctl restart docker.service
systemctl daemon-reload
systemctl restart docker.service
# setup iptables masquerade rules so the pods can reach the internet
# setup iptables masquerade rules so the pods can reach the internet
iptables -t nat -A POSTROUTING -s
${
BRIDGE_BASE
}
.0.0/16 ! -d
${
BRIDGE_BASE
}
.0.0/16 -j MASQUERADE
iptables -t nat -A POSTROUTING -s
${
BRIDGE_BASE
}
.0.0/16 ! -d
${
BRIDGE_BASE
}
.0.0/16 -j MASQUERADE
# persist please
# persist please
iptables-save >& /etc/sysconfig/iptables
iptables-save >& /etc/sysconfig/iptables
}
EOF
EOF
chmod
+x
${
POST_NETWORK_SCRIPT
}
chmod
+x
${
POST_NETWORK_SCRIPT
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment