问题描述
我有多租户环境,需要在网络层隔离我的租户。 我定义了3个网络策略:
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Metadata:
name: allow-same-namespace
spec:
ingress:
from:
podSelector: {}
podSelector: null
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Metadata:
name: allow-from-openshift-ingress
spec:
ingress:
from:
namespaceSelector:
matchLabels:
network.openshift.io/policy-group: ingress
podSelector: {}
policyTypes:
Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Metadata:
name: allow-from-openshift-monitoring
spec:
ingress:
from:
namespaceSelector:
matchLabels:
network.openshift.io/policy-group: monitoring
podSelector: {}
policyTypes:
Ingress
也由于我的入口控制器是NetworkHost,所以向 default 名称空间添加了以下标签 network.openshift.io/policy-group:入口
但是,无法通过容器接收到流量。 我找不到解决方法。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)