A KEDA extenal scaler for Opensearch. Currently the ELasticsearch scaler in KEDA does not support Opensearch
Before you begin, ensure you have met the following requirements:
- Kubernetes Cluster: A running Kubernetes cluster.
- KEDA: Installed KEDA in your Kubernetes cluster.
- Docker: Docker installed on your local machine.
- Go: Go programming language installed (if you plan to modify the scaler code).
To run the external scaler locally, follow these steps. For test purposes, you will have to set the environment variables loaded in main.go:27
-
Clone the Repository:
git clone https://github.com/hatemmezlini/keda-opensearch-ext.git cd keda-opensearch-ext
-
**Install dependencies **:
go mod tidy
-
Test the Application locally:
go run main.go
To build and run the external scaler as a Docker container, follow these steps:
-
Build the Docker Image:
docker build -t your-username/external-scaler-for-keda:latest .
-
Run the Docker Container:
docker run -d -p 8080:8080 -p 6000:6000 --name keda-opensearch-ext -e OPENSEARCH_URL="http://localhost:9200" -e OPENSEARCH_USERNAME="keda" -e OPENSEARCH_PASSWORD="keda" opensearch-keda-externalscaler your-username/external-scaler-for-keda:latest
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: your-scaledobject-name
namespace: your-namespace
spec:
scaleTargetRef:
name: your-scaledobject-name
# kind: Statefulset (defaults to Deployment)
pollingInterval: 30
cooldownPeriod: 43200
triggers:
- type: external
metadata:
scalerAddress: opensearch-externalscaler.your-namespace.svc.cluster.local:6000
unsafeSSL: "true" # default is false
index: "your-index-name-*"
searchTemplateName: "search_template_name"
targetValue: "5000"
parameters: "param1=value1,param2=value2"
Thank you for using the External Scaler for KEDA! This project aims to provide a flexible and powerful solution to extend KEDA's autoscaling capabilities. If you have any questions or encounter any issues, feel free to open an issue on the GitHub repository. Happy scaling!