Proposal: generic Kubernetes scaler

未关闭
#124 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

stackabletech/trino-lb 的其他 Issue

查看 stackabletech/trino-lb 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。