how to override the istio-proxy option in the app deployment?

2/13/2019

I want to set --connectTimeout of istio-proxy to be 2s, other than the default 10s. Is it possible to override the option value defined in the istio-sidecar-injector configMap?

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 -]]
...
-- Jeffrey
istio
kubernetes

1 Answer

2/22/2019

Easiest way would be kubectl edit configmaps istio-sidecar-injector -n istio-system

Just change the template [[ formatDuration .ProxyConfig.ConnectTimeout ]] with the value you desired.

If you used Helm to deploy Istio you can change the charts.

You can also get configmaps of istio-sidecar-injector as YAML and save it into a file.

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

Also, this might be helpful for you kubernetes / Best practice to inject values to configMap.

-- Crou
Source: StackOverflow