Completed upto lesson 28
This commit is contained in:
29
answers/network-policy.yaml
Normal file
29
answers/network-policy.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: app-control
|
||||
namespace: database
|
||||
spec:
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: db
|
||||
ingress:
|
||||
- from:
|
||||
- nameSpaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata: payments
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: payments
|
||||
ports:
|
||||
- port: 5432
|
||||
protocol: TCP
|
||||
egress:
|
||||
- ports:
|
||||
- protocol: TCP
|
||||
port: 53
|
||||
- protocol: UDP
|
||||
port: 53
|
||||
Reference in New Issue
Block a user