<p>I could not get around, how to inject Linkerd sidecar to a docker yaml file and save it to a different file name. Honestly i have tried to go through linkerd docs but could not really get the idea. Following commands did not help me to understand:-</p>

<pre><code># Inject all the deployments in the default namespace.
kubectl get deploy -o yaml | linkerd inject - | kubectl apply -f -

# Injecting a file from a remote URL
linkerd inject http://url.to/yml | kubectl apply -f -

# Inject all the resources inside a folder and its sub-folders.
linkerd inject &lt;folder&gt; | kubectl apply -f -
</code></pre>

<p>I want to inject linkerd sidecar to a docker yaml like following command, which helps me to inject istio sidecar to a docker yaml file and save it in different file name:-</p>

<pre><code>istioctl kube-inject -f deployment.yaml -o deployment-injected.yaml
</code></pre>

Urgen
<p><code>linkerd inject</code> modifies resources to include the <code>linkerd.io/inject: enabled</code> annotation. If you want to store this modified version, you can use simple shell redirection like:</p>

<pre><code>:; linkerd inject deploy.yml &gt;deploy-annotated.yml

namespace "myns" injected
service "mysvc" skipped
deployment "mydeploy" injected
:; diff deploy.yml deploy-annotated.yml
17a18,19
&gt;   annotations:
&gt;     linkerd.io/inject: enabled
72a75,76
&gt;       annotations:
&gt;         linkerd.io/inject: enabled
</code></pre>

<p>This uses Linkerd's proxy-injector admission controller to add sidecar containers at pod-creation time.</p>

<p>Alternatively, you can "manually" inject the proxy locally, though this is generally discouraged, since it prevents your application from automatically getting new proxy versions &amp; configuration. Also, the generated configuration is much larger:</p>

<pre><code>:; linkerd inject --manual deploy.yml &gt;deploy-manual.yml

namespace "myns" injected
service "mysvc" skipped
deployment "mydeploy" injected
:; du -sh deploy.yml deploy-manual.yml
4.0K    deploy.yml
8.0K    deploy-manual.yml
</code></pre>
