This commit is contained in:
2026-01-14 12:37:31 +08:00
commit 01d1a49a59
22 changed files with 1037 additions and 0 deletions

110
readme.md Normal file
View File

@@ -0,0 +1,110 @@
# datapod-helm
Kubernetes Helm Charts 部署配置。
## PocketBase Chart
部署多个 PocketBase 实例,支持 Traefik ingress。
### 前置条件
- Kubernetes 1.19+
- Helm 3.2.0+
- Traefik ingress 控制器
- StorageClass用于持久化存储
### 快速开始
```bash
# 安装 Helm
brew install helm
```
### 部署 PocketBase
1. **配置实例** 编辑 `pocketbase/values.yaml`:
```yaml
instances:
- id: "app1"
domain: "app1.pb.xiongxiao.me"
replicaCount: 1
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
- id: "app2"
domain: "app2.pb.xiongxiao.me"
replicaCount: 1
```
2. **安装** chart:
```bash
# 本地 chart 安装
helm install my-pocketbase ./pocketbase -f pocketbase/values.yaml
# 使用生产环境配置
helm install my-pocketbase ./pocketbase -f pocketbase/values-production.yaml
```
首次安装
```
helm install my-pocketbase ./pocketbase -f pocketbase/values.yaml
```
3. **获取 admin 密码**:
```bash
kubectl get secret pocketbase-app1-secrets -o jsonpath='{.data.admin-password}' | base64 -d
```
4. **访问** Admin UI:
- 地址: `https://app1.pb.xiongxiao.me/_/`
- 邮箱: 查看 secret
- 密码: 查看 secret
### 配置参数
| 参数 | 说明 | 默认值 |
|------|------|--------|
| `instances` | PocketBase 实例列表 | `[]` |
| `instances[].id` | 实例唯一标识 | - |
| `instances[].domain` | 实例完整域名 | - |
| `instances[].replicaCount` | 副本数量 | `1` |
| `persistence.enabled` | 启用数据持久化 | `true` |
| `persistence.size` | PVC 大小 | `1Gi` |
| `persistence.storageClass` | StorageClass 名称 | - |
### 升级
```bash
helm upgrade my-pocketbase ./pocketbase -f pocketbase/values.yaml
```
### 卸载
```bash
helm uninstall my-pocketbase
```
### 常用命令
```bash
# Lint 检查
helm lint ./pocketbase
# 模板渲染测试
helm template test-release ./pocketbase -f ./pocketbase/values-production.yaml
# 模拟安装(调试模式)
helm install --dry-run --debug my-pocketbase ./pocketbase -f ./pocketbase/values-production.yaml
```
### 技术说明
- **数据库**: 使用 SQLite 本地存储,数据保存在 `/pb/pb_data` 目录
- **持久化**: 通过 PVC 实现数据持久化
- **入口**: 使用 Traefik IngressRoute 配置路由