This section describes how to switch from the Push Notification service to the Alertmanager-based notifications. For more information on the Alertmanager-based notifications, see MCP Reference Architecture: StackLight LMA components.
Caution
Before you start, perform the following prerequisite steps:
Warning
The Push Notification service uses the md5
hashing algorithm
for creating alert IDs for the Salesforce notifications, whereas the
Salesforce notifier service uses sha256
by default. Switching to
sha256
without migration of Salesforce cases may lead to cases loss from
the Salesforce notifier scope. If these services have different hashing set
up, case duplication with the same subject and status but different IDs may
occur. Therefore, Mirantis recommends explicitly setting the md5
hashing
algorithm in your model configuration as described below. Migration of old
cases is not supported.
To Switch to the Alertmanager-based notifications:
Open your Git project repository with Reclass model on the cluster level.
Set up the Alertmanager-based notifications:
For email notifications, follow the procedure described in Enable email or Slack notifications.
For Salesforce notifications:
Set the md5
hashing algorithm in the
<cluster>/stacklight/server.yml
file:
_params:
sf_notifier_alert_id_hash_func: md5
Set up the Salesforce notifier service as described in Enable Salesforce notifications.
Disable the Push Notification service:
Open the classes/cluster/<cluster_name>/stacklight/server.yml
file
for editing.
Remove the following class:
- system.prometheus.alertmanager.notification.pushkin
Remove the following parameters:
alertmanager_notification_pushkin_host: <host>
alertmanager_notification_pushkin_port: <port>
Log in to the Salt Master node.
Refresh Salt pillars:
salt '*' saltutil.refresh_pillar
Apply the following state:
salt -C 'I@docker:swarm and I@prometheus:server' state.sls prometheus.alertmanager -b 1
(Optional) Remove the Push Notification service:
Verify that only the Push Notification service uses the database in the Docker container.
In the Git project repository with Reclass model on the cluster level,
open the classes/cluster/<cluster_name>/stacklight/server.yml
file
for editing.
Remove the following classes:
- system.haproxy.proxy.listen.oss.pushkin
- system.haproxy.proxy.listen.oss.postgresql
- system.docker.swarm.stack.pushkin
- system.docker.swarm.stack.postgresql
- system.docker.swarm.network.oss_backend
- system.postgresql.client.pushkin
- system.postgresql.client.pushkin.sfdc
- system.glusterfs.server.volume.postgresql
- system.glusterfs.server.volume.pushkin
- system.glusterfs.client.volume.postgresql
- system.glusterfs.client.volume.pushkin
Remove the following parameters:
postgresql_client_user: 'postgres'
postgresql_client_password: 'postgrespassword'
Log in to the Salt Master node.
Apply the changes:
salt -C 'I@haproxy:proxy' state.sls haproxy.proxy
salt -C 'I@docker:swarm and I@prometheus:server' state.sls docker.client
Remove the Push Notification service from Docker Swarm:
salt -C 'I@docker:swarm and I@prometheus:server' cmd.run 'docker stack rm pushkin'
Remove the PostgreSQL service from Docker Swarm:
salt -C 'I@docker:swarm and I@prometheus:server' cmd.run 'docker stack rm postgresql'
Remove the Docker images for the Push Notification service and PostgreSQL:
salt -C 'I@docker:swarm and I@prometheus:server' cmd.run 'docker rmi <postgres_image> <pushkin_image>'
Stop the Push Notification service and PostgreSQL:
salt -C 'I@docker:swarm:role:master and I@prometheus:server' cmd.run 'echo "y" | gluster volume stop pushkin'
salt -C 'I@docker:swarm:role:master and I@prometheus:server' cmd.run 'echo "y" | gluster volume stop postgresql'
Delete the volumes:
salt -C 'I@docker:swarm:role:master and I@prometheus:server' cmd.run 'echo "y" | gluster volume delete pushkin'
salt -C 'I@docker:swarm:role:master and I@prometheus:server' cmd.run 'echo "y" | gluster volume delete postgresql'
Remove the directories for GlusterFS bricks:
salt -C 'I@docker:swarm and I@prometheus:server' cmd.run 'rm -rf /srv/glusterfs/pushkin'
salt -C 'I@docker:swarm and I@prometheus:server' cmd.run 'rm -rf /srv/glusterfs/postgres'
(Optional) Uninstall GlusterFS:
sudo apt remove -y glusterfs-server