Skip to content

Commit

Permalink
add networkpolicy examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mfanjie committed Dec 25, 2021
1 parent 248a604 commit 0d4d623
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion module14/networkpolicy/readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ kubectl get po -n calico-demo -owide
### start clientpod
```
kubectl apply -f toolbox.yaml
kubectl apply -f toolbox.yaml -n calico-demo
```
### enter toolbox shell
```
Expand All @@ -27,7 +28,16 @@ ping <calico-pod-ip>
```
kubectl create -f allow-icmp-incluster.yaml
```
### test connectivity
### test connectivity from two toolbox pod
```
curl <calico-pod-ip>
ping <calico-pod-ip>
```
### create networkpolicy to allow access
```
kubectl create -f access-calico-demo.yaml
```
### test connectivity from two toolbox pod
```
curl <calico-pod-ip>
ping <calico-pod-ip>
Expand Down
2 changes: 1 addition & 1 deletion module14/networkpolicy/toolbox.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: default
# namespace: default
name: toolbox
spec:
replicas: 1
Expand Down

0 comments on commit 0d4d623

Please sign in to comment.