<p>I am learning kubernetes ing GCP. I was trying out steps given in this <a href="https://www.youtube.com/watch?v=jSYxW_c3M_E&amp;list=PLTyWtrsGknYfanKF33E12LdJvl5q5PZGp&amp;index=4" rel="nofollow noreferrer">tutorial</a>.While doing deployment to cluster , we are doing <br></p>

<pre><code>kubectl run gcp-spring-app --image=gcr.io/secondproject-275119/gcp-app-image --port=9080
</code></pre>

<p>which gives below error<br></p>

<pre><code>kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/gcp-spring-app created
</code></pre>

<p>Upon searching the error i got that we should use <code>--generator=run-pod/v1</code> and command look like this now<br></p>

<pre><code>kubectl run --generator=run-pod/v1 gcp-spring-app --image=gcr.io/secondproject-275119/gcp-app-image --port=9080
</code></pre>

<p>It is actually working , but now when I do <code>kubectl get pods</code>, I am seeing multiple pods instead of one.Like below</p>

<pre><code>NAME                              READY   STATUS    RESTARTS   AGE
gcp-spring-app                    1/1     Running   0          36s
gcp-spring-app-67767bd649-jvg9h   1/1     Running   0          4m55s
</code></pre>

<p>Can anybody explain why these two got created as I need one also if I should tweak the command to get only one.</p>

Narendra Jaggi
<p>The pod gcp-spring-app-67767bd649-jvg9h is from your first invocation of the command. (Look at the 'age')
The second pod is from your second invocation.</p>

<p>Actually the deprecation notice does not prevent the execution, creating a job, which then creates the pod with the random suffix.</p>
