Files
ayatori/config/network-policy/allow-metrics-traffic.yaml
panxiao81 4846ff2aba
Verify / lint (pull_request) Failing after 5m37s
Verify / test (pull_request) Successful in 5m38s
feat: scaffold job execution API
2026-09-17 18:58:11 +00:00

27 lines
766 B
YAML

# Allow metrics traffic from pods in namespaces labeled 'metrics: enabled'.
# Add this label to namespaces whose pods should scrape metrics.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/name: ayatori
app.kubernetes.io/managed-by: kustomize
name: allow-metrics-traffic
namespace: system
spec:
podSelector:
matchLabels:
control-plane: controller-manager
app.kubernetes.io/name: ayatori
policyTypes:
- Ingress
ingress:
# Allow pods in namespaces labeled 'metrics: enabled' to scrape metrics.
- from:
- namespaceSelector:
matchLabels:
metrics: enabled # Only from namespaces with this label
ports:
- port: 8443
protocol: TCP