-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit merges Jesutomi's (@tomilashy) work for network policies. Thank you! Signed-off-by: Elis Lulja <[email protected]>
- Loading branch information
Showing
6 changed files
with
365 additions
and
6 deletions.
There are no files selected for viewing
File renamed without changes.
60 changes: 60 additions & 0 deletions
60
artifacts/yamls/examples/network_policy/network_policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
|
||
kind: NetworkPolicy | ||
|
||
metadata: | ||
name: test-network-policy | ||
namespace: default | ||
|
||
spec: | ||
podSelector: | ||
matchLabels: | ||
role: db | ||
|
||
policyTypes: | ||
- Ingress | ||
|
||
- Egress | ||
|
||
ingress: | ||
- from: | ||
- ipBlock: | ||
cidr: 172.17.0.0/16 | ||
|
||
except: | ||
- 172.17.1.0/24 | ||
|
||
- namespaceSelector: | ||
matchLabels: | ||
project: myproject | ||
|
||
- podSelector: | ||
matchLabels: | ||
role: frontend | ||
|
||
ports: | ||
- protocol: TCP | ||
|
||
port: 6379 | ||
|
||
egress: | ||
- to: | ||
- ipBlock: | ||
cidr: 10.0.0.1/32 | ||
- ipBlock: | ||
cidr: 10.0.0.2/32 | ||
- ipBlock: | ||
cidr: 10.0.0.3/32 | ||
- ipBlock: | ||
cidr: 10.0.0.4/32 | ||
- ipBlock: | ||
cidr: 10.0.0.5/32 | ||
- ipBlock: | ||
cidr: 10.0.0.6/32 | ||
- ipBlock: | ||
cidr: 10.0.0.7/32 | ||
|
||
ports: | ||
- protocol: TCP | ||
|
||
port: 5978 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.