forked from microsoft/pai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalert-manager-deployment.yaml.template
More file actions
executable file
·126 lines (123 loc) · 5.36 KB
/
alert-manager-deployment.yaml.template
File metadata and controls
executable file
·126 lines (123 loc) · 5.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
# to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{% if cluster_cfg["alert-manager"]["use-pylon"] %}
{% set external_url = cluster_cfg["pylon"]["uri"] %}
{% else %}
{% set external_url = cluster_cfg["alert-manager"]["url"] %}
{% endif %}
apiVersion: apps/v1
kind: Deployment
metadata:
name: alertmanager
spec:
replicas: 1
selector:
matchLabels:
app: alertmanager
template:
metadata:
name: alertmanager
labels:
app: alertmanager
spec:
serviceAccountName: alert-manager-account
hostNetwork: false
containers:
- name: alertmanager
image: prom/alertmanager:v0.15.1
args:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
- '--web.external-url={{ external_url }}/alert-manager/'
- '--web.route-prefix=alert-manager'
ports:
- name: alertmanager
containerPort: {{ cluster_cfg["alert-manager"]["port"] }}
hostPort: {{ cluster_cfg["alert-manager"]["port"] }}
volumeMounts:
- name: config-volume
mountPath: /etc/alertmanager
- name: alertmanager
mountPath: /alertmanager
{% if cluster_cfg["alert-manager"]["alert-handler"]["configured"] %}
- name: alerthandler
image: {{ cluster_cfg['cluster']['docker-registry']['prefix'] }}alert-handler:{{ cluster_cfg['cluster']['docker-registry']['tag'] }}
imagePullPolicy: Always
env:
- name: SERVER_PORT
value: "{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}"
- name: CLUSTER_ID
value: {{ cluster_cfg["cluster"]["common"]["cluster-id"] }}
- name: REST_SERVER_URI
value: {{ cluster_cfg['rest-server']['uri'] }}
- name: DOCKER_REGISTRY_PREFIX
value: {{ cluster_cfg['cluster']['docker-registry']['prefix'] }}
- name: DOCKER_REGISTRY_TAG
value: {{ cluster_cfg['cluster']['docker-registry']['tag'] }}
- name: WEBPORTAL_URI
{%- if "ssl" in cluster_cfg["pylon"] and cluster_cfg["pylon"]["ssl"] %}
value: "{{ cluster_cfg['pylon']['uri-https']}}"
{%- else %}
value: "{{ cluster_cfg['pylon']['uri']}}"
{%- endif %}
- name: LOG_LEVEL
value: {{ cluster_cfg["alert-manager"]["alert-handler"]["log-level"] }}
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- name: EMAIL_CONFIGS_ADMIN_RECEIVER
value: {{ cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["admin-receiver"] }}
- name: EMAIL_CONFIGS_SMTP_HOST
value: {{ cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["smtp-host"] }}
- name: EMAIL_CONFIGS_SMTP_PORT
value: "{{ cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["smtp-port"] }}"
- name: EMAIL_CONFIGS_SMTP_FROM
value: {{ cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["smtp-from"] }}
- name: EMAIL_CONFIGS_SMTP_AUTH_USERNAME
value: {{ cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["smtp-auth-username"] }}
- name: EMAIL_CONFIGS_SMTP_AUTH_PASSWORD
value: {{ cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["smtp-auth-password"] }}
{% endif %}
volumeMounts:
- name: templates-volume
mountPath: /etc/alerthandler/templates
{% endif %}
imagePullSecrets:
- name: {{ cluster_cfg["cluster"]["docker-registry"]["secret-name"] }}
volumes:
- name: config-volume
configMap:
name: alertmanager-configmap
{% if cluster_cfg["alert-manager"]["alert-handler"]["configured"] %}
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- name: templates-volume
configMap:
name: alert-templates
items:
{% for template in cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["templates"] -%}
- key: {{ template }}-html.ejs
path: {{ template }}/html.ejs
- key: {{ template }}-subject.ejs
path: {{ template }}/subject.ejs
{% endfor -%}
{% endif %}
{% endif %}
- name: alertmanager
emptyDir: {}
tolerations:
- key: node.kubernetes.io/memory-pressure
operator: "Exists"
- key: node.kubernetes.io/disk-pressure
operator: "Exists"