Skip to content

Commit

Permalink
Update k8s tools
Browse files Browse the repository at this point in the history
  • Loading branch information
moshemorad committed Dec 12, 2024
1 parent d2d6d31 commit a5105a7
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions holmes/plugins/toolsets/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ toolsets:
prerequisites:
- command: "kubectl version --client"

tools:
- name: "kubectl_describe"
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_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_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 }}"
tools:
- name: "kubectl_describe"
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_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_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 }}"

- name: "kubectl_get_yaml"
description: "Run `kubectl get -o yaml` on a single Kubernetes resource"
Expand Down

0 comments on commit a5105a7

Please sign in to comment.