diff options
author | Maciej Wereski <m.wereski@partner.samsung.com> | 2021-07-28 13:38:43 +0000 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2021-08-24 13:41:02 +0000 |
commit | c3c919875dfd958c2e6d7ffdd3043dc7310289ab (patch) | |
tree | 83586e66a2292aa6a508d08bb9d50006aad644b6 | |
parent | 107b0eb0586053e057e6a90722e75ba25a523b28 (diff) |
noheat: deploy MetalLB, cert-manager and prometheus
Issue-ID: INT-1601
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Change-Id: Ia23b7ec2f5dbe3ecc1845f245f6377401daebbf0
4 files changed, 61 insertions, 0 deletions
diff --git a/deployment/noheat/cluster-rke/ansible/create.yml b/deployment/noheat/cluster-rke/ansible/create.yml index c2eca98dc..9a2943b12 100644 --- a/deployment/noheat/cluster-rke/ansible/create.yml +++ b/deployment/noheat/cluster-rke/ansible/create.yml @@ -41,3 +41,8 @@ hosts: operator0 roles: - role: setup_helm +- name: Install metallb, cert-manager and prometheus + hosts: operator0 + gather_facts: false + roles: + - role: deps diff --git a/deployment/noheat/cluster-rke/ansible/roles/deps/defaults/main.yml b/deployment/noheat/cluster-rke/ansible/roles/deps/defaults/main.yml new file mode 100644 index 000000000..28ddadfa0 --- /dev/null +++ b/deployment/noheat/cluster-rke/ansible/roles/deps/defaults/main.yml @@ -0,0 +1,6 @@ +--- +cert_manager_version: "1.2.0" +prometheus_version: "13.13.1" +metallb_version: "0.10.2" +metallb_protocol: "layer2" +metallb_addresses: "192.168.1.240-192.168.1.255" diff --git a/deployment/noheat/cluster-rke/ansible/roles/deps/tasks/main.yml b/deployment/noheat/cluster-rke/ansible/roles/deps/tasks/main.yml new file mode 100644 index 000000000..022867d0b --- /dev/null +++ b/deployment/noheat/cluster-rke/ansible/roles/deps/tasks/main.yml @@ -0,0 +1,44 @@ +- name: Download cert-manager + get_url: + url: "https://github.com/jetstack/cert-manager/releases/download/v{{ cert_manager_version }}/cert-manager.yaml" + dest: "/tmp" + mode: '0400' + +- name: Deploy cert-manager + kubernetes.core.k8s: + src: /tmp/cert-manager.yaml + state: present + +- name: Add MetalLB Helm repository + kubernetes.core.helm_repository: + name: metallb + repo_url: https://metallb.github.io/metallb + +- name: Add prometheus Helm repository + kubernetes.core.helm_repository: + name: prometheus + repo_url: https://prometheus-community.github.io/helm-charts + +- name: Copy MetalLB override file + template: + src: "metallb-values.yaml.j2" + dest: "/tmp/metallb-values.yaml" + mode: '0400' + +- name: Deploy MetalLB charts + kubernetes.core.helm: + name: metallb + chart_version: "{{ metallb_version }}" + chart_ref: metallb/metallb + release_namespace: metallb + create_namespace: true + values_files: + - /tmp/metallb-values.yaml + +- name: Deploy Prometheus charts + kubernetes.core.helm: + name: prometheus + chart_version: "{{ prometheus_version }}" + chart_ref: prometheus/kube-prometheus-stack + release_namespace: prometheus + create_namespace: true diff --git a/deployment/noheat/cluster-rke/ansible/roles/deps/templates/metallb-values.yaml.j2 b/deployment/noheat/cluster-rke/ansible/roles/deps/templates/metallb-values.yaml.j2 new file mode 100644 index 000000000..d86d505df --- /dev/null +++ b/deployment/noheat/cluster-rke/ansible/roles/deps/templates/metallb-values.yaml.j2 @@ -0,0 +1,6 @@ +configInline: + address-pools: + - name: default + protocol: "{{ metallb_protocol }}" + addresses: + - "{{ metallb_addresses }}" |