-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ddb0d5e
commit 8cf0c6f
Showing
5 changed files
with
166 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
|
||
.bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
charts/playbooks-kubernetes/templates/diagnose-kubernetes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/flanksource/duty/main/schema/openapi/playbook.schema.json | ||
|
||
{{- if .Values.playbooks.ai.enabled }} | ||
--- | ||
apiVersion: mission-control.flanksource.com/v1 | ||
kind: Playbook | ||
metadata: | ||
name: diagnose-any-kubernetes-resource | ||
spec: | ||
description: Use AI to diagnose unhealthy kubernetes resources | ||
configs: | ||
- tagSelector: 'cluster={{.Values.playbooks.ai.diagnose.cluster}}' | ||
healths: | ||
- unhealthy | ||
- warning | ||
# TODO: Limit this selector to kubernetes types | ||
parameters: | ||
- name: prompt | ||
label: Prompt | ||
default: Find out why $(.config.name) is unhealthy | ||
properties: | ||
multiline: 'true' | ||
actions: | ||
- name: query | ||
ai: | ||
connection: '{{.Values.playbooks.ai.connection}}' | ||
systemPrompt: |- | ||
{{- if .Values.playbooks.ai.diagnose.systemPrompt }} | ||
{{- .Values.playbooks.ai.diagnose.systemPrompt | nindent 10 }} | ||
{{- else }} | ||
**Role:** Seasoned Kubernetes engineer and Diagnostic Expert | ||
**Objective:** Assist users in diagnosing issues with unhealthy Kubernetes resources by analyzing provided manifests and related resources. | ||
**Instructions:** | ||
1. **Resource Analysis:** Examine the manifest of the unhealthy resource thoroughly. | ||
2. **Contextual Investigation:** Consider additional related resources provided (e.g., pods, replica sets, namespaces) to gain a comprehensive understanding of the issue. | ||
3. **Diagnostic Steps:** Clearly outline the steps taken during the investigation, focusing on precision and brevity. | ||
4. **One-Time Diagnosis:** Aim to diagnose the issue in a single response without requiring follow-up questions. | ||
**Output:** Provide a concise diagnosis and potential solutions based on the analysis. | ||
{{- end }} | ||
prompt: '$(.params.prompt)' | ||
changes: | ||
since: 2d | ||
analysis: | ||
since: 2d | ||
relationships: | ||
- depth: 5 | ||
direction: outgoing | ||
changes: | ||
since: 24h | ||
- depth: 5 | ||
direction: incoming | ||
changes: | ||
since: 24h | ||
{{- end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters