How to change istio global parameter in sidecar inject-config.yaml

5/7/2019

I am trying to change istio global config parameter initialDelaySeconds value in inject-config.yaml

initialDelaySeconds: [[ annotation .ObjectMeta `readiness.status.sidecar.istio.io/initialDelaySeconds`  1  ]]

when i try below code sample for my initialDelaySeconds i am getting error..

$ kubectl get cm istio-sidecar-injector -n istio-system -o yaml | sed -e "s initialDelaySeconds: 1/ initialDelaySeconds: 10/" | kubectl apply -f -

Getting below error

 sed: -e expression #1, char 28: unknown option to `s'
 error: no objects passed to apply
 error: write /dev/stdout: The pipe has been ended.

what is correct syntax to change my global parameter in sidecar inject-config.xml

Also below code snippet works for me for rewriteAppHTTPProbe

$ kubectl get cm istio-sidecar-injector -n istio-system -o yaml | sed -e "s/ rewriteAppHTTPProbe: false/ rewriteAppHTTPProbe: true/" | kubectl apply -f -
-- pappu_kutty
azure
azure-aks
azure-kubernetes
istio
kubernetes

3 Answers

5/7/2019

you could just use kubectl edit to edit the configmap:

kubectl edit cm istio-sidecar-injector -n istio-system
-- 4c74356b41
Source: StackOverflow

5/7/2019

Regular kubectl edit cm will work only for open source Istio.

Otherwise, if you are using Istio as GKE cluster add-on it'll be a bit tricky, because all edits are getting reconciled by mixer running on the master node. What you can do is to dump your configmap --> injection-cm, make edits you want and then use it for manual injections, i.e.

istioctl kube-inject -f deployment.yaml --injectConfigMapName injection-cm

More info here

-- A_Suh
Source: StackOverflow

5/7/2019

share the below yaml file if possible istio-sidecar-injector -n istio-system -o yaml

try this

kubectl get cm istio-sidecar-injector -n istio-system -o yaml | sed -e "s/rewriteAppHTTPProbe: false/grewriteAppHTTPProbe: true/g" | kubectl apply -f -


master $ cat testfile
initialDelaySeconds: [[ annotation .ObjectMeta `readiness.status.sidecar.istio.io/initialDelaySeconds`  1]]

sed -i '/initialDelaySeconds:/c\initialDelaySeconds: 10' testfile

master $ cat testfile
initialDelaySeconds: 10
-- P Ekambaram
Source: StackOverflow