Skip to content

Commit

Permalink
Create network-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
imoisharma authored Oct 17, 2021
1 parent bbc435c commit 77bee9b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions policies/network-policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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.0/24
ports:
- protocol: TCP
port: 5978

0 comments on commit 77bee9b

Please sign in to comment.