forked from keephq/keep
-
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.
Merge branch 'main' into feat-grafana-map
- Loading branch information
Showing
30 changed files
with
2,004 additions
and
218 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
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
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,39 @@ | ||
--- | ||
title: "DeepSeek Provider" | ||
description: "The DeepSeek Provider enables integration of DeepSeek's language models into Keep." | ||
--- | ||
|
||
<Tip> | ||
The DeepSeek Provider supports querying DeepSeek language models for prompt-based | ||
interactions. | ||
</Tip> | ||
|
||
## Inputs | ||
|
||
The DeepSeek Provider supports the following functions: | ||
|
||
- `prompt`: Interact with DeepSeek's models by sending prompts and receiving responses | ||
- `model`: The model to be used, defaults to `deepseek-reasoner` | ||
- `max_tokens`: Limit amount of tokens returned by the model, default 1024 | ||
- `system_prompt`: Optional system prompt to guide the model's behavior | ||
- `structured_output_format`: Optional JSON format for the structured output (check examples at the GitHub) | ||
|
||
## Outputs | ||
|
||
Currently, the DeepSeek Provider outputs the response from the model based on the prompt provided. | ||
|
||
## Authentication Parameters | ||
|
||
To use the DeepSeek Provider, you'll need an API Key from DeepSeek. The required parameters for authentication are: | ||
|
||
- **api_key** (required): Your DeepSeek API Key. | ||
|
||
## Connecting with the Provider | ||
|
||
To connect to DeepSeek, you'll need to obtain an API Key: | ||
|
||
1. Sign up for an account at [DeepSeek](https://platform.deepseek.com) | ||
2. Navigate to your account settings | ||
3. Generate an API key for Keep | ||
|
||
Use the generated API key in the `authentication` section of your DeepSeek Provider configuration. |
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,132 @@ | ||
--- | ||
title: "EKS Provider" | ||
description: "EKS provider integrates with AWS EKS and let you interatct with kubernetes clusters hosted on EKS." | ||
--- | ||
|
||
## Inputs | ||
- **command_type** (required): The command type to operate on the k8s cluster: | ||
- `get_pods`: List all pods across namespaces or in a specific namespace | ||
- `get_pvc`: List all persistent volume claims | ||
- `get_node_pressure`: Get node pressure metrics | ||
- `get_deployment`: Get deployment information | ||
- `scale_deployment`: Scale a deployment's replicas | ||
- `exec_command`: Execute a command in a pod | ||
- `restart_pod`: Restart a specific pod | ||
- `get_pod_logs`: Get logs from a pod | ||
|
||
### Command-specific Parameters | ||
|
||
#### For get_pods, get_pvc | ||
- **namespace** (optional): Target specific namespace. If not provided, queries all namespaces | ||
|
||
#### For get_deployment, scale_deployment | ||
- **namespace** (optional): Target namespace (defaults to "default") | ||
- **deployment_name** (required): Name of the deployment | ||
- **replicas** (required for scale_deployment): Number of desired replicas | ||
|
||
#### For exec_command | ||
- **namespace** (required): Pod's namespace | ||
- **pod_name** (required): Name of the pod | ||
- **command** (required): Command to execute (string or array) | ||
- **container** (optional): Container name (defaults to first container) | ||
- **use_shell** (optional): Whether to wrap command in shell (defaults to true) | ||
|
||
#### For restart_pod | ||
- **namespace** (required): Pod's namespace | ||
- **pod_name** (required): Name of the pod | ||
|
||
#### For get_pod_logs | ||
- **namespace** (required): Pod's namespace | ||
- **pod_name** (required): Name of the pod | ||
- **container** (optional): Container name (defaults to first container) | ||
- **tail_lines** (optional): Number of lines to get from the end (defaults to 100) | ||
|
||
## Outputs | ||
The Amazon EKS Provider supports the `query` function with different outputs based on command type: | ||
- `get_pods`: Returns list of pod details | ||
- `get_pvc`: Returns list of PVC details | ||
- `get_node_pressure`: Returns node pressure metrics | ||
- `get_deployment`: Returns deployment details | ||
- `scale_deployment`: Returns scaling operation result | ||
- `exec_command`: Returns command output as string | ||
- `restart_pod`: Returns restart operation status | ||
- `get_pod_logs`: Returns pod logs as string | ||
|
||
## Authentication Parameters | ||
The Amazon EKS Provider uses AWS credentials to allow you to query your cluster resources. You need to provide the following authentication parameters: | ||
|
||
- **access_key** (required): AWS access key ID with EKS permissions | ||
- **secret_access_key** (required): AWS secret access key | ||
- **region** (required): AWS region where the EKS cluster is located (e.g., us-east-1) | ||
- **cluster_name** (required): The name of your EKS cluster | ||
|
||
## Connecting with the Provider | ||
To connect to Amazon EKS, follow these steps: | ||
|
||
1. Log in to your [AWS Console](https://aws.amazon.com/) | ||
|
||
2. Create an IAM user with EKS permissions: | ||
```bash | ||
aws iam create-user --user-name eks-user | ||
``` | ||
|
||
3. Attach required policies: | ||
|
||
```bash | ||
aws iam attach-user-policy --user-name eks-user --policy-arn arn:aws:iam::aws:policy/AmazonEKSClusterPolicy | ||
aws iam attach-user-policy --user-name eks-user --policy-arn arn:aws:iam::aws:policy/AmazonEKSServicePolicy | ||
``` | ||
|
||
4. Create access keys | ||
|
||
```bash | ||
aws iam create-access-key --user-name eks-user | ||
``` | ||
|
||
You should get: | ||
|
||
``` | ||
{ | ||
"AccessKey": { | ||
"AccessKeyId": "AKIAXXXXXXXXXXXXXXXX", | ||
"SecretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"Status": "Active" | ||
} | ||
} | ||
``` | ||
|
||
The `AccessKeyId` is your `access_key` and `SecretAccessKey` is your `secret_access_key`. | ||
|
||
5. Note your cluster name and region from the EKS console or using: | ||
|
||
```bash | ||
aws eks list-clusters --region <your-region> | ||
``` | ||
|
||
## Required Permissions | ||
The AWS IAM user needs these permissions: | ||
|
||
1. eks:DescribeCluster | ||
2. eks:ListClusters | ||
|
||
Additional permissions for specific operations: | ||
|
||
3. eks:AccessKubernetesApi for pod/deployment operations | ||
4. eks:UpdateCluster for scaling operations | ||
|
||
| Command | AWS IAM Permissions | | ||
|---------|-------------------| | ||
| `get_pods` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
| `get_pvc` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
| `get_node_pressure` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
| `get_deployment` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
| `scale_deployment` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
| `exec_command` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
| `restart_pod` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
| `get_pod_logs` | `eks:DescribeCluster` <br/> `eks:AccessKubernetesApi` | | ||
|
||
|
||
## Usage Examples | ||
|
||
1. Basic - https://github.com/keephq/keep/blob/main/examples/workflows/eks_basic.yml | ||
2. Advanced - https://github.com/keephq/keep/blob/main/examples/workflows/aks_advanced.yml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
workflow: | ||
id: eks-example-advanced | ||
description: eks-example-advanced | ||
triggers: | ||
- type: manual | ||
steps: | ||
# get all pods | ||
- name: get-pods | ||
provider: | ||
type: eks | ||
config: "{{ providers.eks }}" | ||
with: | ||
command_type: get_pods | ||
|
||
# get specific deployment info | ||
- name: get-deployment-info | ||
provider: | ||
type: eks | ||
config: "{{ providers.eks }}" | ||
with: | ||
command_type: get_deployment | ||
namespace: default | ||
deployment_name: nginx-test | ||
|
||
# scale up deployment | ||
- name: scale-up | ||
provider: | ||
type: eks | ||
config: "{{ providers.eks }}" | ||
with: | ||
command_type: scale_deployment | ||
namespace: default | ||
deployment_name: nginx-test | ||
replicas: 4 | ||
|
||
# get pods after scaling | ||
- name: get-pods-after-scale | ||
provider: | ||
type: eks | ||
config: "{{ providers.eks }}" | ||
with: | ||
command_type: get_pods | ||
namespace: default | ||
|
||
actions: | ||
- name: echo-all-pods | ||
foreach: "{{ steps.get-pods.results }}" | ||
provider: | ||
type: console | ||
with: | ||
message: "Pod name: {{ foreach.value.metadata.name }} || Namespace: {{ foreach.value.metadata.namespace }} || Status: {{ foreach.value.status.phase }}" | ||
|
||
- name: echo-deployment-info | ||
provider: | ||
type: console | ||
with: | ||
message: "Deployment {{ steps.get-deployment-info.results.metadata.name }} has {{ steps.get-deployment-info.results.status.replicas }} replicas" | ||
|
||
- name: echo-scaled-pods | ||
foreach: "{{ steps.get-pods-after-scale.results }}" | ||
provider: | ||
type: console | ||
with: | ||
message: "After scaling - Pod name: {{ foreach.value.metadata.name }} || Status: {{ foreach.value.status.phase }}" |
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,20 @@ | ||
workflow: | ||
id: eks-example | ||
description: eks-example | ||
triggers: | ||
- type: manual | ||
steps: | ||
# get all pods | ||
- name: get-pods | ||
provider: | ||
type: eks | ||
config: "{{ providers.eks }}" | ||
with: | ||
command_type: get_pods | ||
actions: | ||
- name: echo-pod-status | ||
foreach: "{{ steps.get-pods.results }}" | ||
provider: | ||
type: console | ||
with: | ||
message: "Pod name: {{ foreach.value.metadata.name }} || Namespace: {{ foreach.value.metadata.namespace }} || Status: {{ foreach.value.status.phase }}" |
Oops, something went wrong.