Skip to content

Commit

Permalink
feat: argocd toolset, use env var
Browse files Browse the repository at this point in the history
  • Loading branch information
nherment committed Dec 10, 2024
1 parent 9decbcb commit ea16ad2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,15 @@ HolmesGPT can consult webpages containing runbooks or other relevant information
HolmesGPT uses playwright to scrape webpages and requires playwright to be installed and working through `playwright install`.
</details>

<details>
<summary>
ArgoCD
</summary>

Holmes can use the `argocd` CLI to get details about the ArgoCD setup like the apps contifuration and status, clusters and projects within ArgoCD.
To enable ArgoCD, set the `ARGOCD_AUTH_TOKEN` environment variable as described in the [argocd documentation](https://argo-cd.readthedocs.io/en/latest/user-guide/commands/argocd_account_generate-token/).
</details>

## More Use Cases

HolmesGPT was designed for incident response, but it is a general DevOps assistant too. Here are some examples:
Expand Down
1 change: 1 addition & 0 deletions holmes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def create_tool_executor(
)

enabled_toolsets = [ts for ts in matching_toolsets if ts.is_enabled()]
print(f"toolsets={str([ts.name for ts in enabled_toolsets])}")
for ts in all_toolsets:
if ts not in matching_toolsets:
console.print(
Expand Down
1 change: 0 additions & 1 deletion holmes/plugins/prompts/_general_instructions.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ Special cases and how to reply:
* Issues are a subset of findings. When asked about an issue or a finding and you have an id, use the tool `fetch_finding_by_id`.
* For any question, try to make the answer specific to the user's cluster.
** For example, if asked to port forward, find out the app or pod port (kubectl decribe) and provide a port forward command specific to the user's question
* If you need to use ArgoCD tools, ask the user for their argocd auth_token if they haven't given it yet
16 changes: 8 additions & 8 deletions holmes/plugins/toolsets/argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ toolsets:
tools:
- name: "argocd_app_get"
description: "Retrieve information about an existing application, such as its status and configuration"
command: "argocd app get {{ app_name }} --show-operation -o yaml --auth-token {{ auth_token }}"
command: "argocd app get {{ app_name }} --show-operation -o yaml"

- name: "argocd_app_diff"
description: "Display the differences between the current state of an application and the desired state specified in its Git repository"
command: "argocd app diff {{ app_name }} --auth-token {{ auth_token }}"
command: "argocd app diff {{ app_name }}"

- name: "argocd_app_list"
description: "List the applications in Argocd"
command: "argocd app list --auth-token {{ auth_token }}"
command: "argocd app list"

- name: "argocd_app_history"
description: "List the deployment history of an application in ArgoCD"
command: "argocd app history {{app_name}} --app-namespace {{namespace}} --auth-token {{ auth_token }}"
command: "argocd app history {{app_name}} --app-namespace {{namespace}}"

- name: "argocd_repo_list"
description: "List all the Git repositories that ArgoCD is currently managing"
command: "argocd repo list --auth-token {{ auth_token }}"
command: "argocd repo list"

- name: "argocd_proj_list"
description: "List all available projects"
command: "argocd proj list {{ project_name }} --auth-token {{ auth_token }}"
command: "argocd proj list {{ project_name }}"

- name: "argocd_proj_get"
description: "Retrieves information about an existing project, such as its applications and policies"
command: "argocd proj get {{ project_name }} --auth-token {{ auth_token }}"
command: "argocd proj get {{ project_name }}"

- name: "argocd_cluster_list"
description: "List all known clusters"
command: "argocd cluster list --auth-token {{ auth_token }}"
command: "argocd cluster list"

0 comments on commit ea16ad2

Please sign in to comment.