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

Improve k8s function definitions #199

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
23 changes: 16 additions & 7 deletions holmes/plugins/toolsets/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,26 @@ toolsets:

tools:
- name: "kubectl_describe"
description: "Run kubectl describe on a Kubernetes resource"
description: >
Run kubectl describe <kind> <name> -n <namespace>,
call this when users ask for description,
for example when a user asks
- 'describe pod xyz-123'
- 'show service xyz-123 in namespace my-ns'
command: "kubectl describe {{ kind }} {{ name }}{% if namespace %} -n {{ namespace }}{% endif %}"

- name: "kubectl_get"
description: "Run `kubectl get <parameters go here> --show-labels`"
command: "kubectl get --show-labels -o wide {{ kind }} {{ name}}{% if namespace %} -n {{ namespace }}{% endif %}"
- name: "kubectl_get_by_name"
description: "Run `kubectl get <kind> <name> --show-labels`"
command: "kubectl get --show-labels -o wide {{ kind }} {{ name }}{% if namespace %} -n {{ namespace }}{% endif %}"

- name: "kubectl_get_all"
description: "Run `kubectl get -A <kind> --show-labels` to get all resources of a given type in the cluster"
command: "kubectl get -A --show-labels -o wide {{ kind }}"
- name: "kubectl_get_by_kind_in_namespace"
description: "Run `kubectl get <kind> -n <namespace> --show-labels` to get all resources of a given type in namespace"
command: "kubectl get --show-labels -o wide {{ kind }} -n {{namespace}}"

- name: "kubectl_get_by_kind_in_cluster"
description: "Run `kubectl get -A <kind> --show-labels` to get all resources of a given type in the cluster"
command: "kubectl get -A --show-labels -o wide {{ kind }}"

- name: "kubectl_find_resource"
description: "Run `kubectl get {{ kind }} -A --show-labels | grep {{ keyword }}` to find a resource where you know a substring of the name, IP, namespace, or labels"
command: "kubectl get -A --show-labels -o wide {{ kind }} | grep {{ keyword }}"
Expand Down
Loading