<p>I'm working through <a href="https://rads.stackoverflow.com/amzn/click/com/1617293725" rel="nofollow noreferrer" rel="nofollow noreferrer">Kubernetes in Action</a> (copyright 2018), and at least one of the examples is out-of-date with respect to current versions of <code>kubectl</code>.</p>
<p>Currently I'm stuck in section 2.3 on just trying to demo a simple web-server docker container (&quot;kubia&quot;):</p>
<pre><code>kubectl run kubia --image=Dave/kubia --port=8080 --generator=run/v1
</code></pre>
<p>the <a href="https://stackoverflow.com/a/53010591/1497199"><code>--generator</code> option has been removed</a> from current versions of <code>kubectl</code>.  What command(s) achieve the same end in the current version of <code>kubectl</code>?</p>
<p>Note: I'm literally just 2 chapters into learning about Kubernetes, so I don't really know what a deployment or anything else (so the official kubernetes docuementation doesn't help), I just need the simplest way to verify that that I can, in fact, run this container in my minikube &quot;cluster&quot;.</p>

<p>in short , you can use following commands to create pods and deployments (imperative way) using following commands which are similar to the commands mentioned in that book :</p>
<ul>
<li>To create a pod named <code>kubia</code> with image <code>Dave/kubia</code></li>
</ul>
<pre><code> kubectl run kubia --image=Dave/kubia --port=8080
</code></pre>
<ul>
<li>To create a deployment named <code>kubia</code> with image <code>Dave/kubia</code></li>
</ul>
<pre><code>kubectl create deployment kubia --image=Dave/kubia --port=8080
</code></pre>
