Proposal: generic Kubernetes scaler

オープン
#124 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
helm, kubernetes, rust

調査の方向性

Start by reading the existing scaler trait, scaling loop, and persistence code; their file paths are not given in the issue. Then review how Kubernetes deployments and HPA status can fit the proposed configuration. The issue needs maintainer feedback on the design before implementation, and done would include an accepted scaler design, implementation, and documentation of the Helm replica limitation.

索引モデルが issue の本文から書いたものです。

説明

We run Trino on k8s with helm charts and we wanna use trino-lb in front for routing, queuing,etc...

Today there is no scaler trait implemented for generic clusters.

I would like to add an implementation for this kind of workload and I'd be happy to write the PR.
Before I start with anything, I would like to have your opinion on the design and whether you would accept it upstream.

Proposal

clusterAutoscaler:
  reconcileInterval: 30s
  kubernetes:
    clusters:
      trino-batch-1:
        namespace: trino-batch
        coordinatorDeployment: trino-batch-1-trino-coordinator
        # optional, only needed for worker-aware upscale
        workerDeployment: trino-batch-1-trino-worker

The idea is the scaler only touches coordinators and workers are left to users' own autoscaler.

This mainly means spawning new clusters will be the job or scaler while autoscaling each cluster goes by an HPA.

We can also make the scaler be aware of HPA using some opt-ins, to stop both scaler and HPA reacting to the same load.

trinoClusterGroups:
  batch:
    autoscaling:
      upscaleQueuedQueriesThreshold: 1
      waitForWorkerScaleUp: 2m

When it is set and the queue is above the threshold, trino-lb does not start the next cluster while any active
cluster in the group has a worker scale-up in progress (HPA desiredReplicas > currentReplicas), for at most
waitForWorkerScaleUp. If no scale-up is in progress (workers at max, or workers idle because the coordinator
is the limit), trino-lb starts the next cluster as it does today.

Known limit

The upstream Trino chart hardcodes replicas: 1 on the coordinator Deployment.
A helm upgrade or a GitOps sync will turn a stopped cluster back on unless the deploy tool ignores
/spec/replicas on the coordinator Deployment (e.g. Argo CD ignoreDifferences with RespectIgnoreDifferences=true).
We would document this next to the scaler.

Questions

  1. Is reading HPA status from trino-lb fine, or would you prefer another signal for 'a worker scaling is in progress'?
  2. Anything in the scaling loop or persistence we should know before starting?
主要言語
Rust
スター
40
フォーク
9
平均マージ
22分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

stackabletech/trino-lb のほかの issue

stackabletech/trino-lb の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。