添加 chart 仓库

bouine 发布 Helm chart 仓库到 https://charts.bouine.org, 索引在 Artifact Hub。 chart 默认从 Docker Hub 拉取 bouinecache/bouine 镜像。

helm repo add bouine https://charts.bouine.org
helm repo update
helm search repo bouine
NAME            CHART VERSION   APP VERSION     DESCRIPTION
bouine/bouine   0.5.8           0.5.8           Cloud-native HTTP cache in Go ...

Helm 快速开始

helm install bouine bouine/bouine \
  --namespace bouine --create-namespace \
  --set "config.upstream_pools[0].name=app" \
  --set "config.upstream_pools[0].targets[0]=app.default.svc:8080" \
  --set "config.routes[0].pool=app"

这会部署一个带 gossip 集群的 StatefulSet、一个 headless Service 用于 节点发现,以及一个 PodDisruptionBudget。

如需从本地检出安装而非仓库,将 Helm 指向 chart 目录:

helm install bouine deploy/helm/bouine --namespace bouine --create-namespace ...

查看 Helm chart 参考 了解所有可配置值。

StatefulSet 要求

多 Pod 集群需要使用 StatefulSet 和带 publishNotReadyAddresses: true 的 headless Service。参见 集群 → Headless Service 获取完整清单。

admin token(多 Pod 要求)

所有 Pod 必须共享相同的 admin.token。参见 认证 了解配置说明。

扩缩容

kubectl scale statefulset/bouine -n bouine --replicas=3
kubectl exec bouine-0 -n bouine -- /bouine cluster peers

滚动更新

kubectl rollout restart statefulset/bouine -n bouine
kubectl rollout status statefulset/bouine -n bouine

bouine 在关闭时标记自身为未就绪并优雅退出 gossip 集群。参见 Kubernetes 运维 了解零 5xx 滚动更新流程。