mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-07-30 00:21:36 +02:00
Add NetworkPolicy to limit traffic into Prometheus
* Allow traffic from Grafana to Prometheus in monitoring * Allow traffic from Prometheus to Prometheus in monitoring * NetworkPolicy denies non-whitelisted traffic. Define policy to allow other access
This commit is contained in:
28
addons/prometheus/network-policy.yaml
Normal file
28
addons/prometheus/network-policy.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
# Allow Grafana access and in-cluster Prometheus scraping
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
name: prometheus
|
||||
ingress:
|
||||
- ports:
|
||||
- protocol: TCP
|
||||
port: 9090
|
||||
from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: monitoring
|
||||
podSelector:
|
||||
matchLabels:
|
||||
name: grafana
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: monitoring
|
||||
podSelector:
|
||||
matchLabels:
|
||||
name: prometheus
|
||||
|
Reference in New Issue
Block a user