<p>As per kubectl documentation, kubectl apply is possible by using a file or stdin. My usecase is that there would be service/deployment json strings in runtime and I have to deploy those in clusters using nodejs. Of course, I can create files and just do kubectl apply -f thefilename. But, I don't want to create files. Is there any approach where I can do like below:</p>
<pre><code>kubectl apply &quot;{&quot;apiVersion&quot;: &quot;extensions/v1beta1&quot;,&quot;kind&quot;: &quot;Ingress&quot;...}&quot;
</code></pre>
<p>For the record, I am using node_ssh library.</p>

CuteBoy
<pre><code>echo 'your manifest' | kubectl create -f -
</code></pre>
<p>Reference:</p>
<ul>
<li><a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply</a></li>
</ul>
