Skip to content

Commit

Permalink
Kubectl jq (#168)
Browse files Browse the repository at this point in the history
Co-authored-by: arik <[email protected]>
Co-authored-by: Dima Chievtaiev <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2025
1 parent b3f5961 commit 2f6b61a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion holmes/plugins/toolsets/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ toolsets:
}
print namespace, name, sum_memory(requests) " Mi";
}' | sort -k3 -nr
- name: "kubernetes_jq_query"
description: >
Use kubectl to get json for all resources of a specific kind pipe the results to jq to filter them. Do not worry about escaping the jq_expr it will be done by the system on an unescaped expression that you give. e.g. give an expression like .items[] | .spec.containers[].image | select(test("^gcr.io/") | not)
command: kubectl get {{ kind }} --all-namespaces -o json | jq -r {{ jq_expr }}


# NOTE: this is only possible for probes with a healthz endpoint - we do this to avoid giving the LLM generic
# http GET capabilities which are more powerful than we want to expose
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2f6b61a

Please sign in to comment.