<p>In kubernetes 1.8, when I create a deployment for example</p>

<pre><code>apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80
</code></pre>

<p>Then when I do a </p>

<pre><code>kubectl get deploy nginx-deployment -o yaml
</code></pre>

<p>I got</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  creationTimestamp: 2018-01-24T01:01:01Z

....
</code></pre>

<p>Why the apiversion is extension/v1beta1 instead of apiVersion: apps/v1beta2 </p>

<p>When you create a deployment, the apiserver persists it and is capable of converting the persisted deployment into any supported version. </p>

<p><code>kubectl get deployments</code> actually requests the extensions/v1beta1 version (you can see this by adding --v=6)</p>

<p>To get apps/v1beta2 deployments, do <code>kubectl get deployments.v1beta2.apps</code></p>
