<pre><code>istioctl kube-inject \
--injectConfigFile inject-config.yaml \
--meshConfigFile mesh-config.yaml \
--valuesFile inject-values.yaml \
--filename samples/sleep/sleep.yaml \
| kubectl apply -f -
</code></pre>
<p>While trying to inject istio sidecar container manually to pod. I got error -</p>
<p>Error: template: inject:469: function &quot;appendMultusNetwork&quot; not defined</p>
<p><a href="https://istio.io/latest/docs/setup/additional-setup/sidecar-injection/" rel="nofollow noreferrer">https://istio.io/latest/docs/setup/additional-setup/sidecar-injection/</a></p>

ANKUSH KUMAR
<p>As mentioned in comments I have tried to reproduce your issue on gke with istio 1.7.4 installed.</p>
<p>I've followed the documentation you mentioned and it worked without any issues.</p>
<hr />
<p>1.Install istioctl and istio default profile</p>
<pre><code>curl -sL https://istio.io/downloadIstioctl | sh -
export PATH=$PATH:$HOME/.istioctl/bin
istioctl install
</code></pre>
<p>2.Create <code>samples/sleep</code> directory and create <a href="https://raw.githubusercontent.com/istio/istio/release-1.7/samples/sleep/sleep.yaml" rel="nofollow noreferrer">sleep.yaml</a>, for example with vi.</p>
<p>3.Create local copies of the configuration.</p>
<pre><code>kubectl -n istio-system get configmap istio-sidecar-injector -o=jsonpath='{.data.config}' &gt; inject-config.yaml
kubectl -n istio-system get configmap istio-sidecar-injector -o=jsonpath='{.data.values}' &gt; inject-values.yaml
kubectl -n istio-system get configmap istio -o=jsonpath='{.data.mesh}' &gt; mesh-config.yaml
</code></pre>
<p>4.Apply it with istioctl kube-inject</p>
<pre><code>istioctl kube-inject \
    --injectConfigFile inject-config.yaml \
    --meshConfigFile mesh-config.yaml \
    --valuesFile inject-values.yaml \
    --filename samples/sleep/sleep.yaml \
    | kubectl apply -f -
</code></pre>
<p>5.Verify that the sidecar has been injected</p>
<pre><code>kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
sleep-5768c96874-m65bg   2/2     Running   0          105s
</code></pre>
<hr />
<p>So there are few things worth to check as it might might cause this issue::</p>
<ul>
<li>Could you please check if you executed all your commands correctly?</li>
<li>Maybe you run older version of istio and you should follow older
<a href="https://istio.io/archive/" rel="nofollow noreferrer">documentation</a>?</li>
<li>Maybe you changed something in above local copies of the
configuration and that cause the issue? If you did what exactly did you change?</li>
</ul>
