|
@@ -19,7 +19,7 @@ spec:
|
|
labels:
|
|
labels:
|
|
app: prometheus
|
|
app: prometheus
|
|
spec:
|
|
spec:
|
|
- serviceAccountName: prometheus
|
|
|
|
|
|
+ serviceAccountName: "{{ openshift_prometheus_service_name }}"
|
|
{% if openshift_prometheus_node_selector is iterable and openshift_prometheus_node_selector | length > 0 %}
|
|
{% if openshift_prometheus_node_selector is iterable and openshift_prometheus_node_selector | length > 0 %}
|
|
nodeSelector:
|
|
nodeSelector:
|
|
{% for key, value in openshift_prometheus_node_selector.items() %}
|
|
{% for key, value in openshift_prometheus_node_selector.items() %}
|
|
@@ -47,15 +47,15 @@ spec:
|
|
cpu: "{{ openshift_prometheus_oauth_proxy_cpu_limit }}"
|
|
cpu: "{{ openshift_prometheus_oauth_proxy_cpu_limit }}"
|
|
{% endif %}
|
|
{% endif %}
|
|
ports:
|
|
ports:
|
|
- - containerPort: 8443
|
|
|
|
|
|
+ - containerPort: {{ openshift_prometheus_service_targetport }}
|
|
name: web
|
|
name: web
|
|
args:
|
|
args:
|
|
- -provider=openshift
|
|
- -provider=openshift
|
|
- - -https-address=:8443
|
|
|
|
|
|
+ - -https-address=:{{ openshift_prometheus_service_targetport }}
|
|
- -http-address=
|
|
- -http-address=
|
|
- -email-domain=*
|
|
- -email-domain=*
|
|
- -upstream=http://localhost:9090
|
|
- -upstream=http://localhost:9090
|
|
- - -client-id=system:serviceaccount:{{ namespace }}:prometheus
|
|
|
|
|
|
+ - -client-id=system:serviceaccount:{{ namespace }}:{{ openshift_prometheus_service_name }}
|
|
- '-openshift-sar={"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}'
|
|
- '-openshift-sar={"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}'
|
|
- '-openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}}'
|
|
- '-openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}}'
|
|
- -tls-cert=/etc/tls/private/tls.crt
|
|
- -tls-cert=/etc/tls/private/tls.crt
|
|
@@ -67,9 +67,9 @@ spec:
|
|
- -skip-auth-regex=^/metrics
|
|
- -skip-auth-regex=^/metrics
|
|
volumeMounts:
|
|
volumeMounts:
|
|
- mountPath: /etc/tls/private
|
|
- mountPath: /etc/tls/private
|
|
- name: prometheus-tls
|
|
|
|
|
|
+ name: prometheus-tls-secret
|
|
- mountPath: /etc/proxy/secrets
|
|
- mountPath: /etc/proxy/secrets
|
|
- name: prometheus-secrets
|
|
|
|
|
|
+ name: prometheus-proxy-secret
|
|
- mountPath: /prometheus
|
|
- mountPath: /prometheus
|
|
name: prometheus-data
|
|
name: prometheus-data
|
|
|
|
|
|
@@ -104,7 +104,7 @@ spec:
|
|
- mountPath: /prometheus
|
|
- mountPath: /prometheus
|
|
name: prometheus-data
|
|
name: prometheus-data
|
|
|
|
|
|
- # Deploy alertmanager behind prometheus-alert-buffer behind an oauth proxy
|
|
|
|
|
|
+ # Deploy alert-buffer behind oauth alerts-proxy
|
|
- name: alerts-proxy
|
|
- name: alerts-proxy
|
|
image: "{{ l_openshift_prometheus_proxy_image_prefix }}oauth-proxy:{{ l_openshift_prometheus_proxy_image_version }}"
|
|
image: "{{ l_openshift_prometheus_proxy_image_prefix }}oauth-proxy:{{ l_openshift_prometheus_proxy_image_version }}"
|
|
imagePullPolicy: IfNotPresent
|
|
imagePullPolicy: IfNotPresent
|
|
@@ -124,15 +124,15 @@ spec:
|
|
cpu: "{{ openshift_prometheus_oauth_proxy_cpu_limit }}"
|
|
cpu: "{{ openshift_prometheus_oauth_proxy_cpu_limit }}"
|
|
{% endif %}
|
|
{% endif %}
|
|
ports:
|
|
ports:
|
|
- - containerPort: 9443
|
|
|
|
|
|
+ - containerPort: {{ openshift_prometheus_alerts_service_targetport }}
|
|
name: web
|
|
name: web
|
|
args:
|
|
args:
|
|
- -provider=openshift
|
|
- -provider=openshift
|
|
- - -https-address=:9443
|
|
|
|
|
|
+ - -https-address=:{{ openshift_prometheus_alerts_service_targetport }}
|
|
- -http-address=
|
|
- -http-address=
|
|
- -email-domain=*
|
|
- -email-domain=*
|
|
- -upstream=http://localhost:9099
|
|
- -upstream=http://localhost:9099
|
|
- - -client-id=system:serviceaccount:{{ namespace }}:prometheus
|
|
|
|
|
|
+ - -client-id=system:serviceaccount:{{ namespace }}:{{ openshift_prometheus_service_name }}
|
|
- '-openshift-sar={"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}'
|
|
- '-openshift-sar={"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}'
|
|
- '-openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}}'
|
|
- '-openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}}'
|
|
- -tls-cert=/etc/tls/private/tls.crt
|
|
- -tls-cert=/etc/tls/private/tls.crt
|
|
@@ -143,9 +143,9 @@ spec:
|
|
- -openshift-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
- -openshift-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
volumeMounts:
|
|
volumeMounts:
|
|
- mountPath: /etc/tls/private
|
|
- mountPath: /etc/tls/private
|
|
- name: alerts-tls
|
|
|
|
|
|
+ name: alerts-tls-secret
|
|
- mountPath: /etc/proxy/secrets
|
|
- mountPath: /etc/proxy/secrets
|
|
- name: alerts-secrets
|
|
|
|
|
|
+ name: alerts-proxy-secret
|
|
|
|
|
|
- name: alert-buffer
|
|
- name: alert-buffer
|
|
args:
|
|
args:
|
|
@@ -169,11 +169,54 @@ spec:
|
|
{% endif %}
|
|
{% endif %}
|
|
volumeMounts:
|
|
volumeMounts:
|
|
- mountPath: /alert-buffer
|
|
- mountPath: /alert-buffer
|
|
- name: alert-buffer-data
|
|
|
|
|
|
+ name: alerts-data
|
|
ports:
|
|
ports:
|
|
- containerPort: 9099
|
|
- containerPort: 9099
|
|
name: alert-buf
|
|
name: alert-buf
|
|
|
|
|
|
|
|
+ # Deploy alertmanager behind oauth alertmanager-proxy
|
|
|
|
+ - name: alertmanager-proxy
|
|
|
|
+ image: "{{ l_openshift_prometheus_proxy_image_prefix }}oauth-proxy:{{ l_openshift_prometheus_proxy_image_version }}"
|
|
|
|
+ imagePullPolicy: IfNotPresent
|
|
|
|
+ requests:
|
|
|
|
+{% if openshift_prometheus_oauth_proxy_memory_requests is defined and openshift_prometheus_oauth_proxy_memory_requests is not none %}
|
|
|
|
+ memory: "{{ openshift_prometheus_oauth_proxy_memory_requests }}"
|
|
|
|
+{% endif %}
|
|
|
|
+{% if openshift_prometheus_oauth_proxy_cpu_requests is defined and openshift_prometheus_oauth_proxy_cpu_requests is not none %}
|
|
|
|
+ cpu: "{{ openshift_prometheus_oauth_proxy_cpu_requests }}"
|
|
|
|
+{% endif %}
|
|
|
|
+ limits:
|
|
|
|
+{% if openshift_prometheus_oauth_proxy_memory_limit is defined and openshift_prometheus_oauth_proxy_memory_limit is not none %}
|
|
|
|
+ memory: "{{ openshift_prometheus_oauth_proxy_memory_limit }}"
|
|
|
|
+{% endif %}
|
|
|
|
+{% if openshift_prometheus_oauth_proxy_cpu_limit is defined and openshift_prometheus_oauth_proxy_cpu_limit is not none %}
|
|
|
|
+ cpu: "{{ openshift_prometheus_oauth_proxy_cpu_limit }}"
|
|
|
|
+{% endif %}
|
|
|
|
+ ports:
|
|
|
|
+ - containerPort: {{ openshift_prometheus_alertmanager_service_targetport }}
|
|
|
|
+ name: web
|
|
|
|
+ args:
|
|
|
|
+ - -provider=openshift
|
|
|
|
+ - -https-address=:{{ openshift_prometheus_alertmanager_service_targetport }}
|
|
|
|
+ - -http-address=
|
|
|
|
+ - -email-domain=*
|
|
|
|
+ - -upstream=http://localhost:9093
|
|
|
|
+ - -client-id=system:serviceaccount:{{ namespace }}:{{ openshift_prometheus_service_name }}
|
|
|
|
+ - -openshift-ca=/etc/pki/tls/cert.pem
|
|
|
|
+ - -openshift-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
|
|
+ - '-openshift-sar={"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}'
|
|
|
|
+ - '-openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get", "resourceName": "{{ namespace }}", "namespace": "{{ namespace }}"}}'
|
|
|
|
+ - -tls-cert=/etc/tls/private/tls.crt
|
|
|
|
+ - -tls-key=/etc/tls/private/tls.key
|
|
|
|
+ - -client-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token
|
|
|
|
+ - -cookie-secret-file=/etc/proxy/secrets/session_secret
|
|
|
|
+ - -skip-auth-regex=^/metrics
|
|
|
|
+ volumeMounts:
|
|
|
|
+ - mountPath: /etc/tls/private
|
|
|
|
+ name: alertmanager-tls-secret
|
|
|
|
+ - mountPath: /etc/proxy/secrets
|
|
|
|
+ name: alertmanager-proxy-secret
|
|
|
|
+
|
|
- name: alertmanager
|
|
- name: alertmanager
|
|
args:
|
|
args:
|
|
- -config.file=/etc/alertmanager/alertmanager.yml
|
|
- -config.file=/etc/alertmanager/alertmanager.yml
|
|
@@ -205,14 +248,15 @@ spec:
|
|
|
|
|
|
restartPolicy: Always
|
|
restartPolicy: Always
|
|
volumes:
|
|
volumes:
|
|
|
|
+
|
|
- name: prometheus-config
|
|
- name: prometheus-config
|
|
configMap:
|
|
configMap:
|
|
defaultMode: 420
|
|
defaultMode: 420
|
|
name: prometheus
|
|
name: prometheus
|
|
- - name: prometheus-secrets
|
|
|
|
|
|
+ - name: prometheus-proxy-secret
|
|
secret:
|
|
secret:
|
|
secretName: prometheus-proxy
|
|
secretName: prometheus-proxy
|
|
- - name: prometheus-tls
|
|
|
|
|
|
+ - name: prometheus-tls-secret
|
|
secret:
|
|
secret:
|
|
secretName: prometheus-tls
|
|
secretName: prometheus-tls
|
|
- name: prometheus-data
|
|
- name: prometheus-data
|
|
@@ -225,13 +269,19 @@ spec:
|
|
- name: alertmanager-config
|
|
- name: alertmanager-config
|
|
configMap:
|
|
configMap:
|
|
defaultMode: 420
|
|
defaultMode: 420
|
|
- name: prometheus-alerts
|
|
|
|
- - name: alerts-secrets
|
|
|
|
|
|
+ name: alertmanager
|
|
|
|
+ - name: alertmanager-proxy-secret
|
|
secret:
|
|
secret:
|
|
- secretName: alerts-proxy
|
|
|
|
- - name: alerts-tls
|
|
|
|
|
|
+ secretName: alertmanager-proxy
|
|
|
|
+ - name: alertmanager-tls-secret
|
|
|
|
+ secret:
|
|
|
|
+ secretName: alertmanager-tls
|
|
|
|
+ - name: alerts-tls-secret
|
|
secret:
|
|
secret:
|
|
- secretName: prometheus-alerts-tls
|
|
|
|
|
|
+ secretName: alerts-tls
|
|
|
|
+ - name: alerts-proxy-secret
|
|
|
|
+ secret:
|
|
|
|
+ secretName: alerts-proxy
|
|
- name: alertmanager-data
|
|
- name: alertmanager-data
|
|
{% if openshift_prometheus_alertmanager_storage_type == 'pvc' %}
|
|
{% if openshift_prometheus_alertmanager_storage_type == 'pvc' %}
|
|
persistentVolumeClaim:
|
|
persistentVolumeClaim:
|
|
@@ -239,7 +289,7 @@ spec:
|
|
{% else %}
|
|
{% else %}
|
|
emptydir: {}
|
|
emptydir: {}
|
|
{% endif %}
|
|
{% endif %}
|
|
- - name: alert-buffer-data
|
|
|
|
|
|
+ - name: alerts-data
|
|
{% if openshift_prometheus_alertbuffer_storage_type == 'pvc' %}
|
|
{% if openshift_prometheus_alertbuffer_storage_type == 'pvc' %}
|
|
persistentVolumeClaim:
|
|
persistentVolumeClaim:
|
|
claimName: {{ openshift_prometheus_alertbuffer_pvc_name }}
|
|
claimName: {{ openshift_prometheus_alertbuffer_pvc_name }}
|