简体   繁体   中英

Error: template: inject:469: function "appendMultusNetwork" not defined

istioctl kube-inject \
--injectConfigFile inject-config.yaml \
--meshConfigFile mesh-config.yaml \
--valuesFile inject-values.yaml \
--filename samples/sleep/sleep.yaml \
| kubectl apply -f -

While trying to inject istio sidecar container manually to pod. I got error -

Error: template: inject:469: function "appendMultusNetwork" not defined

https://istio.io/latest/docs/setup/additional-setup/sidecar-injection/

As mentioned in comments I have tried to reproduce your issue on gke with istio 1.7.4 installed.

I've followed the documentation you mentioned and it worked without any issues.


1.Install istioctl and istio default profile

curl -sL https://istio.io/downloadIstioctl | sh -
export PATH=$PATH:$HOME/.istioctl/bin
istioctl install

2.Create samples/sleep directory and create sleep.yaml , for example with vi.

3.Create local copies of the configuration.

kubectl -n istio-system get configmap istio-sidecar-injector -o=jsonpath='{.data.config}' > inject-config.yaml
kubectl -n istio-system get configmap istio-sidecar-injector -o=jsonpath='{.data.values}' > inject-values.yaml
kubectl -n istio-system get configmap istio -o=jsonpath='{.data.mesh}' > mesh-config.yaml

4.Apply it with istioctl kube-inject

istioctl kube-inject \
    --injectConfigFile inject-config.yaml \
    --meshConfigFile mesh-config.yaml \
    --valuesFile inject-values.yaml \
    --filename samples/sleep/sleep.yaml \
    | kubectl apply -f -

5.Verify that the sidecar has been injected

kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
sleep-5768c96874-m65bg   2/2     Running   0          105s

So there are few things worth to check as it might might cause this issue::

  • Could you please check if you executed all your commands correctly?
  • Maybe you run older version of istio and you should follow older documentation ?
  • Maybe you changed something in above local copies of the configuration and that cause the issue? If you did what exactly did you change?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM