Skip to content

feat(helm): RFC-001 M5 — full-stack chart (frontier + frontlas + bundled Redis) - #104

Merged
singchia merged 2 commits into
mainfrom
feat/rfc-001-helm
May 2, 2026
Merged

feat(helm): RFC-001 M5 — full-stack chart (frontier + frontlas + bundled Redis)#104
singchia merged 2 commits into
mainfrom
feat/rfc-001-helm

Conversation

@singchia

@singchia singchia commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

dist/helm/ 从只能装 frontier 的半成品,重构成可以一键装 frontier + frontlas + Redis 的完整 Helm chart。用户从此可以直接 helm install frontier dist/helm 拿到与 Operator 路径同等水平的运行时配置。

PR #103(Operator 路径)已含 M1+M2+M3+M4,本 PR 补 M5 — Helm chart 完整化(在 PR #103 里被列为推迟事项)。依赖 PR #103:本 PR base = feat/rfc-001-m1,因为 chart 用到 PR #103 里的 nonRoot Dockerfile 和 observability binary 改动。

📦 已发布的 Chart 包

Helm chart 1.2.5-rc1 GitHub Release (pre-release,绑定本 PR HEAD)

# 直接装
helm install frontier \
  https://github.com/singchia/frontier/releases/download/helm-chart-v1.2.5-rc1/frontier-1.2.5.tgz \
  --namespace frontier --create-namespace \
  --set frontier.image.tag=1.1.0 --set frontlas.image.tag=1.1.0

# 或当作 Helm repo
helm repo add frontier https://github.com/singchia/frontier/releases/download/helm-chart-v1.2.5-rc1
helm repo update
helm install frontier frontier/frontier -n frontier --create-namespace
Asset 用途 SHA256
frontier-1.2.5.tgz Chart 包 884dcc5c2cb0b03e3065ecf9ea5d8f8e56feabbcb9f99975d93f6f9f6dd402c4
index.yaml Helm repo index

主要交付

