{{- if and .Values.networkPolicies.enabled .Values.monitoring.enabled}} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: ingress-metric-scraping namespace: "{{ .Release.Namespace }}" spec: ingress: - from: - namespaceSelector: matchLabels: app.kubernetes.io/name: monitoring podSelector: matchLabels: app: prometheus ports: - port: 15014 protocol: TCP podSelector: matchLabels: app: istiod policyTypes: - Ingress {{- end }}