init
This commit is contained in:
31
network-policy/0-policy.template
Normal file
31
network-policy/0-policy.template
Normal file
@ -0,0 +1,31 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
namespace: isolated
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: my
|
||||
policyTypes:
|
||||
- Egress
|
||||
ingress:
|
||||
- from:
|
||||
- ipBlock:
|
||||
cidr: 172.17.0.0/16
|
||||
except:
|
||||
- 172.17.1.0/24
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
project: demo
|
||||
kubernetes.io/metadata.name: app
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
role: frontend
|
||||
egress:
|
||||
- to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
...
|
||||
ports:
|
||||
- protocol: ..
|
||||
port: ..
|
||||
Reference in New Issue
Block a user