Chart.yaml

  • version 0.1.01.2.5,appVersion 1.0.01.2.5
  • 新增 bitnami/redis dependency(条件 redis.enabled
  • 加 description / keywords / maintainers / home / sources

values.yaml — 4 段重构

  • frontier — replicaCount / image / SA / podAnnotations / Labels / podSecurityContext (nonRoot UID 65532) / containerSecurityContext (drop ALL caps) / terminationGracePeriodSeconds (60) / drainSeconds (50) / lifecycle.preStop / liveness/readinessProbe (TCP) / resources / service / ingress / autoscaling / 调度 / extraEnv
  • frontlas — 同结构;readinessProbe 默认 HTTP /cluster/v1/health;外置 Redis 配置入 externalRedis
  • observability — frontier 9091 / frontlas 9092 默认开启 + serviceMonitor 开关
  • redis — 内嵌 bitnami subchart 默认开启

Templates

  • _helpers.tpl 全重写:每组件独立 fullname / labels / selectorLabels / SA name;新增 pullPolicy / imageTag / serviceFQDN / frontier.frontlas.redis 助手
  • configmap_frontier.yaml + 新 configmap_frontlas.yaml:用 tpl 渲染配置文件,端口 / observability addr / frontlas dial 都从 values 来
  • deployment_frontier.yaml 重写:注 FRONTIER_DRAIN_SECONDS + NODE_NAME env;默认 preferred host 反亲和;ConfigMap checksum 触发 rollout
  • deployment_frontlas.yaml:Redis 凭据通过 valueFrom.secretKeyRef 注入(内嵌 redis 走 <release>-redis Secret,外置 redis 走用户 Secret)
  • service_frontier.yaml + 新 service_frontlas.yaml:分别 ClusterIP(servicebound、frontlas controlplane+frontierplane)+ NodePort(edgebound)+ 可选 headless metrics service
  • serviceaccount_frontier.yaml + serviceaccount_frontlas.yamlautomountServiceAccountToken: false
  • servicemonitor.yaml:开关受 serviceMonitor.enabled 控制
  • hpa_frontier.yaml:升 autoscaling/v2
  • ingress_frontier.yaml:清理至 networking.k8s.io/v1

Configs

  • configs/frontier/frontier.yaml:现支持 templating;frontlas.dial.addrs 自动指向渲染出的 frontlas Service FQDN;observability 段从 values 注入
  • configs/frontlas/frontlas.yaml:同样模板化;Redis 具体由 env 注入

文档

/docs/operator 加 §2.3 "Install with Helm",含:

  • 一键安装命令 + BYO Redis 范例
  • 11 行 values 旋钮速查表
  • Operator vs Helm 决策矩阵 7 行
  • 发布提示(helm package.tgz

Test plan

  • helm dependency update 拉到 bitnami/redis 20.13.4
  • helm lint 通过(仅 1 条 INFO:缺 chart icon)
  • helm template 渲染 21 个对象(3 SA / 1 Secret / 5 CM / 7 Service / 2 Deploy / 1 STS / 1 NetworkPolicy / 1 PDB)
  • helm package 产出 frontier-1.2.5.tgz(114 601 字节)
  • TKE v1.34 真集群 helm install:frontier + frontlas + redis-master 都 1/1 Running;nonRoot UID 65532 应用;Redis 密码走 valueFrom.secretKeyRef 不留明文;preStop + drain env 完整;7 个 Service 全渲染
  • helm uninstall 干净
  • helm pull from GitHub Release URL 拿到的 SHA256 与本地构建一致 (884dcc5c…)
  • npx next build(website)通过

兼容性 / 升级注意

  • Chart 版本跨度大 (0.1.01.2.5):原 chart 用户需要全量 review values。values.yaml 顶层 schema 完全变了
  • 默认 SecurityContext 是 runAsNonRoot=true → 自定义镜像若没设 USER 会启动失败;通过 frontier.podSecurityContext: {} + containerSecurityContext: { runAsNonRoot: false } 可关
  • 内嵌 Redis 子 chart 默认开启持久化(PVC 8Gi);--set redis.master.persistence.enabled=false 可关(开发环境)
  • Chart.lock 入库,charts/ 目录在 .gitignore(执行 helm dependency update 自动拉)
  • 二进制镜像 1.2.5 还没发布;当前部署需 --set frontier.image.tag=1.1.0 --set frontlas.image.tag=1.1.0 临时跑老版(PR feat: RFC-001 cloud-native optimization (M1+M2+M3+M4 + docs) #103 的镜像构建合并后即可去掉)

关联

🤖 Generated with Claude Code

singchia and others added 2 commits May 2, 2026 16:57
…bchart

Rework the existing frontier-only Helm chart into a complete, single-command
deployment for both data plane (frontier) and control plane (frontlas), with
an optional bundled bitnami/redis subchart. Defaults track the operator's
production-grade settings (M2/M3/M4) so the two install paths converge on
the same observable runtime behavior.

Chart.yaml
- Bump version 0.1.0 -> 1.2.5; appVersion 1.0.0 -> 1.2.5
- Add bitnami/redis dependency (condition: redis.enabled)
- Add description, keywords, maintainers, home, sources

values.yaml — restructured into four top-level sections:

  frontier:
    replicaCount, image, serviceAccount, podAnnotations/Labels,
    podSecurityContext (nonRoot UID 65532, RuntimeDefault seccomp),
    containerSecurityContext (drop ALL caps, no privEsc),
    terminationGracePeriodSeconds (60), drainSeconds (50),
    lifecycle.preStop (sleep 10), liveness/readinessProbe (TCP),
    resources, service (servicebound/edgebound/controlplane),
    ingress, autoscaling, nodeSelector, tolerations,
    topologySpreadConstraints, affinity, extraEnv

  frontlas:
    same shape; readinessProbe defaults to HTTP /cluster/v1/health;
    externalRedis subsection for BYO Redis when redis.enabled=false

  observability:
    frontier { enabled, port: 9091 }
    frontlas { enabled, port: 9092 }

  serviceMonitor:
    enabled (off by default), namespace, interval, scrapeTimeout, labels

  redis:
    enabled (bitnami subchart), architecture, auth, master.persistence

Templates
- _helpers.tpl rewritten with per-component fullname / labels /
  selectorLabels / serviceAccountName, plus pullPolicy / imageTag /
  serviceFQDN / frontlas.redis helpers
- configmap_frontier.yaml + configmap_frontlas.yaml render configs via
  `tpl` so values like ports / observability addr land in the actual
  binary config
- deployment_frontier.yaml: rewritten for new helpers; injects
  FRONTIER_DRAIN_SECONDS / NODE_NAME env; default preferred host
  anti-affinity (overridable by .Values.frontier.affinity);
  checksum/config annotation triggers pod restart on ConfigMap change
- deployment_frontlas.yaml (NEW): same shape; Redis credentials
  injected via env (REDIS_PASSWORD as valueFrom.secretKeyRef when
  bundled redis OR external passwordSecret is configured)
- service_frontier.yaml: separates servicebound + edgebound services;
  optional headless metrics service paired with ServiceMonitor
- service_frontlas.yaml (NEW): single Service exposing controlplane
  + frontierplane ports; optional headless metrics service
- serviceaccount_frontier.yaml + serviceaccount_frontlas.yaml: per
  component, automountServiceAccountToken=false
- servicemonitor.yaml (NEW): one file generating ServiceMonitor for
  both components when serviceMonitor.enabled=true
- hpa_frontier.yaml: bump to autoscaling/v2; nest under
  .Values.frontier.autoscaling
- ingress_frontier.yaml: simplified to networking.k8s.io/v1 only

Configs
- configs/frontier/frontier.yaml: now templated; wires servicebound /
  edgebound listen ports, frontlas dial address (FQDN of the rendered
  frontlas Service), and observability addr from values
- configs/frontlas/frontlas.yaml (NEW): templated; control_plane +
  frontier_plane listen, observability addr; Redis specifics come
  from env vars

Verified end-to-end on TKE v1.34:
- helm dependency update pulls bitnami/redis 20.13.4
- helm lint clean
- helm template renders 21 distinct objects (3 SA, 1 Secret, 5 CM,
  7 Service, 2 Deployment, 1 StatefulSet, 1 NetworkPolicy, 1 PDB)
- helm install completes; all pods Running; Redis password injected
  via valueFrom.secretKeyRef (no plaintext); nonRoot UID 65532;
  preStop + drain env applied
- helm uninstall + namespace delete clean

Refs: docs/rfc/RFC-001-cloud-native-optimization.md (M5 — Helm chart
completeness, originally deferred from M4)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cover the new dist/helm chart end-to-end as section 2.3:
- Quick install with bundled bitnami/redis subchart
- BYO external Redis via frontlas.externalRedis + passwordSecret
- Knob reference table (replicaCount, image, registry, pullSecrets,
  edgebound serviceType, security context overrides, grace/drain,
  HPA, observability ports, ServiceMonitor toggle, redis.enabled)
- Operator vs Helm decision matrix (declarative CR, Status conditions,
  TLS self-healing, multi-cluster isolation, bundled Redis, GitOps)
- Hint to publish: helm package -> .tgz / helm push to OCI

Verified with `npx next build`; /docs/operator still pre-renders.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment May 2, 2026 8:58am

@singchia
singchia changed the base branch from feat/rfc-001-m1 to main May 2, 2026 09:28
@singchia
singchia merged commit 2fc5fdc into main May 2, 2026
2 checks passed
singchia added a commit that referenced this pull request May 2, 2026
First release after RFC-001 cloud-native optimization (PRs #103, #104, #105):

- M1 — operator P0 bug fixes (TLS volume, Secret naming, frontier-plane port)
- M2 — production baseline (PodOverrides, nonRoot images, Redis SecretRef,
       graceful shutdown, default probes / preStop / grace)
- M3 — observability HTTP server (/healthz, /readyz, /metrics) on
       frontier:9091 and frontlas:9092
- M4 — Status Conditions, EventRecorder, CRD shortName fc, printcolumns
- M5 — full-stack Helm chart (frontier + frontlas + bundled bitnami/redis),
       published at https://singchia.github.io/frontier

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@singchia
singchia deleted the feat/rfc-001-helm branch May 2, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant