Skip to content

Commit

Permalink
Merge pull request #358 from appuio/setup-silence
Browse files Browse the repository at this point in the history
Add steps to disable and enable alerting to opsgenie to reduce noise
  • Loading branch information
haasad authored Oct 16, 2024
2 parents a37e94c + 7cf39ca commit 4470d69
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/modules/ROOT/partials/install/finalize_part1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,33 @@ oc whoami # should output system:serviceaccount:appuio-emergency-credentials-con
----
kubectl -n openshift-config patch cm admin-kubeconfig-client-ca --type=merge -p '{"data": {"ca-bundle.crt": ""}}'
----

=== Enable Opsgenie alerting

. Create the standard silence for alerts that don't have the `syn` label
+
[source,bash]
----
oc --as cluster-admin -n openshift-monitoring create job --from=cronjob/silence silence-manual
oc wait -n openshift-monitoring --for=condition=complete job/silence-manual
oc --as cluster-admin -n openshift-monitoring delete job/silence-manual
----

. Check the remaining active alerts and address them where neccessary
+
[source,bash]
----
kubectl --as=cluster-admin -n openshift-monitoring exec sts/alertmanager-main -- \
amtool --alertmanager.url=http://localhost:9093 alert --active
----

. Remove the "no-opsgenie" class from the cluster's configuration
+
[source,bash]
----
pushd "inventory/classes/${TENANT_ID}/"
yq eval -i 'del(.classes[] | select(. == "*.no-opsgenie"))' ${CLUSTER_ID}.yml
git commit -a -m "Enable opsgenie alerting on cluster ${CLUSTER_ID}"
git push
popd
----
7 changes: 7 additions & 0 deletions docs/modules/ROOT/partials/install/prepare-syn-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ if ls openshift4.y*ml 1>/dev/null 2>&1; then
fi
----

. Include no-opsgenie class to prevent monitoring noise during cluster setup
+
[source,bash]
----
yq eval -i '.classes += "global.distribution.openshift4.no-opsgenie"' ${CLUSTER_ID}.yml;
----

. Update cluster config
+
[source,bash,subs="attributes+"]
Expand Down

0 comments on commit 4470d69

Please sign in to comment.