Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify demo instruction #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,33 @@ kind create cluster

Deploy multus:
```
git clone https://github.com/intel/multus-cni
cat multus-cni/images/multus-daemonset.yml | kubectl apply -f -
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset.yml
```

Deploy the MultiNetworkPolicy CRD:
```
git clone https://github.com/k8snetworkplumbingwg/multi-networkpolicy
kubectl apply -f multi-networkpolicy/scheme.yml
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multi-networkpolicy/master/scheme.yml
```

Deploy the multi-networkpolicy implementation with iptables:
```
git clone https://github.com/k8snetworkplumbingwg/multi-networkpolicy-iptables
kubectl apply -f multi-networkpolicy-iptables/demo/deploy.yml
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multi-networkpolicy-iptables/master/demo/deploy.yml
```

Copy macvlan cni to the control plane node:
```
git clone https://github.com/containernetworking/plugins
plugins/build_linux.sh
curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/v1.5.0/cni-plugins-linux-amd64-v1.5.0.tgz | tar -xz -C . ./macvlan
...
docker cp plugins/bin/macvlan kind-control-plane:/opt/cni/bin/
docker cp macvlan kind-control-plane:/opt/cni/bin/
```

Deploy a sample [network attachment definition](demo/net.yml), its
[policy](demo/policy.yml) and [pod](demo/alpine.yml) that attaches to that
network:
```
kubectl apply -f multi-networkpolicy-iptables/demo/net.yml
kubectl apply -f multi-networkpolicy-iptables/demo/policy.yml
kubectl apply -f multi-networkpolicy-iptables/demo/alpine.yml
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multi-networkpolicy-iptables/master/demo/net.yml
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multi-networkpolicy-iptables/master/demo/policy.yml
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multi-networkpolicy-iptables/master/demo/alpine.yml
```

You can the log in to the alpine pod and check the
Expand All @@ -52,5 +48,5 @@ kubectl exec -ti alpine -- /bin/sh
...
apk update
apk add iptables
iptables -Lv
iptables -vL
```