<p>Very new to Kubernetes. In the past I've used <code>kubectl</code>/Kustomize to deploy pods/services using the same repetitive pattern:</p>
<ol>
<li>On the file system, in my project, I'll have two YAML files such as <code>kustomization.yml</code> and <code>my-app-service.yml</code> that look something like:</li>
</ol>
<h3><code>kustomization.yml</code></h3>
<pre><code>resources:
  - my-app-service.yml
</code></pre>
<h3><code>my-app-service.yml</code></h3>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-app-service
  ... etc.
</code></pre>
<ol start="2">
<li>From the command-line, I'll run something like the following:</li>
</ol>
<pre><code>kubectl apply -k /path/to/the/kustomization.yml
</code></pre>
<p>And if all goes well -- <strong>boom</strong> -- I've got the service running on my cluster. Neato.</p>
<p>I am now trying to troubleshoot something and want to deploy a single container of the <a href="https://hub.docker.com/r/google/cloud-sdk/" rel="nofollow noreferrer"><code>google/cloud-sdk</code></a> image on my cluster, so that I can SSH into it and do some network/authorization-related testing.</p>
<p>The idea is:</p>
<ol>
<li>Deploy it</li>
<li>SSH in, do my testing</li>
<li>Delete the container/clean it up</li>
</ol>
<p>I <em>believe</em> K8s doesn't deal with containers and so I'll probably need to deploy a 1-container pod or service (not clear on the difference there), but you get the idea.</p>
<p>I <em>could</em> just create 2 YAML files and run the <code>kubectl apply ...</code> on them like I do for everything else, but that feels a bit heavy-handed. I'm wondering if there is an easier way to do this all from the command-line without having to create YAML files each time I want to do a test like this. <strong>Is there?</strong></p>

hotmeatballsoup
<p>You can create a pod running a container with the given image with this command:</p>
<pre><code>kubectl run my-debug-pod --image=google/cloud-sdk
</code></pre>
<hr />
<p>And if you want to create a Deployment without writing the Yaml, you can do:</p>
<pre><code>kubectl create deployment my-app --image=my-container-image
</code></pre>
<p>You could also just generate the Yaml and save it to file, and then use <code>kubectl apply -f deployment.yaml</code>, generate it with:</p>
<pre><code>kubectl create deployment my-app --image=my-container-image \ 
--dry-run=client -o yaml &gt; deployment.yaml
</code></pre>
