apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: spec-policytypes-test-egress
  namespace: kube-system
spec:
  podSelector: {}
  # exists with ingress only but there is an egress section :
  policyTypes:
    - Ingress
  ingress:
  - from:
    - namespaceSelector: { }
      podSelector: { }
  egress:
  - to:
    - ipBlock:
       cidr: 10.0.0.0/24
    ports:
     - protocol: TCP
       port: 5978