[root@k8s-master istio-1.5.10]# kubectl -n istio-system get cm istio -o jsonpath="{@.data.mesh}" | grep disablePolicyChecks
disablePolicyChecks: true
2. 编辑 istio configmap
以启用策略检查
[root@k8s-master istio-1.5.10]# kubectl -n istio-system get cm istio -o jsonpath="{@.data.mesh}" | sed -e "s/disablePolicyChecks: true/disablePolicyChecks: false/" > /tmp/mesh.yaml
[root@k8s-master istio-1.5.10]# kubectl -n istio-system create cm istio -o yaml --dry-run --from-file=mesh=/tmp/mesh.yaml | kubectl replace -f -
W0902 17:00:37.208604 16538 helpers.go:535] --dry-run is deprecated and can be replaced with --dry-run=client.
configmap/istio replaced
[root@k8s-master istio-1.5.10]# kubectl -n istio-system get cm istio -o jsonpath="{@.data.mesh}" | grep disablePolicyChecks
disablePolicyChecks: false
3. 删除为修补 istio configmap
而创建的临时文件
4. 总结
5. 参考: