apiVersion: kyverno.io/v1
kind: Policy
metadata:
  name: generate-update-downstream-rule
  namespace: default
spec:
  generateExisting: false
  rules:
  - name: k-kafka-address
    match:
      any:
      - resources:
          kinds:
          - ConfigMap
    generate:
      synchronize: true
      apiVersion: v1
      kind: ConfigMap
      name: zk-kafka-address
      namespace: default
      data:
        kind: ConfigMap
        metadata:
          labels:
            somekey: somevalue
        data:
          ZK_ADDRESS: "192.168.10.10:2181,192.168.10.11:2181,192.168.10.12:2181"
          KAFKA_ADDRESS: "192.168.10.13:9092,192.168.10.14:9092,192.168.10.15:9092"
