1.3.2. AlertManager の設定
メール、Slack、PagerDuty などの外部メッセージングツールを統合し、AlertManager から通知を受信します。open-cluster-management-observability
namespace で alertmanager-config
シークレットを上書きして、統合を追加し、AlertManager のルートを設定します。以下の手順を実行して、カスタムのレシーバールールを更新します。
alertmanager-config
シークレットからデータを抽出します。以下のコマンドを実行します。oc -n open-cluster-management-observability get secret alertmanager-config --template='{{ index .data "alertmanager.yaml" }}' |base64 -d > alertmanager.yaml
oc -n open-cluster-management-observability get secret alertmanager-config --template='{{ index .data "alertmanager.yaml" }}' |base64 -d > alertmanager.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 以下のコマンドを実行し、
alertmanager.yaml
ファイル設定を編集して保存します。oc -n open-cluster-management-observability create secret generic alertmanager-config --from-file=alertmanager.yaml --dry-run -o=yaml | oc -n open-cluster-management-observability replace secret --filename=-
oc -n open-cluster-management-observability create secret generic alertmanager-config --from-file=alertmanager.yaml --dry-run -o=yaml | oc -n open-cluster-management-observability replace secret --filename=-
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 更新したシークレットは以下の内容のようになります。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
変更内容は、変更後すぐに適用されます。AlertManager の例については、prometheus/alertmanager を参照してください。