Unplug (decom) a zone from AlertingHub#
This documentation is to be used in these cases:
- A customer no more needs AlertingHub services.
- A monitoring-stack-client with connection to AlertingHub is being decomissioned.
Unplug the zone#
In envs-ng edit zones/ngot_zones/values.cue and remove the connection to AlertingHub. Example (remove the highlighted code lines):
"svc-monitoring-stack-client-awesome": {
type: "service"
subtype: "monitoring-stack-client"
parent_zone_name: "kub-10002"
contract_zone_name: "obs-awesome"
parameters: {
"monitoring-stack": {
namespace: "\(subtype)-\(contract_zone_name)"
// Remove the bloc below to unplug AlertingHub
alertmanager: {
receivers: [{
name: "alertinghub"
}]
routes: [{
receiver: "alertinghub"
}]
}
}
}
}
Note
If the zone is decomissioned, not only the alertmanager bloc will be removed but all the zone.
Unreference the zone from AlertingHub#
In envs-ng edit contexts/pf/nginx-alertreceiver.cue and remove any reference to the unplugged zone.
Pay attention to the #ZonesMonitoredByTruesight definition that contains zones.
Regenerate the zones lists#
In envs-ng, run:
generate-static-zones-files
Create a MR, deploy the changes#
Create a Merge Request with the changes above.
Follow the usual worflow (validation, CAASCHR...)
Then:
- either write
trackbone applyin the MR to deploy the changes -
or run these command lines:
CLIENT=<client> # example : CLIENT=pf cd contexts/ngot trackbone plan -z svc-monitoring-stack-client-"${CLIENT}" -c alertmanagercd contexts/pf trackbone plan -z prdcasa -c nginx-alertreceiver
At last, merge the branch in the MR.
Cleanup in Vault#
In Vault, in the path secrets/applications/nginx-alertreceiver/, remove the zone.
export VAULT_ADDR=https://vault.infra-prd.caascad.com/
export VAULT_FORMAT=json
vault token lookup > /dev/null 2>&1 || vault login -method oidc
for i in $(vault list secret/applications/nginx-alertreceiver/${zone} | jq -r '.[]'); do echo "vault delete secret/applications/nginx-alertreceiver/${zone}/$i"; done
Run the commands returned by echo.
Control Karma#
Ensure there is no alert in Karma.
Deletion of private key#
Ask the support team to do a Swan ticket.
Confluence#
- remove zone in [Clients contacts|https://espace.agir.orange.com/display/BPF/Contacts+clients+AlertingHub]
- put zone in [deleted section|https://espace.agir.orange.com/pages/viewpage.action?pageId=1960892695]