Istio 安装成功但无法部署 POD

Istio Installation successful but not able to deploy POD

我已经在k8集群中成功安装了Istio

kubectl get pod -A

istio-system           istio-egressgateway-bd477794-8rnr6           1/1     Running   0          124m
istio-system           istio-ingressgateway-79df7c789f-fjwf8        1/1     Running   0          124m
istio-system           istiod-6dc55bbdd-89mlv                       1/1     Running   0          124

当我尝试部署示例 nginx 应用程序时,出现以下错误:

failed calling webhook sidecar-injector.istio.io context deadline exceeded
Post "https://istiod.istio-system.svc:443/inject?timeout=30s": 
context deadline exceeded

当我禁用自动代理 sidecar 注入时,pod 正在部署且没有任何错误。

kubectl label namespace default istio-injection-

我不确定如何解决这个问题,你能帮我解决这个问题吗?

在这种情况下,将 spec.template.spec 下的 hostNetwork:true 添加到 istiod 部署中可能会有所帮助。 这似乎是使用 Calico CNI 进行 pod 网络时的解决方法(参见:failed calling webhook "sidecar-injector.istio.io

我们可以在 Kubernetes Host namespaces documentation 中找到:

HostNetwork - Controls whether the pod may use the node network namespace. Doing so gives the pod access to the loopback device, services listening on localhost, and could be used to snoop on network activity of other pods on the same node.