<p>I want to update bunch of ingress.yaml files in my microservices project to use the new kubernetes API version. Currently the ingresses are using <code>apiVersion: extensions/v1beta1</code> still.</p>
<p>I'm confused with the plugin (<code>kubectl convert</code>) and the whole new binary (<code>kubectl-convert</code>)... Which tool should I be using in 2023?</p>
<p>I would like to have a one liner command to update all <code>ingress.yaml</code> files recursively inside current directory.</p>
<p>Maybe the new tool has some bugs in it? I'm getting this error with the bash script I assumed would work:</p>
<pre><code>find . -name &quot;ingress.yaml&quot; | while read file; do kubectl-convert -f &quot;$file&quot; &gt; &quot;$file&quot;; done
error: no objects passed to convert
</code></pre>

Heikki
<p>I prefer to use <code>kubectl convert</code> plugin and the following cmd should do the trick for you:</p>
<pre><code>find . -name &quot;ingress.yaml&quot; | while read file; do kubectl convert -f &quot;$file&quot; --output-version networking.k8s.io/v1 &gt; &quot;$file&quot;.bak &amp;&amp; mv &quot;$file&quot;.bak &quot;$file&quot;; done
</code></pre>
<p>Tested locally on a set of 3 ingress.yaml file nested within different sub-folders.</p>
<p>I've assumed you're moving from <code>extensions/v1beta1</code> to <code>networking.k8s.io/v1</code>.</p>
<p>As is the general practice, make sure to back up your files before running this (or any such) command, in case of any unexpected issues.</p>
<p>Hope this helps.</p>
