apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
 name: prometheus-policy-exampleapp
 namespace: application-monitoring
spec:
 podSelector:
   matchLabels:
     app.kubernetes.io/name: prometheus-example-app
 ingress:
 - from:
    - podSelector:
        matchLabels:
          prometheus: app-prometheus
   ports:
    - protocol: TCP
      port: 8080
