Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

373
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!