Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

267
Visualizações
kubectl apply reports error "Operation cannot be fulfilled on serviceaccounts"

I have a ServiceAccount YAML file which I am applying to a new cluster.

My YAML is like below:

apiVersion: v1
items:
- apiVersion: v1
  kind: ServiceAccount
  metadata:
    creationTimestamp: 2019-03-20T23:17:42Z
    name: default
    namespace: dev4
    resourceVersion: "80999"
    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: |
        {"apiVersion":"v1","kind":"ServiceAccount","metadata":{"annotations":{},"name":"pod-labeler","namespace":"dev4"}}
    creationTimestamp: 2020-04-21T05:46:25Z
    name: pod-labeler
    namespace: dev4
    resourceVersion: "113455688"
    selfLink: /api/v1/namespaces/dev4/serviceaccounts/pod-labeler
    uid: 702dadda-8393-11ea-abd9-0a768ca51346
  secrets:
  - name: pod-labeler-token-6vgp7
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

When I apply to the new EKS Cluster at version 1.16, by the command kubectl apply -f <yaml file> I get the error as below:

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 "default": 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 "pod-labeler": the object has been modified; please apply your changes to the latest version and try again
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Remove resourceVersion, selfLink and uid 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.

resourceVersion: "80999"
selfLink: /api/v1/namespaces/dev4/serviceaccounts/default
uid: 5c6e0d09-4b66-11e9-b4e3-0a779a87bb40
...
resourceVersion: "113455688"
selfLink: /api/v1/namespaces/dev4/serviceaccounts/pod-labeler
uid: 702dadda-8393-11ea-abd9-0a768ca51346
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda