Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/

like image 648
ANKUSH KUMAR Avatar asked Dec 21 '25 00:12

ANKUSH KUMAR


1 Answers

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?
like image 119
Jakub Avatar answered Dec 23 '25 15:12

Jakub