Add jobs for k8s external DNS

+ switch other jobs to a generic template

Related story: https://mirantis.jira.com/browse/PROD-22456

Change-Id: I355b91071af7320de10d0ead1acdc43c0761169a
diff --git a/jenkins/client/job/k8s-test/init.yml b/jenkins/client/job/k8s-test/init.yml
index 59904c2..7a391af 100644
--- a/jenkins/client/job/k8s-test/init.yml
+++ b/jenkins/client/job/k8s-test/init.yml
@@ -1,12 +1,6 @@
 classes:
 - system.jenkins.client.job.k8s-test.mcp-k8s-test-pipeline
 - system.jenkins.client.job.k8s-test.mcp-k8s-merge-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-dashboard-test-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-dashboard-merge-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-nginx-ingress-test-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-nginx-ingress-merge-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-metallb-test-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-metallb-merge-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-coredns-test-pipeline
-- system.jenkins.client.job.k8s-test.mcp-k8s-coredns-merge-pipeline
+- system.jenkins.client.job.k8s-test.mcp-k8s-generic-test-pipeline
+- system.jenkins.client.job.k8s-test.mcp-k8s-generic-merge-pipeline
 - system.jenkins.client.job.k8s-test.mcp-k8s-formula-test-pipeline
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-coredns-merge-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-coredns-merge-pipeline.yml
deleted file mode 100644
index 10fe045..0000000
--- a/jenkins/client/job/k8s-test/mcp-k8s-coredns-merge-pipeline.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-parameters:
-  _param:
-    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
-    mcp_prod_docker_registry: 'docker-prod-local.docker.mirantis.net'
-  jenkins:
-    client:
-      job:
-        mcp_k8s_coredns_merge_pipeline:
-          type: workflow-scm
-          name: mcp-k8s-coredns-merge-pipeline
-          display_name: "CoreDNS merge pipeline"
-          discard:
-            build:
-              keep_num: 20
-          concurrent: false
-          scm:
-            type: git
-            url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
-            credentials: "gerrit"
-            script: pipelines/mcp-k8s-coredns-pipeline.groovy
-          trigger:
-            gerrit:
-              project:
-                kubernetes/coredns:
-                  branches:
-                    - compare_type: "ANT"
-                      name: "**mcp**"
-              message:
-                build_successful: "Build successful"
-                build_unstable: "Build unstable"
-                build_failure: "Build failed"
-              event:
-                change:
-                  - merged
-          param:
-            KUBE_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_docker_registry}
-              description: 'Docker registry for binaries and images'
-            KUBE_PROD_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_prod_docker_registry}
-              description: 'Prod docker registry for binaries and images'
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-coredns-test-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-coredns-test-pipeline.yml
deleted file mode 100644
index 1f0e190..0000000
--- a/jenkins/client/job/k8s-test/mcp-k8s-coredns-test-pipeline.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-parameters:
-  _param:
-    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
-  jenkins:
-    client:
-      job:
-        mcp_k8s_coredns_test_pipeline:
-          type: workflow-scm
-          name: mcp-k8s-coredns-test-pipeline
-          display_name: "CoreDNS tests pipeline"
-          discard:
-            build:
-              keep_num: 50
-          concurrent: true
-          scm:
-            type: git
-            url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
-            credentials: "gerrit"
-            script: pipelines/mcp-k8s-coredns-pipeline.groovy
-          trigger:
-            gerrit:
-              project:
-                kubernetes/coredns:
-                  branches:
-                    - compare_type: "ANT"
-                      name: "**"
-              message:
-                build_successful: "Build successful"
-                build_unstable: "Build unstable"
-                build_failure: "Build failed"
-              event:
-                patchset:
-                  - created:
-                      excludeDrafts: false
-                      excludeTrivialRebase: false
-                      excludeNoCodeChange: false
-                comment:
-                  - addedContains:
-                      commentAddedCommentContains: '(recheck|reverify)'
-              override-votes:
-                gerritBuildUnstableVerifiedValue: 1
-                gerritBuildUnstableCodeReviewValue: 1
-          param:
-            KUBE_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_docker_registry}
-              description: 'Docker registry for binaries and images'
-
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-dashboard-merge-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-dashboard-merge-pipeline.yml
deleted file mode 100644
index 8424f6a..0000000
--- a/jenkins/client/job/k8s-test/mcp-k8s-dashboard-merge-pipeline.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-parameters:
-  _param:
-    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
-    mcp_prod_docker_registry: 'docker-prod-local.docker.mirantis.net'
-  jenkins:
-    client:
-      job:
-        mcp_k8s_dashboard_merge_pipeline:
-          type: workflow-scm
-          name: mcp-k8s-dashboard-merge-pipeline
-          display_name: "Kubernetes dashboard merge pipeline"
-          discard:
-            build:
-              keep_num: 20
-          concurrent: false
-          scm:
-            type: git
-            url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
-            credentials: "gerrit"
-            script: pipelines/mcp-k8s-dashboard-pipeline.groovy
-          trigger:
-            gerrit:
-              project:
-                kubernetes/dashboard:
-                  branches:
-                    - compare_type: "ANT"
-                      name: "**mcp**"
-              message:
-                build_successful: "Build successful"
-                build_unstable: "Build unstable"
-                build_failure: "Build failed"
-              event:
-                change:
-                  - merged
-          param:
-            KUBE_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_docker_registry}
-              description: 'Docker registry for binaries and images'
-            KUBE_PROD_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_prod_docker_registry}
-              description: 'Prod docker registry for binaries and images'
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-dashboard-test-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-dashboard-test-pipeline.yml
deleted file mode 100644
index ebb4692..0000000
--- a/jenkins/client/job/k8s-test/mcp-k8s-dashboard-test-pipeline.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-parameters:
-  _param:
-    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
-  jenkins:
-    client:
-      job:
-        mcp_k8s_dashboard_test_pipeline:
-          type: workflow-scm
-          name: mcp-k8s-dashboard-test-pipeline
-          display_name: "Kubernetes dashboard tests pipeline"
-          discard:
-            build:
-              keep_num: 50
-          concurrent: true
-          scm:
-            type: git
-            url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
-            credentials: "gerrit"
-            script: pipelines/mcp-k8s-dashboard-pipeline.groovy
-          trigger:
-            gerrit:
-              project:
-                kubernetes/dashboard:
-                  branches:
-                    - compare_type: "ANT"
-                      name: "**"
-              message:
-                build_successful: "Build successful"
-                build_unstable: "Build unstable"
-                build_failure: "Build failed"
-              event:
-                patchset:
-                  - created:
-                      excludeDrafts: false
-                      excludeTrivialRebase: false
-                      excludeNoCodeChange: false
-                comment:
-                  - addedContains:
-                      commentAddedCommentContains: '(recheck|reverify)'
-              override-votes:
-                gerritBuildUnstableVerifiedValue: 1
-                gerritBuildUnstableCodeReviewValue: 1
-          param:
-            KUBE_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_docker_registry}
-              description: 'Docker registry for binaries and images'
-
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-generic-merge-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-generic-merge-pipeline.yml
new file mode 100644
index 0000000..0c01626
--- /dev/null
+++ b/jenkins/client/job/k8s-test/mcp-k8s-generic-merge-pipeline.yml
@@ -0,0 +1,65 @@
+parameters:
+  _param:
+    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
+    mcp_prod_docker_registry: 'docker-prod-local.docker.mirantis.net'
+  jenkins:
+    client:
+      job_template:
+        mcp-k8s-generic-merge-pipeline:
+          name: mcp-k8s-{{name}}-merge-pipeline
+          jobs:
+            - name: coredns
+              display_name: "CoreDNS merge pipeline"
+              pipeline: mcp-k8s-coredns-pipeline.groovy
+              repo: kubernetes/coredns
+            - name: dashboard
+              display_name: "Kubernetes dashboard merge pipeline"
+              pipeline: mcp-k8s-dashboard-pipeline.groovy
+              repo: kubernetes/dashboard
+            - name: external-dns
+              display_name: "External DNS merge pipeline"
+              pipeline: mcp-k8s-ext-dns-pipeline.groovy
+              repo: kubernetes/external-dns
+            - name: metallb
+              display_name: "Metal LB merge pipeline"
+              pipeline: mcp-k8s-metallb-pipeline.groovy
+              repo: kubernetes/metallb
+            - name: nginx-ingress
+              display_name: "NGINX ingress merge pipeline"
+              pipeline: mcp-k8s-ingress-nginx-pipeline.groovy
+              repo: kubernetes/ingress-nginx
+          template:
+            type: workflow-scm
+            display_name: "{{display_name}}"
+            discard:
+              build:
+                keep_num: 20
+            concurrent: false
+            scm:
+              type: git
+              url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
+              credentials: "gerrit"
+              script: "pipelines/{{pipeline}}"
+            trigger:
+              gerrit:
+                project:
+                  "{{repo}}":
+                    branches:
+                      - compare_type: "ANT"
+                        name: "**mcp**"
+                message:
+                  build_successful: "Build successful"
+                  build_unstable: "Build unstable"
+                  build_failure: "Build failed"
+                event:
+                  change:
+                    - merged
+            param:
+              KUBE_DOCKER_REGISTRY:
+                type: string
+                default: ${_param:mcp_docker_registry}
+                description: 'Docker registry for binaries and images'
+              KUBE_PROD_DOCKER_REGISTRY:
+                type: string
+                default: ${_param:mcp_prod_docker_registry}
+                description: 'Prod docker registry for binaries and images'
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-generic-test-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-generic-test-pipeline.yml
new file mode 100644
index 0000000..de5e5a6
--- /dev/null
+++ b/jenkins/client/job/k8s-test/mcp-k8s-generic-test-pipeline.yml
@@ -0,0 +1,69 @@
+parameters:
+  _param:
+    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
+  jenkins:
+    client:
+      job_template:
+        mcp-k8s-generic-test-pipeline:
+          name: mcp-k8s-{{name}}-test-pipeline
+          jobs:
+            - name: coredns
+              display_name: "CoreDNS test pipeline"
+              pipeline: mcp-k8s-coredns-pipeline.groovy
+              repo: kubernetes/coredns
+            - name: dashboard
+              display_name: "Kubernetes dashboard test pipeline"
+              pipeline: mcp-k8s-dashboard-pipeline.groovy
+              repo: kubernetes/dashboard
+            - name: external-dns
+              display_name: "External DNS test pipeline"
+              pipeline: mcp-k8s-ext-dns-pipeline.groovy
+              repo: kubernetes/external-dns
+            - name: metallb
+              display_name: "Metal LB test pipeline"
+              pipeline: mcp-k8s-metallb-pipeline.groovy
+              repo: kubernetes/metallb
+            - name: nginx-ingress
+              display_name: "NGINX ingress test pipeline"
+              pipeline: mcp-k8s-ingress-nginx-pipeline.groovy
+              repo: kubernetes/ingress-nginx
+          template:
+            type: workflow-scm
+            display_name: "{{display_name}}"
+            discard:
+              build:
+                keep_num: 50
+            concurrent: true
+            scm:
+              type: git
+              url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
+              credentials: "gerrit"
+              script: "pipelines/{{pipeline}}"
+            trigger:
+              gerrit:
+                project:
+                  "{{repo}}":
+                    branches:
+                      - compare_type: "ANT"
+                        name: "**"
+                message:
+                  build_successful: "Build successful"
+                  build_unstable: "Build unstable"
+                  build_failure: "Build failed"
+                event:
+                  patchset:
+                    - created:
+                        excludeDrafts: false
+                        excludeTrivialRebase: false
+                        excludeNoCodeChange: false
+                  comment:
+                    - addedContains:
+                        commentAddedCommentContains: '(recheck|reverify)'
+                override-votes:
+                  gerritBuildUnstableVerifiedValue: 1
+                  gerritBuildUnstableCodeReviewValue: 1
+            param:
+              KUBE_DOCKER_REGISTRY:
+                type: string
+                default: ${_param:mcp_docker_registry}
+                description: 'Docker registry for binaries and images'
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-nginx-ingress-merge-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-nginx-ingress-merge-pipeline.yml
deleted file mode 100644
index 8236536..0000000
--- a/jenkins/client/job/k8s-test/mcp-k8s-nginx-ingress-merge-pipeline.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-parameters:
-  _param:
-    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
-    mcp_prod_docker_registry: 'docker-prod-local.docker.mirantis.net'
-  jenkins:
-    client:
-      job:
-        mcp_k8s_nginx_ingress_merge_pipeline:
-          type: workflow-scm
-          name: mcp-k8s-nginx-ingress-merge-pipeline
-          display_name: "k8s nginx ingress merge pipeline"
-          discard:
-            build:
-              keep_num: 20
-          concurrent: false
-          scm:
-            type: git
-            url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
-            credentials: "gerrit"
-            script: pipelines/mcp-k8s-ingress-nginx-pipeline.groovy
-          trigger:
-            gerrit:
-              project:
-                kubernetes/ingress-nginx:
-                  branches:
-                    - compare_type: "ANT"
-                      name: "**mcp**"
-              message:
-                build_successful: "Build successful"
-                build_unstable: "Build unstable"
-                build_failure: "Build failed"
-              event:
-                change:
-                  - merged
-          param:
-            KUBE_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_docker_registry}
-              description: 'Docker registry for binaries and images'
-            KUBE_PROD_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_prod_docker_registry}
-              description: 'Prod docker registry for binaries and images'
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-nginx-ingress-test-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-nginx-ingress-test-pipeline.yml
deleted file mode 100644
index 8730f0d..0000000
--- a/jenkins/client/job/k8s-test/mcp-k8s-nginx-ingress-test-pipeline.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-parameters:
-  _param:
-    mcp_docker_registry: 'docker-dev-local.docker.mirantis.net'
-  jenkins:
-    client:
-      job:
-        mcp_k8s_nginx_ingress_test_pipeline:
-          type: workflow-scm
-          name: mcp-k8s-nginx-ingress-test-pipeline
-          display_name: "k8s nginx ingress tests pipeline"
-          discard:
-            build:
-              keep_num: 50
-          concurrent: true
-          scm:
-            type: git
-            url: "${_param:jenkins_gerrit_url}/kubernetes-ci/kubernetes-pipelines"
-            credentials: "gerrit"
-            script: pipelines/mcp-k8s-ingress-nginx-pipeline.groovy
-          trigger:
-            gerrit:
-              project:
-                kubernetes/ingress-nginx:
-                  branches:
-                    - compare_type: "ANT"
-                      name: "**"
-              message:
-                build_successful: "Build successful"
-                build_unstable: "Build unstable"
-                build_failure: "Build failed"
-              event:
-                patchset:
-                  - created:
-                      excludeDrafts: false
-                      excludeTrivialRebase: false
-                      excludeNoCodeChange: false
-                comment:
-                  - addedContains:
-                      commentAddedCommentContains: '(recheck|reverify)'
-              override-votes:
-                gerritBuildUnstableVerifiedValue: 1
-                gerritBuildUnstableCodeReviewValue: 1
-          param:
-            KUBE_DOCKER_REGISTRY:
-              type: string
-              default: ${_param:mcp_docker_registry}
-              description: 'Docker registry for binaries and images'
-