apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-from-database
spec:
  policyTypes:
  - Ingress
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          database.shivering-isles.com/network-access-required: "true"
      podSelector:
        matchLabels:
          app.kubernetes.io/name: postgres-operator
    ports:
    - port: 8008
      protocol: TCP
    - port: 5432
      protocol: TCP
    - port: 8080
      protocol: TCP
  podSelector:
    matchLabels:
      application: spilo
