summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorArcanique <strugaml@163.com>2019-06-24 14:40:54 +0800
committerArcanique <strugaml@163.com>2019-06-24 14:41:09 +0800
commitc47a031a8649a41dc99577d5ddf0c9de39a583bc (patch)
tree85648d0dcf5f9815436f052fdbdc0785bd8bd56a /docs
parentMerge pull request #781 from rohitsardesai83/update-changelog (diff)
downloadkubeedge-c47a031a8649a41dc99577d5ddf0c9de39a583bc.tar.gz
Add user guide :edgemesh_test_env_guide.md
Diffstat (limited to 'docs')
-rw-r--r--docs/guides/edgemesh_test_env_guide.md66
-rw-r--r--docs/images/edgemesh/edgemesh-test-env-example.pngbin0 -> 17397 bytes
2 files changed, 66 insertions, 0 deletions
diff --git a/docs/guides/edgemesh_test_env_guide.md b/docs/guides/edgemesh_test_env_guide.md
index 32a02e92e..4395ababd 100644
--- a/docs/guides/edgemesh_test_env_guide.md
+++ b/docs/guides/edgemesh_test_env_guide.md
@@ -1,3 +1,69 @@
+# Edgemesh test env config guide
+
+## install Containerd
++ please refer to the following link to install
+> <https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd>
+
+## install CNI plugin
++ download cni plugin
+```bash
+$ wget https://github.com/containernetworking/plugins/releases/download/v0.8.1/cni-plugins-linux-amd64-v0.8.1.tgz
+```
++ decompression and installation
+```bash
+$ mkdir -p /opt/cni/bin
+$ tar -zxvf cni-plugins-linux-amd64-v0.8.1.tgz -C /opt/cni/bin
+```
++ configure cni plugin
+
+```bash
+$ mkdir -p /etc/cni/net.d/
+```
+ > * please Make sure docker0 does not exist !!
+ > * field "bridge" must be "docker0"
+ > * field "isGateway" must be true
+
+```bash
+$ cat >/etc/cni/net.d/10-mynet.conf <<EOF
+{
+ "cniVersion": "0.2.0",
+ "name": "mynet",
+ "type": "bridge",
+ "bridge": "docker0",
+ "isGateway": true,
+ "ipMasq": true,
+ "ipam": {
+ "type": "host-local",
+ "subnet": "10.22.0.0/16",
+ "routes": [
+ { "dst": "0.0.0.0/0" }
+ ]
+ }
+}
+EOF
+```
+
+## Configure port mapping manually on node on which server is running
+> can see the examples in the next section.
+* step1. execute iptables command as follows
+```bash
+$ iptables -t nat -N PORT-MAP
+$ iptables -t nat -A PORT-MAP -i docker0 -j RETURN
+$ iptables -t nat -A PREROUTING -p tcp -m addrtype --dst-type LOCAL -j PORT-MAP
+$ iptables -t nat -A OUTPUT ! -d 127.0.0.0/8 -p tcp -m addrtype --dst-type LOCAL -j PORT-MAP
+$ iptables -P FORWARD ACCEPT
+```
+* step2. execute iptables command as follows
+ > * **portIN** is the service map at the host
+ > * **containerIP** is the IP in the container. Can be find out on master by **kubectl get pod -o wide**
+ > * **portOUT** is the port that monitored In-container
+```bash
+$ iptables -t nat -A PORT-MAP ! -i docker0 -p tcp -m tcp --dport portIN -j DNAT --to-destination containerIP:portOUT
+```
+
+## Example for Edgemesh test env
+![edgemesh test env example](../images/edgemesh/edgemesh-test-env-example.png)
+
# Edgemesh end to end test guide
## model
![model](../images/edgemesh/model.jpg)
diff --git a/docs/images/edgemesh/edgemesh-test-env-example.png b/docs/images/edgemesh/edgemesh-test-env-example.png
new file mode 100644
index 000000000..1f19dfbde
--- /dev/null
+++ b/docs/images/edgemesh/edgemesh-test-env-example.png
Binary files differ