apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: backend-policy # namespace: intern-workspace spec: podSelector: matchLabels: app: employee-backend policyTypes: - Ingress - Egress ingress: - from: - podSelector: matchLabels: app: employee-frontend ports: - protocol: TCP port: 4000 egress: - to: - podSelector: matchLabels: app: employee-frontend ports: - protocol: TCP port: 4000 - to: - podSelector: matchLabels: app: mysql ports: - protocol: TCP port: 3306 - to: - namespaceSelector: {} ports: - protocol: UDP port: 53 - protocol: TCP port: 53