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

375
Visualizações
Unable to apply the ! not operator with JSONPath query to get nodes without taints

I'm trying to get the list of my Kubernetes cluster nodes based on some condition i.e. if Taint exists or not. I have 3 node cluster (1 master and 2 worker). I need to get the 2 worker node names as the taint is on master node. I'm stuck here as I'm getting the opposite result i.e. able to get the node with taint (master). Please assist to help me to put ! operator so that I can get only nodes without any taints.

This is my JSONPath query till now:-

vagrant@mykubemaster:~$ kubectl get nodes
NAME           STATUS   ROLES                  AGE   VERSION
mykubemaster   Ready    control-plane,master   12d   v1.20.1
mykubenode01   Ready    <none>                 12d   v1.20.1
mykubenode02   Ready    <none>                 12d   v1.20.1
vagrant@mykubemaster:~$ kubectl get nodes -o=jsonpath='{$.items[?(@.spec.taints)].metadata.name}'
mykubemastervagrant@mykubemaster:~$
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Kubernetes/kubectl is using a Go JSONPath implementation that (sadly) does not support path filter expressions with a negation; in fact, many implementations do not support syntax like:

$[?(!(@.key==42))]

See this extensive comparisons:

  • Filter expression with negation and equals &
  • Filter expression with negation and less
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