apiVersion : kyverno.io/v1
kind : ClusterPolicy
metadata :
  name : policy-endpoints
spec :
  rules:
    - name: pEP
      match:
        resources:
          kinds : 
          - Endpoints
          selector:
            matchLabels:
              label : test
      mutate:
        patches:
          - path : "/subsets/0/ports/0/port"
            op : replace
            value: 9663
          - path : "/metadata/labels/isMutated"
            op: add
            value: "true"