Kubernetes Lab 9 - Network Policies
Solution
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: my-network-policy
spec:
podSelector:
matchLabels:
app: secure-app
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
allow-access: "true"