<p>I can't seem to find a simple answer to my question,</p>
<p>how to use linkerd inject command / options to add when using helm to install a package, e.g. like postgres?</p>
<p>I have done it with another package but that was by adding the annotation command to a values file and supplying that when running the helm install command.</p>
<p>With istio, all I have to do is to add a label on the namespace and it works?</p>
<p>So I started to look into adding the annotation to the namespaces I am working with, using the <code>kubectl create namespace</code> command?</p>
<p>However, I cant seem to find a way to add any annotation at the point of creating a namespace, unless I use a file.</p>
<p>So, I either need a way to add this annotation to the namespace with the create command or when installing packages with helm?</p>
<p>Thanks,</p>

C0ol_Cod3r
<p>I think there are a couple of ways to do this. It all depends on what you are trying to achieve and how you'd like to manage your underlying infrastructure.</p>
<p>I assume you want to automate the installation of helm charts. If you are going to create the namespace using <code>kubectl create namespace</code> then you might be able to follow that up with <code>kubectl annotate &lt;created-namespace&gt; &quot;linkerd.io/inject=enabled&quot;</code>.</p>
<p>Alternatively, you can make use of the <code>Linkerd CLI</code> and use the inject command provided -- the workflow here would involve a combination of <code>kubectl</code> and <code>linkerd</code> commands so I'm not sure it's what you're looking for. Nonetheless, you can do something like <code>kubectl create namespace &lt;my-namespace&gt; -o yaml | linkerd inject - | kubectl apply -f -</code>.</p>
<p>Last but not least, if you can use <code>kubectl create namespace</code> then you might be able to pipe the namespace manifest to kubectl directly and call it a day? You can use something similar to the snippet below:</p>
<pre><code>cat &lt;&lt;EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
  name: foo
  annotations:
    linkerd.io/inject: enabled
EOF
</code></pre>
