What NetworkPolicies do you apply to the monitoring namespace?
IntermediateProductionObservability as Code, Security & Vendor Choices
Answer
Default deny ingress, then allow only what is needed:
- Grafana from the ingress controller.
- Prometheus (9090) from Grafana, Thanos Query or the Mimir ruler, and from itself for HA.
- Alertmanager (9093) from Prometheus; cluster gossip (9094 TCP/UDP) between Alertmanager peers.
- Loki and Tempo writes from the agents' namespace only.
Egress also matters: Prometheus must reach every scrape target, so application namespaces with default-deny need an ingress rule allowing the monitoring namespace on the metrics port. Forgetting that is a common cause of targets going DOWN with context deadline exceeded after a security hardening sprint.
More on Observability as Code, Security & Vendor Choices
What does "observability as code" cover, and why insist on it?BeginnerHow do you manage Grafana with Terraform?IntermediateHow do you validate Alertmanager configuration in CI?BeginnerWhat does a CI pipeline for Prometheus rules look like?IntermediateRaw dashboard JSON, Jsonnet/Grafonnet or the Grafana Foundation SDK: which do you pick?AdvancedWhat are monitoring mixins and how do you consume them?Advanced