Skip to content
Snippets Groups Projects
Commit 0d9b1dda authored by Arie Peterson's avatar Arie Peterson
Browse files

Merge branch '351-prometheus-installation-can-not-be-repeated' into 'master'

Resolve "Prometheus installation can not be repeated"

Closes #351

See merge request openappstack/openappstack!112
parents 9992e722 746b174c
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,65 @@
dest: '{{ data_directory }}/source/repos/local-storage'
version: '{{ git_local_storage_version }}'
- name: Apply helmfiles
- name: Make Prometheus custom resource definitions
tags:
- helmfile
- monitoring
# NOTE: Change the commit hash in the URL when upgrading Prometheus
command: '/snap/bin/kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/v0.31.1/example/prometheus-operator-crd/{{ item }}'
loop:
- alertmanager.crd.yaml
- prometheus.crd.yaml
- prometheusrule.crd.yaml
- servicemonitor.crd.yaml
- podmonitor.crd.yaml
- name: Apply storage helmfile
tags:
- helmfile
shell: |
set -e -x -o pipefail
/usr/local/bin/helmfile -b /usr/local/bin/helm -e oas \
-f {{ data_directory }}/source/helmfiles/helmfile.d/00-storage.yaml \
apply --suppress-secrets \
| sed 's/\x1B\[[0-9;]*[JKmsu]//g' \
>> {{ log_directory }}/helmfile.log
args:
executable: /bin/bash
when: '"00-storage" in helmfiles'
- name: Apply nginx helmfile
tags:
- helmfile
shell: |
set -e -x -o pipefail
/usr/local/bin/helmfile -b /usr/local/bin/helm -e oas \
-f {{ data_directory }}/source/helmfiles/helmfile.d/10-nginx.yaml \
apply --suppress-secrets \
| sed 's/\x1B\[[0-9;]*[JKmsu]//g' \
>> {{ log_directory }}/helmfile.log
args:
executable: /bin/bash
when: '"10-nginx" in helmfiles'
# Force needed for upgrading from 5 to 6: https://github.com/helm/charts/tree/master/stable/prometheus-operator#upgrading-from-5xx-to-6xx
- name: Apply monitoring helmfile with force
tags:
- helmfile
environment:
- GRAFANA_ADMIN_PASSWORD: "{{ grafana_admin_password }}"
shell: |
set -e -x -o pipefail
/usr/local/bin/helmfile -b /usr/local/bin/helm -e oas \
-f {{ data_directory }}/source/helmfiles/helmfile.d/15-monitoring.yaml \
apply --suppress-secrets --args='--force' \
| sed 's/\x1B\[[0-9;]*[JKmsu]//g' \
>> {{ log_directory }}/helmfile.log
args:
executable: /bin/bash
when: '"15-monitoring" in helmfiles'
- name: Apply nextcloud helmfile
tags:
- helmfile
environment:
......@@ -36,15 +94,13 @@
- ONLYOFFICE_JWT_SECRET: "{{ onlyoffice_jwt_secret }}"
- ONLYOFFICE_POSTGRESQL_PASSWORD: "{{ onlyoffice_postgresql_password }}"
- ONLYOFFICE_RABBITMQ_PASSWORD: "{{ onlyoffice_rabbitmq_password }}"
- GRAFANA_ADMIN_PASSWORD: "{{ grafana_admin_password }}"
shell: |
set -e -x -o pipefail
/usr/local/bin/helmfile -b /usr/local/bin/helm -e oas \
-f {{ data_directory }}/source/helmfiles/helmfile.d/{{ item }}.yaml \
-f {{ data_directory }}/source/helmfiles/helmfile.d/20-nextcloud.yaml \
apply --suppress-secrets \
| sed 's/\x1B\[[0-9;]*[JKmsu]//g' \
>> {{ log_directory }}/helmfile.log
args:
executable: /bin/bash
with_items: "{{ helmfiles }}"
when: item is not search("cert-manager")
when: '"20-nextcloud" in helmfiles'
......@@ -7,6 +7,8 @@ releases:
- name: "oas-{{ .Environment.Values.releaseName }}-prometheus"
namespace: "oas"
chart: "stable/prometheus-operator"
# NOTE: If you change this version, also change the commit hash in
# ansible/roles/apps/tasks/helmfiles.yml:34
version: 5.15.0
values:
- "../values/prometheus.yaml.gotmpl"
......
......@@ -7,6 +7,7 @@ kubeDns:
alertmanager:
alertmanagerSpec:
logFormat: logfmt
storage:
volumeClaimTemplate:
metadata:
......@@ -31,6 +32,9 @@ prometheus:
service:
type: NodePort
prometheusOperator:
createCustomResource: false
grafana:
adminPassword: "{{ requiredEnv "GRAFANA_ADMIN_PASSWORD" }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment