apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: restriction-rqlite
  namespace: default
spec:
  podSelector:
    matchLabels:
      app: essai   # en fait seul label commun à mes pods rqlite
  policyTypes:
  - Ingress   # par défaut
#  - Egress
  ingress:
  - from:
#    - ipBlock:
#        cidr: 172.17.0.0/16
#        except:
#        - 172.17.1.0/24
#    - namespaceSelector:
#        matchLabels:
#          project: myproject
    - podSelector:
        matchLabels:
          role: client-rqlite
    ports:
    - protocol: TCP
      port: 4001
#  egress:
#  - to:
#    - ipBlock:
#        cidr: 10.0.0.0/24
#    ports:
#    - protocol: TCP
#      port: 5978
