summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZohar Galor <zgalor@redhat.com>2017-11-13 18:02:49 +0200
committerZohar Galor <zgalor@redhat.com>2017-11-13 18:11:02 +0200
commiteaf2b01987f5bd3e96d0a4fdb9d841698e25c977 (patch)
tree86c4144ef9cf69772eda7c75c597aaf9460b7549
parent7175c6f228f61b883d958c12ba5130f37a0615c4 (diff)
downloadopenshift-eaf2b01987f5bd3e96d0a4fdb9d841698e25c977.tar.gz
openshift-eaf2b01987f5bd3e96d0a4fdb9d841698e25c977.tar.bz2
openshift-eaf2b01987f5bd3e96d0a4fdb9d841698e25c977.tar.xz
openshift-eaf2b01987f5bd3e96d0a4fdb9d841698e25c977.zip
Create prometheus configmaps before statefulset
Originally statefulset was created before configmaps and the pod would have a "FailedMount" warning for a few seconds until the configmaps are created. Now the configmaps are created before the statefulset to avoid that warning.
-rw-r--r--roles/openshift_prometheus/tasks/install_prometheus.yaml38
1 files changed, 19 insertions, 19 deletions
diff --git a/roles/openshift_prometheus/tasks/install_prometheus.yaml b/roles/openshift_prometheus/tasks/install_prometheus.yaml
index 00c3c1987..21da4bc9d 100644
--- a/roles/openshift_prometheus/tasks/install_prometheus.yaml
+++ b/roles/openshift_prometheus/tasks/install_prometheus.yaml
@@ -148,25 +148,6 @@
selector: "{{ openshift_prometheus_alertbuffer_pvc_pv_selector }}"
when: openshift_prometheus_alertbuffer_storage_type == 'pvc'
-# create prometheus stateful set
-- name: Set prometheus template
- template:
- src: prometheus.j2
- dest: "{{ tempdir }}/templates/prometheus.yaml"
- vars:
- namespace: "{{ openshift_prometheus_namespace }}"
-# prom_replicas: "{{ openshift_prometheus_replicas }}"
-
-- name: Set prometheus stateful set
- oc_obj:
- state: "{{ state }}"
- name: "prometheus"
- namespace: "{{ openshift_prometheus_namespace }}"
- kind: statefulset
- files:
- - "{{ tempdir }}/templates/prometheus.yaml"
- delete_after: true
-
# prometheus configmap
# Copy the additional rules file if it is defined
- name: Copy additional rules file to host
@@ -236,3 +217,22 @@
namespace: "{{ openshift_prometheus_namespace }}"
from_file:
alertmanager.yml: "{{ tempdir }}/alertmanager.yml"
+
+# create prometheus stateful set
+- name: Set prometheus template
+ template:
+ src: prometheus.j2
+ dest: "{{ tempdir }}/templates/prometheus.yaml"
+ vars:
+ namespace: "{{ openshift_prometheus_namespace }}"
+# prom_replicas: "{{ openshift_prometheus_replicas }}"
+
+- name: Set prometheus stateful set
+ oc_obj:
+ state: "{{ state }}"
+ name: "prometheus"
+ namespace: "{{ openshift_prometheus_namespace }}"
+ kind: statefulset
+ files:
+ - "{{ tempdir }}/templates/prometheus.yaml"
+ delete_after: true