fix: Prom netpols

This commit is contained in:
JJGadgets
2023-11-18 08:04:35 +08:00
parent e21159b7f7
commit 0e67ec9fcd
4 changed files with 42 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ spec:
ingress.home.arpa/apiserver: "allow"
egress.home.arpa/apiserver: "allow"
egress.home.arpa/host: "allow"
prom.home.arpa/kps: "allow"
config:
webhooks:
- objectSelector:

View File

@@ -0,0 +1,33 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/cilium.io/ciliumnetworkpolicy_v2.json
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: "kps-prometheus-egress-labelled"
namespace: "monitoring"
spec:
description: "Allow Prometheus to egress to pods labelled with metrics exporters, no port restrictions"
endpointSelector:
matchLabels:
prometheus: "kps"
egress:
- toEndpoints:
- matchLabels:
prom.home.arpa/kps: "allow"
matchExpressions:
- key: "io.kubernetes.pod.namespace"
operator: "Exists"
---
apiVersion: "cilium.io/v2"
kind: CiliumClusterwideNetworkPolicy
metadata:
name: "kps-prometheus-ingress-labelled"
spec:
description: "Allow Prometheus to egress to pods labelled with metrics exporters, no port restrictions"
endpointSelector:
matchLabels:
prom.home.arpa/kps: "allow"
ingress:
- fromEndpoints:
- matchLabels:
prometheus: "kps"

View File

@@ -16,6 +16,13 @@ spec:
- matchLabels:
io.kubernetes.pod.namespace: "rook-ceph"
app: "csi-rbdplugin"
toPorts:
- ports:
- port: "9070"
- toEndpoints:
- matchLabels:
io.kubernetes.pod.namespace: "rook-ceph"
app: "csi-rbdplugin-provisioner"
toPorts:
- ports:
- port: "9070"

View File

@@ -42,6 +42,7 @@ spec:
labels:
mgr:
ingress.home.arpa/nginx: "allow"
prom.home.arpa/kps: "allow"
mon:
count: 3
allowMultiplePerNode: false