[tenant] Allow egress to virt-handler for VM metrics scraping
- Add CiliumClusterwideNetworkPolicy for vmagent egress to virt-handler - Restrict endpointSelector to vmagent pods only via app.kubernetes.io/name label Signed-off-by: Mattia Eleuteri <mattia.eleuteri@hidora.io> Signed-off-by: mattia-eleuteri <mattia@hidora.io>
This commit is contained in:
parent
a13481bfea
commit
630dfc767a
1 changed files with 21 additions and 0 deletions
|
|
@ -207,6 +207,27 @@ spec:
|
|||
- toEndpoints:
|
||||
- matchLabels:
|
||||
"k8s:io.kubernetes.pod.namespace": cozy-kubevirt-cdi
|
||||
{{- if .Values.monitoring }}
|
||||
---
|
||||
apiVersion: cilium.io/v2
|
||||
kind: CiliumClusterwideNetworkPolicy
|
||||
metadata:
|
||||
name: {{ include "tenant.name" . }}-egress-virt-handler
|
||||
spec:
|
||||
endpointSelector:
|
||||
matchLabels:
|
||||
"k8s:io.kubernetes.pod.namespace": "{{ include "tenant.name" . }}"
|
||||
"k8s:app.kubernetes.io/name": "vmagent"
|
||||
egress:
|
||||
- toEndpoints:
|
||||
- matchLabels:
|
||||
"k8s:kubevirt.io": "virt-handler"
|
||||
"k8s:io.kubernetes.pod.namespace": "cozy-kubevirt"
|
||||
toPorts:
|
||||
- ports:
|
||||
- port: "8443"
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: cilium.io/v2
|
||||
kind: CiliumNetworkPolicy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue