ImageAutoWithoutInjectionWarning

当某个 Deployment 包含使用 image: auto 的 istio-proxy 容器, 但没有任何 Istio 注入 Webhook 选择该 Deployment 的 Pod 时,会出现此消息。

auto 镜像是一个占位符,Sidecar 注入器会将其替换为正确的镜像。 这是安装网关的常用方法。 如果没有发生注入,Pod 将无法拉取镜像 auto,也无法启动。

示例

假设在未启用注入的命名空间中有如下 Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: istio-ingressgateway
spec:
  selector:
    matchLabels:
      istio: ingressgateway
  template:
    metadata:
      labels:
        istio: ingressgateway
    spec:
      containers:
      - name: istio-proxy
        image: auto

您将收到以下消息:

Warning [IST0146] (Deployment default/istio-ingressgateway) Deployment istio-ingressgateway contains `image: auto` but does not match any Istio injection webhook selectors.

如何修复

为 Pod 启用注入。例如,为命名空间添加 istio-injection=enabled 标签, 或为 Pod 模板添加 sidecar.istio.io/inject: "true" 标签。 如果您使用了修订版本,请使用带有正确修订版本的 istio.io/rev 标签。