I have a Kubernetes cluster running in minikube, I want to filter out all Logstash pods via Kubernetes API. Kubernetes API documentation is a bit confusing, I did some research and found out that I can use something like this, but I have been unsuccessful so far:
localhost:8000/api/v1/namespaces/default/pods?labelSelector=logstash
any ideas how to retrieve this? Any help would be really appreciated.
any ideas how to retrieve this?
Since labels are defined in <name>=<value>
pairs you need to supply both, as described in the documentation (see the API
section)
As an example, supposing you have:
Then your api call would look like this:
curl localhost:8000/api/v1/namespaces/default/pods?labelSelector=role%3Dops,application%3Dlogstash