<p>I am migrating the Kubernetes deployments from API version <code>extensions/v1beta1</code> to <code>apps/v1</code>.</p>
<p>I've changed the API group in deployment to <code>apps/v1</code> and applied the deployment.</p>
<p>However when I check the deployment using <code>get deployment -o yaml</code> it's showing deployment in <code>extensions/v1beta1</code> API group and when I check using <code>get deployment.apps -o yaml</code>, it's showing in <code>app/v1</code> API group.</p>
<p>can you please let us know a way to identify the API group of the created deployment YAML other than displaying the YAMLs using the commands <code>get deployment -o yaml</code> or <code>get deployment.app -o yaml</code> since the output apiVersion is just based on the command we give irrespective of the one with which it was created.</p>
<p>I just need to make sure that my deployment is migrated to <code>apps/v1</code>.</p>

codewarrior
<p>As I understand, you want to view the last applied configuration for the deployments?</p>
<p>If yes, you should use <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-view-last-applied-em-" rel="nofollow noreferrer"><code>kubectl apply view-last-applied</code> command</a>.</p>
<p>Example for the one specific deployment:</p>
<pre><code>kubectl apply view-last-applied deployment {your-deployment-name}
</code></pre>
<p>Example for the all deployments:</p>
<pre><code>kubectl get deployments -o name | xargs kubectl apply view-last-applied
</code></pre>
