From 5833a6f8e35ebefac9d68ae47b406f58431bc95a Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Thu, 9 Jan 2020 20:27:00 -0500 Subject: [PATCH] apply-helm-charts: Job to apply Helm charts This job deploys a Kubernetes cluster and then runs all the Helm charts provided. Change-Id: If6c4a6d5bce912f55549d16175554154c86dd25a --- doc/source/helm-jobs.rst | 3 ++- playbooks/helm/post.yaml | 3 +++ playbooks/helm/pre.yaml | 5 +++++ playbooks/helm/run.yaml | 8 ++++++++ zuul.d/helm-jobs.yaml | 8 ++++++++ 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 playbooks/helm/post.yaml create mode 100644 playbooks/helm/pre.yaml create mode 100644 playbooks/helm/run.yaml diff --git a/doc/source/helm-jobs.rst b/doc/source/helm-jobs.rst index 4c951afd2..7214ab12a 100644 --- a/doc/source/helm-jobs.rst +++ b/doc/source/helm-jobs.rst @@ -1,4 +1,5 @@ Helm Jobs ========= -.. zuul:autojob:: chart-testing-lint +.. zuul:autojob:: apply-helm-charts +.. zuul:autojob:: chart-testing-lint \ No newline at end of file diff --git a/playbooks/helm/post.yaml b/playbooks/helm/post.yaml new file mode 100644 index 000000000..5242b7bf9 --- /dev/null +++ b/playbooks/helm/post.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - collect-container-logs diff --git a/playbooks/helm/pre.yaml b/playbooks/helm/pre.yaml new file mode 100644 index 000000000..4394152a1 --- /dev/null +++ b/playbooks/helm/pre.yaml @@ -0,0 +1,5 @@ +- hosts: all + roles: + - role: clear-firewall + - role: install-kubernetes + - role: ensure-helm diff --git a/playbooks/helm/run.yaml b/playbooks/helm/run.yaml new file mode 100644 index 000000000..829ded960 --- /dev/null +++ b/playbooks/helm/run.yaml @@ -0,0 +1,8 @@ +- hosts: all + tasks: + - include_role: + name: helm-template + vars: + helm_release_name: "{{ item.key }}" + helm_chart: "{{ item.value }}" + loop: "{{ helm_charts | dict2items }}" diff --git a/zuul.d/helm-jobs.yaml b/zuul.d/helm-jobs.yaml index b146d6f45..c39e145c1 100644 --- a/zuul.d/helm-jobs.yaml +++ b/zuul.d/helm-jobs.yaml @@ -4,3 +4,11 @@ Run chart-testing on Helm charts pre-run: playbooks/chart-testing/pre.yaml run: playbooks/chart-testing/run.yaml + +- job: + name: apply-helm-charts + description: | + Deploy a Kubernetes cluster and apply charts + pre-run: playbooks/helm/pre.yaml + run: playbooks/helm/run.yaml + post-run: playbooks/helm/post.yaml