<p>I'm running the example in chapter &quot;Service Discovery&quot; of the book &quot;Kubernetes up and running&quot;. The original command to run a deployment is <code>kubectl run alpaca-prod --image=gcr.io/kuar-demo/kuard-amd64:blue --replicas=3 --port=8080 --labels=&quot;ver=1,app=alpaca,env=prod&quot;</code>, however in K8s version 1.25, the <code>--replicate</code> parameter in run command is not supported any more. I planned to run without replica and then use &quot;kubectl scale&quot; to scale the deployment later. Problem is the run command only creates a pod, not a deployment (the scale command expects a deployment). So how do i promote my pod to a deployment, my kubernetes verion is 1.25?</p>

Nguyen Tan Bao
<p>There is no way to promote it however you can change label and all those stuff but instead of that you can create the new deployment delete the existing POD.</p>
<p>So easy step you can take input of existing running POD to YAML file first</p>
<pre><code>kubectl get pod &lt;POD name&gt; -o yaml &gt; pod-spec.yaml
</code></pre>
<p>Create deployment spec YAML file now</p>
<pre><code>kubectl create deployment deploymentname --image=imagename --dry-run=client -o yaml &gt; deployment-spec.yaml
</code></pre>
<p>Edit the <strong>deployment-spec.yaml</strong> file</p>
<p>and in other tab <strong>pod-spec.yaml</strong> you can copy the Spec part from POD file to new deployment file.</p>
<p>Once <strong>deployment-spec.yaml</strong> is ready you can apply it. Make sure if you are running service labels get matched properly</p>
<pre><code>kubectl apply -f deployment-spec.yaml
</code></pre>
<p>Delete the single running POD</p>
<pre><code>kubectl delete pod &lt;POD name&gt;
</code></pre>
