apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name:  cpol-data-nosync-delete-trigger
spec:
  rules:
  - name: default-deny
    match:
      any:
      - resources:
          kinds:
          - ConfigMap
    generate:
      apiVersion: networking.k8s.io/v1
      kind: NetworkPolicy
      name: default-deny
      namespace: "{{request.object.metadata.namespace}}"
      synchronize: false
      data:
        spec:
          podSelector: {}
          policyTypes:
          - Ingress
          - Egress