File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 1818 destination :
1919 ports :
2020 - 5432
21+ # allow dns requests to public dns servers
22+ - action : Allow
23+ protocol : UDP
24+ destination :
25+ ports :
26+ - 53
Original file line number Diff line number Diff line change 11## How to add network policy (local deployment)
22
33How to discover ports / networks that are used by application
4- * enable and observe traffic via
5- - https://docs.tigera.io/calico/3.30/observability/enable-whisker
6- - https://docs.tigera.io/calico/3.30/observability/view-flow-logs
4+ * observe existing traffic (see ` Debug network policies ` below)
75* add staged policies to make sure all cases are included https://docs.tigera.io/calico/3.30/network-policy/staged-network-policies
8- * transform staged policies to "normal" policies
6+ - make sure deployed calico version supports it
7+ * based on observations, create a needed network policy
98
109## Debug network policies
10+
11+ if calico version 3.30+ is installed
1112* observe traffic and check ` policies ` field in whisker logs
1213 - https://docs.tigera.io/calico/3.30/observability/enable-whisker
1314 - https://docs.tigera.io/calico/3.30/observability/view-flow-logs
1415
15- Warning: make sure that calico version being used support Whisker (first introduced in v3.30)
16+ if calico version <= 3.29
17+ * create network policy with action log
18+ ``` yaml
19+ apiVersion : projectcalico.org/v3
20+ kind : NetworkPolicy
21+ metadata :
22+ name : log ingress requests
23+ spec :
24+ selector : app == 'db'
25+ ingress :
26+ - action : Log
27+ ` ` `
28+ * apply policy and see logs via journalctl (you can grep with ` calico-packet`)
1629
1730# # Known issues
1831
You can’t perform that action at this time.
0 commit comments