Allow Frontend To Backend

TrackKubernetes Learning Journey
Current SectionNetwork Policies
Progress85 of 271
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-frontend-to-backend
  namespace: backend
spec:
  podSelector:
    matchLabels:
      app: backend
  ingress:
    - from:
      - namespaceSelector:
          matchLabels:
            name: frontend
      ports:
        - port: 80
          protocol: TCP