Coder Social home page Coder Social logo

pancakeswap-ifo-scaler's Introduction

pancakeswap-ifo-scaler

Auto-scaler for Pancakeswap Blockchain Nodes Infrastructure.

Principle algorithm

  1. Event of new Pancakeswap IFO
  2. Create k8s resource KEDA scaleobject
  3. Resize blockchain cluster by scaling pod
  4. Send notification to Telegram (by @predictkube_bot)
  5. Cleanup k8s resources

Config environment variables

  • TARGET_NAME - Kubernetes target controller for scaling (required)
  • TARGET_NAMESPACE - Kubernetes namespace with controller (required)
  • K8S_REPLICAS_COUNT - Replicas count for IFO period (required)
  • TELEGRAM_TOKEN - Token for notification (required)
  • TARGET_API_VERSION - Kubernetes target controller API version (default is apps.kruise.io/v1alpha1)
  • TARGET_KIND - Kubernetes target controller Kind (default is CloneSet)
  • NODE_URL - BSC JsonRPC Endpoint. Public endpoint by default

Run

Please add @predictkube_bot to any telegram group(s) for receive notifications.

Locally

export TELEGRAM_TOKEN="changeme"
pip install -r requirements.txt
python main.py

Docker

docker build -t ifo-scaler .
docker run -v $HOME/.kube:/root/.kube -e TELEGRAM_TOKEN="changeme" ifo-scaler

pancakeswap-ifo-scaler's People

Contributors

daniel-yavorovich avatar voron avatar

Watchers

 avatar  avatar  avatar

pancakeswap-ifo-scaler's Issues

Multiple ScaledObject with one scaleTargetRef are not supported

It seems that multiple ScaledObject referencing single scaleTargetRef are not supported with current Keda implementation.
Keda creates independent HPA objects for each ScaledObject, which leads to HPA wars to scale single resource.

k get hpa
NAME                                                          REFERENCE          TARGETS                                    MINPODS   MAXPODS   REPLICAS   AGE
keda-hpa-bsc-so                                               CloneSet/bsc-rpc   891/1200 (avg), 500m/1 (avg) + 1 more...   2         30        2          244d
keda-hpa-ifo-0x80828b68d126741eea62b4712ebf7ceb9d54cbaa-mgp   CloneSet/bsc-rpc   -9223372036854775808m/1 (avg)              1         100       2          3m38s

Proposed fix is to patch existing ScaledObject instead of creating a new one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.