<p>I am upgrading K8s from 1.15 to 1.16. Before I do it, I must migrate my daemonsets, deployment, statefulset etc. to the apps/v1 version. But when I do it, I don't understand the K8s behaviour.</p>
<p>Let's say, that we have a daemonset:</p>
<pre><code>apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
  name: spot-interrupt-handler
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: spot-interrupt-handler
  template:
    metadata:
      labels:
        app: spot-interrupt-handler
    spec:
      serviceAccountName: spot-interrupt-handler
      containers:
      - name: spot-interrupt-handler
        image: madhuriperi/samplek8spotinterrupt:latest
        imagePullPolicy: Always
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: SPOT_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
      nodeSelector:
        lifecycle: Ec2Spot
</code></pre>
<p>I change the first line to <strong>apps/v1</strong> and successfully apply this yaml to K8s. Nothing changes after it, the pods are not restarted.
I get this notification:</p>
<pre><code>daemonset.apps/spot-interrupt-handler configured
</code></pre>
<ol>
<li>Is it a normal behavior? Shouldn't it be restarted after I change the API version?</li>
</ol>
<p>Then I want to see, that this API version change is really applied to K8s etcd.</p>
<pre><code>kubectl get ds spot-interrupt-handler -n default -o yaml
</code></pre>
<p>And that is what I see at the start of the yaml definition:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {&quot;apiVersion&quot;:&quot;apps/v1&quot;,&quot;kind&quot;:&quot;DaemonSet&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;name&quot;:&quot;spot-interrupt-handler&quot;,&quot;namespace&quot;:&quot;default&quot;},&quot;spec&quot;:{&quot;selector&quot;:{&quot;matchLabels&quot;:{&quot;app&quot;:&quot;spot-interrupt-handler&quot;}},&quot;template&quot;:{&quot;metadata&quot;:{&quot;labels&quot;:{&quot;app&quot;:&quot;spot-interrupt-handler&quot;}},&quot;spec&quot;:{&quot;containers&quot;:[{&quot;env&quot;:[{&quot;name&quot;:&quot;POD_NAME&quot;,&quot;valueFrom&quot;:{&quot;fieldRef&quot;:{&quot;fieldPath&quot;:&quot;metadata.name&quot;}}},{&quot;name&quot;:&quot;NAMESPACE&quot;,&quot;valueFrom&quot;:{&quot;fieldRef&quot;:{&quot;fieldPath&quot;:&quot;metadata.namespace&quot;}}},{&quot;name&quot;:&quot;SPOT_POD_IP&quot;,&quot;valueFrom&quot;:{&quot;fieldRef&quot;:{&quot;fieldPath&quot;:&quot;status.podIP&quot;}}}],&quot;image&quot;:&quot;madhuriperi/samplek8spotinterrupt:latest&quot;,&quot;imagePullPolicy&quot;:&quot;Always&quot;,&quot;name&quot;:&quot;spot-interrupt-handler&quot;}],&quot;nodeSelector&quot;:{&quot;lifecycle&quot;:&quot;Ec2Spot&quot;},&quot;serviceAccountName&quot;:&quot;spot-interrupt-handler&quot;}}}}
  creationTimestamp: &quot;2021-02-09T08:34:33Z&quot;
</code></pre>
<ol start="2">
<li>Why is <strong>extensions/v1beta1</strong> on the top? I expect it to be <strong>apps/v1</strong>.</li>
<li>I see, that the new version of API is in the last-applied-configuration. Does it mean, that this DaemonSet will work after the upgrade to 1.16?</li>
</ol>
<p>Thanks in advance</p>

dice2011
<p>I've reproduced your setup in GKE environment and after upgrading kubernetes version from 1.15 to 1.16 daemonset's <code>apiVersion</code> has changed to <code>apiVersion: apps/v1</code>.</p>
<p>I've started with GKE version <code>1.15.12</code> and applied your configuration. Once successfully applied I've changed apiVersion to <code>apps/v1</code>,  <code>extensions/v1beta1</code> has remained as the current <code>apiVersion</code>.</p>
<p>After upgrading kubernetes version to
<code>version.Info{Major:&quot;1&quot;, Minor:&quot;16+&quot;, GitVersion:&quot;v1.16.15-gke.6000&quot;</code> the DS in now  <code>apps/v1</code>.</p>
<p>To check if the same behavior will happen again I've created a DS and upgraded kubernetes version without changing apiVersion and it has changed by itself to <code>apps/v1</code>.</p>
