diff options
author | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2021-06-10 12:23:40 +0200 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2021-06-10 12:23:40 +0200 |
commit | 5f644b97f6a309a37a5a94e0cee8898491004843 (patch) | |
tree | f6e9dc732fe61fc43d0c5174b40230247638d724 /ansible/roles | |
parent | d357db8f1df643c268cc9c11c7cc43550ed17246 (diff) |
[ANSIBLE] Generate helm values file for kube-prometheus stack
Default values file is provided and any of it's contents can be
overriden by setting relevant keys in 'kube_prometheus_helm_values'
dict on provisioner run time.
Change-Id: I1655d64704e1ad6e9cd9650622ae1a92de902a8f
Issue-ID: INT-1926
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles')
-rw-r--r-- | ansible/roles/kube-prometheus-stack/defaults/main.yml | 17 | ||||
-rw-r--r-- | ansible/roles/kube-prometheus-stack/tasks/main.yml | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/ansible/roles/kube-prometheus-stack/defaults/main.yml b/ansible/roles/kube-prometheus-stack/defaults/main.yml index e9bcc6aa..f84fd0a0 100644 --- a/ansible/roles/kube-prometheus-stack/defaults/main.yml +++ b/ansible/roles/kube-prometheus-stack/defaults/main.yml @@ -3,3 +3,20 @@ kube_prometheus_stack: k8s_namespace: kube-prometheus helm_release_name: kube-prometheus-stack helm_timeout: "60s" + helm_values_file: "{{ app_data_path }}/kube_prometheus_values.yaml" + helm_values: + grafana: + adminPassword: admin + prometheus: + prometheusSpec: + scrapeInterval: 60s + storageSpec: + disableMountSubPath: true + volumeClaimTemplate: + spec: + storageClassName: kube-prometheus + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 6Gi + selector: {} diff --git a/ansible/roles/kube-prometheus-stack/tasks/main.yml b/ansible/roles/kube-prometheus-stack/tasks/main.yml index b7f314e0..596e4b5a 100644 --- a/ansible/roles/kube-prometheus-stack/tasks/main.yml +++ b/ansible/roles/kube-prometheus-stack/tasks/main.yml @@ -5,12 +5,18 @@ register: kube_prometheus_package_stat failed_when: not kube_prometheus_package_stat.stat.exists +- name: Generate helm values file + copy: + dest: "{{ kube_prometheus_stack.helm_values_file }}" + content: "{{ kube_prometheus_stack.helm_values | combine(kube_prometheus_helm_values | default({}), recursive=True) | to_nice_yaml }}" + - name: "Install Helm release {{ kube_prometheus_stack.helm_release_name }}" community.kubernetes.helm: release_name: "{{ kube_prometheus_stack.helm_release_name }}" release_namespace: "{{ kube_prometheus_stack.k8s_namespace }}" create_namespace: True chart_ref: "{{ app_data_path }}/downloads/kube-prometheus-stack-{{ kube_prometheus_stack_version }}.tgz" + values_files: "{{ kube_prometheus_stack.helm_values_file }}" wait: True wait_timeout: "{{ kube_prometheus_stack.helm_timeout }}" tags: molecule-notest |