Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 4 additions & 76 deletions src/alert-manager/deploy/alert-manager-configmap.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -153,59 +153,33 @@ data:
receivers:
- name: "pai-email-admin"
webhook_configs:
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-admin'
send_resolved: true
{% endif %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false

- name: pai-cert-expiration-checker
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if 'cert-expiration-checker' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-group/?template=cert-expiration'
send_resolved: false
{% endif %}

- name: pai-cluster-usage
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if 'email-group' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-group/?template=cluster-usage'
send_resolved: false
{% endif %}

- name: pai-job-status-change
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if 'email-user' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-user/?template=job-status-change'
send_resolved: false
http_config:
bearer_token: {{ cluster_cfg["alert-manager"]["pai-bearer-token"] }}
{% endif %}


- name: pai-prod-job-status-change
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if 'email-group' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-group/?template=job-status-change'
send_resolved: false
{% endif %}

- name: pai-unvalidate-nodes
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-admin'
send_resolved: false
{% endif %}

- name: pai-cordon-nodes
webhook_configs:
Expand All @@ -215,11 +189,7 @@ data:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/cordon-nodes'
send_resolved: false
{% endif %}
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-admin'
send_resolved: true
{% endif %}


- name: pai-uncordon-nodes
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
Expand All @@ -228,11 +198,7 @@ data:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/uncordon-nodes'
send_resolved: false
{% endif %}
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-admin'
send_resolved: true
{% endif %}


- name: pai-reboot-nodes
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
Expand All @@ -241,10 +207,6 @@ data:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/reboot-nodes'
send_resolved: false
{% endif %}
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-admin'
send_resolved: true
{% endif %}

- name: pai-drain-nodes
webhook_configs:
Expand All @@ -254,21 +216,12 @@ data:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/drain-nodes'
send_resolved: false
{% endif %}
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-admin'
send_resolved: true
{% endif %}

- name: pai-abnormal-job-email
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if 'email-user' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-user/?template=kill-low-efficiency-job-alert'
send_resolved: false
http_config:
bearer_token: {{ cluster_cfg["alert-manager"]["pai-bearer-token"] }}
{% endif %}

- name: pai-abnormal-job-terminate
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
Expand All @@ -295,37 +248,12 @@ data:
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if 'email-user' in cluster_cfg["alert-manager"]["actions-available"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-user/?template=adjust-user-quota'
send_resolved: false
http_config:
bearer_token: {{ cluster_cfg["alert-manager"]["pai-bearer-token"] }}
{% endif %}

{% for receiver in cluster_cfg["alert-manager"]["customized-receivers"] %}
- name: {{ receiver.name}}
webhook_configs:
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/log-alerts'
send_resolved: false
{% if (receiver["actions"]["email-admin"] is defined) and ('email-admin' in cluster_cfg["alert-manager"]["actions-available"]) %}
{% set template = receiver["actions"]["email-admin"]["template"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-admin/?template={{ template }}'
send_resolved: true
{% endif %}

{% if (receiver["actions"]["email-group"] is defined) and ('email-group' in cluster_cfg["alert-manager"]["actions-available"]) %}
{% set template = receiver["actions"]["email-group"]["template"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-group/?template={{ template }}'
send_resolved: false
{% endif %}

{% if (receiver["actions"]["email-user"] is defined) and ('email-user' in cluster_cfg["alert-manager"]["actions-available"]) %}
{% set template = receiver["actions"]["email-user"]["template"] %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/send-email-to-user/?template={{ template }}'
send_resolved: false
http_config:
bearer_token: {{ cluster_cfg["alert-manager"]["pai-bearer-token"] }}
{% endif %}

{% if (receiver["actions"]["stop-jobs"] is defined) and ('stop-jobs' in cluster_cfg["alert-manager"]["actions-available"]) %}
- url: 'http://localhost:{{ cluster_cfg["alert-manager"]["alert-handler"]["port"] }}/alert-handler/stop-jobs'
Expand Down
29 changes: 0 additions & 29 deletions src/alert-manager/deploy/alert-manager-deployment.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,6 @@ spec:
- name: POSTGRES_SCHEMA
value: "{{ cluster_cfg['alert-manager']['postgresql'].get('schema', 'ltp_sdk') }}"
{% endif %}
{% 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"] }}
volumeMounts:
- name: templates-volume
mountPath: /etc/alerthandler/templates
{% endif %}
{% endif %}
{% if cluster_cfg["alert-manager"]["job-status-change-notification"]["configured"] %}
- name: job-status-change-notification
Expand Down Expand Up @@ -457,18 +440,6 @@ spec:
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 %}
{% if cluster_cfg["alert-manager"]["node-recycler"]["configured"] %}
{% if "icm" in cluster_cfg["alert-manager"]["node-recycler"] %}
Expand Down

This file was deleted.

This file was deleted.

37 changes: 0 additions & 37 deletions src/alert-manager/deploy/alert-templates/cert-expiration/html.ejs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

92 changes: 0 additions & 92 deletions src/alert-manager/deploy/alert-templates/cluster-usage/html.ejs

This file was deleted.

This file was deleted.

Loading