Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubectl jq #168

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ COPY . /app
RUN apt-get update \
&& apt-get install -y \
git \
jq \
apt-transport-https \
gnupg2 \
&& apt-get purge -y --auto-remove \
Expand Down
3 changes: 3 additions & 0 deletions holmes/plugins/toolsets/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ toolsets:
#- name: "healthcheck_plugin"
# description: "Check why a kubernetes health probe is failing. First call get_healthcheck_details"
# command: "kubectl exec -n {{namespace}} {{ pod_name }} -- wget {{ url }}:{{port}}"
- 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 }}

# try adding your own tools here!
# e.g. to query company-specific data or run your own commands
Expand Down
Loading