查看默认sidecar配置
kubectl get mutatingwebhookconfiguration istio-sidecar-injector -o yaml | grep "namespaceSelector:" -A5namespaceSelector:matchLabels:istio-injection: enabledobjectSelector: {}reinvocationPolicy: Neverrules:
可以看出,istio默认sidecar注入规则是,namespace带有标签istio-injection: enabled才会注入sidecar。
查看哪些namespace已经配置注入:
[root@k8s-master istio-1.4.2]# kubectl get namespace -L istio-injection
NAME STATUS AGE ISTIO-INJECTION
default Active 70d
ingress-nginx Active 69d
istio-system Active 19h
kube-node-lease Active 70d
kube-public Active 70d
kube-system Active 70d
naftis Active 19h
test-deri Active