Skip to content

The Freqtrade Operator is a Kubernetes operator designed to manage Freqtrade instances within a Kubernetes cluster.

License

Notifications You must be signed in to change notification settings

wizrds/freqtrade-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freqtrade Operator

The Freqtrade Operator is a Kubernetes operator designed to manage Freqtrade instances within a Kubernetes cluster. It is written in Rust and leverages the kube-rs library to interact with the Kubernetes API. This operator simplifies the deployment, management, and scaling of Freqtrade bots by using Custom Resource Definitions (CRDs).

Table of Contents

Overview

The Freqtrade Operator automates the lifecycle management of Freqtrade bots in Kubernetes. It manages the creation, updates, and deletion of Freqtrade instances using Kubernetes Custom Resources. This allows for seamless integration with Kubernetes-native tools and workflows, and makes the operations of multiple bots in a Kubernetes environment easier.

Installation (Helm)

Install the CRDs

Before installing the Freqtrade Operator, you need to install the Custom Resource Definitions (CRDs). The CRDs define the custom resources that the operator will manage.

helm upgrade --install freqtrade-operator-crds oci://ghcr.io/wizrds/freqtrade-operator/charts/freqtrade-operator-crds

Install the Operator

Once the CRDs are installed, you can install the Freqtrade Operator itself.

helm upgrade --install freqtrade-operator oci://ghcr.io/wizrds/freqtrade-operator/charts/freqtrade-operator --namespace default --create-namespace --set installCRDs=false

NOTE: You can install the CRDs and the Operator in a single step by setting installCRDs=true in the Operator Helm command. However, this is not recommended for production environments, as it may lead to unexpected behavior.

Usage

After installing the operator, you can create a Freqtrade bot by creating a Bot resource. There is an example YAML file in the root of the repository named examples/basic.bot.yaml. It defines the basic structure for the CRD, an example configuration and uses the SampleStrategy.

Apply the YAML file using kubectl:

kubectl apply -f examples/basic.bot.yaml

Note

For an example with FreqAI usage, please refer to the examples/freqai.bot.yaml file. For a reference on all possible fields, you can check the CRD reference.

Then you can check the status of the bot using:

kubectl get bots

Development

Building

To build the project, you need to have Rust installed. You can install Rust by following the instructions at https://rustup.rs/. Once you have Rust installed, you can build the project by running:

task dev:build

To build the Docker image for the project, you can run:

task docker:build

You can control the image name and tag generated by setting the IMAGE_NAME and IMAGE_TAG task variables. For example:

task docker:build IMAGE_NAME=freqtrade-operator IMAGE_TAG=latest

Running

To run the project, simply run:

task dev:run

For development mode, you can run the controller or webhook individually:

task dev:run:controller
task dev:run:webhook

Testing

To run the tests, use the following command:

task rust:test

License

This project is licensed under ISC License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Made with ❤️ by Timothy Pogue

About

The Freqtrade Operator is a Kubernetes operator designed to manage Freqtrade instances within a Kubernetes cluster.

Resources

License

Stars

Watchers

Forks

Packages