CKS-CN 考试知识点分享(14) Istio网络策略 - 实践

考试版本:cks-cn v1.33

Context

您必须使用 Istio 保护使用未加密的第4层(L4)传输的基于微服务的应用程序。

Task

执行以下任务以使用 Istio 保护现有应用程序的第4层(L4)传输通信。
为了保护第4层(L4)通信,已安装lstio。
通过您能够使用浏览器访问 Istio 的文档。
先,确保 mtls namespace 中的所有 Pod 都已注入 istio-proxy sidecar 。
接下来,为 mtls namespace 中的所有工作负载配置严格模式下的相互身份验证。

Answer

参考链接
https://istio.io/v1.24/docs/setup/additional-setup/sidecar-injection/
https://istio.io/v1.24/docs/reference/config/security/peer_authentication/

kubectl label namespace default istio-injection=enabled

重启命令空间下所有deployment
kubectl -n mtls rollout restart deployment

自动注入sidecar

在这里插入图片描述

开启严格模式

vim istio.yaml

apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: mtls
spec:
mtls:
mode: STRICT

kubectl apply -f istio.yaml

posted on 2025-10-22 15:22  ljbguanli  阅读(2)  评论(0)    收藏  举报