{{- if .Values.clusterConfig.cilium.enabled }}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
  name: allow-prometheus-metrics
  namespace: ingress-nginx
spec:
  endpointSelector:
    matchLabels:
      app.kubernetes.io/instance: ingress-nginx
  ingress:
    - fromEndpoints:
        - matchLabels:
            io.kubernetes.pod.namespace: prometheus
    - toPorts:
        - ports:
            - port: "9913"
              protocol: TCP
{{- end }}
