Create a `redis` deployment using the image `redis:alpine` with `1 replica` and . . .

karthi Mahadev:
Create a redis deployment using the image redis:alpine with 1 replica and label app=redis. Expose it via a ClusterIP service called redis on port 6379. Create a new Ingress Type NetworkPolicy called redis-access which allows only the pods with label access=redis to access the deployment.

and my netowrk pol is this, whats wrong with this ? please

apiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: NetworkPolicy
metadata:
  name: redis-access
  namespace: default
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
           access: redis

karthi Mahadev:
I saw the solution video and understood " to access the deployment." word make the difference, I should apply this on only this deployment…

Empty podselector tag would applicable to all pods

Mohamed Ayman:
Great!