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