apiVersion: kyverno.io/v1
kind: Policy
metadata:
  name: pol-validate-create-sa-permission
  namespace: pol-validate-create-sa-permission-ns
spec:
  rules:
  - name: clone-secret
    match:
      any:
      - resources:
          kinds:
          - ConfigMap
    generate:
      apiVersion: v1
      kind: ServiceAccount
      name: cpol-validate-create-sa-permission-sa
      namespace: pol-validate-create-sa-permission-ns
      synchronize: true
      clone:
        namespace: pol-validate-create-sa-permission-ns
        name: regcred