<p>I have a ServiceAccount YAML file which I am applying to a new cluster.</p>
<p>My YAML is like below:</p>
<pre><code>apiVersion: v1
items:
- apiVersion: v1
  kind: ServiceAccount
  metadata:
    creationTimestamp: 2019-03-20T23:17:42Z
    name: default
    namespace: dev4
    resourceVersion: &quot;80999&quot;
    selfLink: /api/v1/namespaces/dev4/serviceaccounts/default
    uid: 5c6e0d09-4b66-11e9-b4e3-0a779a87bb40
  secrets:
  - name: default-token-tl4dd
- apiVersion: v1
  kind: ServiceAccount
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;ServiceAccount&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;name&quot;:&quot;pod-labeler&quot;,&quot;namespace&quot;:&quot;dev4&quot;}}
    creationTimestamp: 2020-04-21T05:46:25Z
    name: pod-labeler
    namespace: dev4
    resourceVersion: &quot;113455688&quot;
    selfLink: /api/v1/namespaces/dev4/serviceaccounts/pod-labeler
    uid: 702dadda-8393-11ea-abd9-0a768ca51346
  secrets:
  - name: pod-labeler-token-6vgp7
kind: List
metadata:
  resourceVersion: &quot;&quot;
  selfLink: &quot;&quot;
</code></pre>
<p>When I apply to the new EKS Cluster at version 1.16, by the command <code>kubectl apply -f &lt;yaml file&gt;</code>
I get the error as below:</p>
<pre><code>Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
Error from server (Conflict): Operation cannot be fulfilled on serviceaccounts &quot;default&quot;: the object has been modified; please apply your changes to the latest version and try again
Error from server (Conflict): Operation cannot be fulfilled on serviceaccounts &quot;pod-labeler&quot;: the object has been modified; please apply your changes to the latest version and try again
</code></pre>

learner
<p>Remove <code>resourceVersion</code>, <code>selfLink</code> and <code>uid</code> from the yaml before applying. Kubernetes maintains consistency of objects using version and trying to override it with a wrong version leads to this error.</p>
<pre><code>resourceVersion: &quot;80999&quot;
selfLink: /api/v1/namespaces/dev4/serviceaccounts/default
uid: 5c6e0d09-4b66-11e9-b4e3-0a779a87bb40
...
resourceVersion: &quot;113455688&quot;
selfLink: /api/v1/namespaces/dev4/serviceaccounts/pod-labeler
uid: 702dadda-8393-11ea-abd9-0a768ca51346
</code></pre>
