Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

376
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda