kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: access-redis
spec:
  podSelector:
    matchLabels:
      app: redis
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          name: dev
    - podSelector:
        matchLabels:
          redis: "true"