Skip to content

Commit

Permalink
- update deploy script to get sendgrid api key from backend to templa…
Browse files Browse the repository at this point in the history
…te into alertmanager config

- Update manifest to pull alertmanager binary and start it
  • Loading branch information
elipe17 committed Nov 15, 2024
1 parent 327018f commit 1a99710
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tdrs-backend/plg/alertmanager/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
version: 1
applications:
- name: alertmanager
memory: 512M
disk_quota: 1G
memory: 128M
disk_quota: 5G
instances: 1
command: |
mkdir /tmp
mkdir data
wget https://github.com/prometheus/alertmanager/releases/download/v0.27.0/alertmanager-0.27.0.linux-amd64.tar.gz
tar -zxvf alertmanager-0.27.0.linux-amd64.tar.gz
mv alertmanager-0.27.0.linux-amd64 alertmanager
rm -rf alertmanager-0.27.0.linux-amd64.tar.gz
./alertmanager --config.file=/home/vcap/app/alertmanager.prod.yml --storage.path=/home/vcap/app/data --log.level=debug --web.external-url=http://alertmanager.apps.internal:8080/alerts --web.route-prefix=/alerts --cluster.listen-address=""
buildpacks:
- https://github.com/cloudfoundry/binary-buildpack
5 changes: 5 additions & 0 deletions tdrs-backend/plg/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ deploy_loki() {

deploy_alertmanager() {
pushd alertmanager
CONFIG=alertmanager.prod.yml
cp alertmanager.yml $CONFIG
SENDGRID_API_KEY=$(cf env tdp-backend-prod | grep SENDGRID | cut -d " " -f2-)
yq eval -i ".global.smtp_auth_password = \"$SENDGRID_API_KEY\"" $CONFIG
cf push --no-route -f manifest.yml -t 180 --strategy rolling
cf map-route alertmanager apps.internal --hostname alertmanager

Expand All @@ -118,6 +122,7 @@ deploy_alertmanager() {
done
cf add-network-policy alertmanager $PROD_FRONTEND --protocol tcp --port 80
cf add-network-policy $PROD_FRONTEND alertmanager -s tanf-prod --protocol tcp --port 8080
rm $CONFIG
popd
}

Expand Down

0 comments on commit 1a99710

Please sign in to comment.