k8s 禁止某些(role: db)pod联网
apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:name: test-network-policynamespace: defaultspec:podSelector:matchLabels:role: dbpolicyTypes:- Ingress- Egress
·
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test-network-policy
namespace: default
spec:
podSelector:
matchLabels:
role: db
policyTypes:
- Ingress
- Egress
参考文档:https://kubernetes.io/zh/docs/concepts/services-networking/network-policies/
更多推荐
已为社区贡献8条内容
所有评论(0)