如何覆盖应用程序部署中的istio-proxy选项?

问题描述 投票:0回答:1

我想将istio-proxy的--connectTimeout设置为2s,而不是默认的10s。是否可以覆盖istio-sidecar-injector配置映射中定义的选项值?

containers:
  - name: istio-proxy
    image: [[ annotation .ObjectMeta `sidecar.istio.io/proxyImage`  "registry.cn-beijing.aliyuncs.com/aliacs-app-catalog/proxyv2:1.0.5"  ]]

    ports:
    - containerPort: 15090
      protocol: TCP
      name: http-envoy-prom

    args:
    - proxy
    - sidecar
    - --configPath
    - [[ .ProxyConfig.ConfigPath ]]
    - --binaryPath
    - [[ .ProxyConfig.BinaryPath ]]
    - --serviceCluster
    [[ if ne "" (index .ObjectMeta.Labels "app") -]]
    - [[ index .ObjectMeta.Labels "app" ]]
    [[ else -]]
    - "istio-proxy"
    [[ end -]]
    - --drainDuration
    - [[ formatDuration .ProxyConfig.DrainDuration ]]
    - --parentShutdownDuration
    - [[ formatDuration .ProxyConfig.ParentShutdownDuration ]]
    - --discoveryAddress
    - [[ annotation .ObjectMeta `sidecar.istio.io/discoveryAddress` .ProxyConfig.DiscoveryAddress ]]
    - --discoveryRefreshDelay
    - [[ formatDuration .ProxyConfig.DiscoveryRefreshDelay ]]
    - --zipkinAddress
    - [[ .ProxyConfig.ZipkinAddress ]]
    - --connectTimeout
    - [[ formatDuration .ProxyConfig.ConnectTimeout ]]
    - --proxyAdminPort
    - [[ .ProxyConfig.ProxyAdminPort ]]
    [[ if gt .ProxyConfig.Concurrency 0 -]]
    - --concurrency
    - [[ .ProxyConfig.Concurrency ]]
    [[ end -]]
...
kubernetes istio
1个回答
0
投票

最简单的方法是kubectl edit configmaps istio-sidecar-injector -n istio-system

只需使用您想要的值更改模板[[ formatDuration .ProxyConfig.ConnectTimeout ]]即可。

如果您使用Helm部署Istio,您可以更改图表。

您还可以将istio-sidecar-injector的配置映像作为YAML并将其保存到文件中。

kubectl get configmaps istio-sidecar-injector -n istio-system -o yaml > istio-sidecar-injector.yaml

此外,这可能对你有帮助kubernetes / Best practice to inject values to configMap

© www.soinside.com 2019 - 2024. All rights reserved.