19 Commits
Author SHA1 Message Date
bruno 6b9dcf01fa docs: 添加 Harbor 外网访问配置完整总结 2026-02-27 13:50:30 +08:00
bruno b367870923 fix: 修复 Harbor 外网访问配置
- 更新 harbor.yml 端口配置(8080/8443)
- 更新 external_url 包含端口号 :8443
- 更新 SSL 配置脚本邮箱地址

修复问题:
- Docker login 时 token service URL 缺少端口号导致超时
- 需要手动修改 common/config/core/env 中的 EXT_ENDPOINT

解决方案:
- 在 harbor.yml 中设置 external_url: https://harbor.omniverseai.net:8443
- 重启 Harbor 后会自动生成正确的 EXT_ENDPOINT

测试通过:
- ✅ docker login harbor.omniverseai.net:8443 成功
- ✅ Let's Encrypt 证书正常工作
- ✅ 外网可以正常访问和推送镜像
2026-02-27 13:45:36 +08:00
bruno bc5f7b70c9 docs: 添加 SSL 配置快速总结 2026-02-27 12:59:05 +08:00
bruno 5ce8a8df83 feat: 添加 Harbor Let's Encrypt SSL 证书配置(DNS only 模式)
- 添加 Let's Encrypt 自动配置脚本(DNS-01 验证)
- 添加完整配置指南(DNS only 模式)
- 添加快速配置总结文档
- 配置自动续期(每月 1 号和 15 号)

适用场景:
- harbor.omniverseai.net 使用 DNS only 模式
- 避免 Cloudflare 文件大小限制
- 使用 Cloudflare DNS API 进行 DNS-01 验证
2026-02-27 12:58:58 +08:00
bruno daba921b89 docs: 添加 Harbor 快速参考卡片 2026-02-27 08:14:50 +08:00
bruno 435834dc79 feat: Harbor 版本化配置
- 添加 Harbor 快速恢复脚本 (harbor-quick-restore.sh)
- 添加完整恢复指南 (HARBOR-RESTORE-GUIDE.md)
- 添加版本信息文件 (VERSION.md)
- 更新 .gitignore 排除敏感数据
- 配置 harbor git remote
- 修复 Cloudflare Tunnel 配置

系统重装后可通过以下命令快速恢复:
git clone http://192.168.1.83:33000/gao/ljwx-harbor.git
cd ljwx-harbor
./harbor-quick-restore.sh
2026-02-27 08:12:30 +08:00
bruno ef042602c4 push to gitea 2025-12-24 13:42:39 +08:00
bruno c815ea0268 feat: 添加 MySQL 数据库监控完整解决方案
新增功能:
- MySQL 8.0 StatefulSet 部署 (infra namespace)
- MySQL Exporter v0.15.1 独立部署 (monitoring namespace)
- Prometheus ServiceMonitor 自动服务发现
- Grafana Dashboard (MySQL Database Monitoring)
- 完整的验证和导入脚本

部署的组件:
- MySQL 8.0 (3306, NodePort: 32306)
- MySQL Exporter v0.15.1 (9104)
- Grafana Dashboard (UID: mysql-monitoring)

监控指标:
- MySQL 运行状态和连接数
- 查询性能(QPS、慢查询)
- InnoDB 缓冲池使用情况和命中率
- 命令操作统计(SELECT/INSERT/UPDATE/DELETE)
- 网络流量、表锁、行操作统计
- 错误和临时对象统计

配置文件:
- infra/observability/mysql-exporter.yaml
- infra/observability/mysql-secret-example.yaml
- infra/database/monitoring/grafana-mysql-dashboard.yaml
- infra/database/monitoring/MYSQL-MONITORING-README.md
- MYSQL-DASHBOARD-ACCESS.md
- verify-mysql-monitoring.sh
- import-mysql-dashboard.sh

更新文档:
- README.md: 添加数据库监控章节
- 新增 infra namespace 组件说明
- 更新 Grafana 仪表盘推荐列表
- 更新文件清单和快速链接

验证状态:
✓ MySQL Pod 运行正常
✓ MySQL Exporter Pod 运行正常
✓ ServiceMonitor 已创建
✓ 所有关键指标可用 (mysql_up=1)
✓ Grafana Dashboard 已导入并修复

🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-24 13:32:11 +08:00
brunoandClaude Sonnet 4.5 1fdf75df00 feat: 添加 Kubernetes infra 数据库部署和 Grafana 监控
- 部署 PostgreSQL, Redis, MinIO 到 infra 命名空间
- 配置 PostgreSQL 自动备份到 MinIO S3 (CronJob)
- 添加网络代理支持 (HTTP_PROXY) 解决备份下载问题
- 部署 Grafana Dashboard 监控数据库备份任务
- 修复 Dashboard Datasource UID 配置问题 (PBFA97CFB590B2093)

主要组件:
- MinIO: S3 对象存储 (50Gi)
- Redis: 内存数据库 (8Gi, Bitnami chart)
- PostgreSQL: 关系型数据库 (20Gi, Bitnami chart)
- 自动备份: CronJob 每日 03:00 UTC
- Grafana: 5个监控面板 (Jobs Overview, CronJobs, Failed Backups, Status, Activity)

部署脚本:
- deploy-infra-databases.sh: 一键部署所有组件
- verify-infra-databases.sh: 验证部署状态
- monitoring/import-dashboard.sh: 导入 Grafana Dashboard

文档:
- README.md: 完整部署和运维指南
- DEPLOYMENT-PLAN.md: 技术方案
- monitoring/DASHBOARD-DIAGNOSIS.md: Dashboard 故障排查

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 22:48:29 +08:00
brunoandClaude Sonnet 4.5 6b9f741db4 feat: 添加国内镜像加速配置工具集
新增功能:
- 一键配置脚本(setup-china-mirrors.sh)
  - 清理7890代理配置
  - 配置Pip使用中科大镜像
  - 配置NPM使用阿里云镜像
  - 配置Maven使用阿里云镜像
  - 配置Docker使用Harbor镜像代理

- 配置恢复脚本(restore-configs.sh)
  - 从备份恢复原始配置
  - 自动查找最新备份文件
  - 恢复前再次备份当前配置

- 配置验证脚本(verify-config.sh)
  - 验证所有镜像源配置
  - 测试网络连通性
  - 生成测试报告

- Makefile 简化操作
  - make setup: 配置镜像源
  - make verify: 验证配置
  - make restore: 恢复配置
  - make status: 查看状态

- 完整文档
  - README.md: 详细使用文档
  - QUICKSTART.md: 快速开始指南
  - .gitignore: 忽略备份文件

支持环境:
- macOS 系统
- OrbStack / Docker Desktop
- Python (pip)
- Node.js (npm)
- Java (maven)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 10:18:44 +08:00
brunoandClaude 4cf1cdee25 feat: 完善 Harbor 镜像预热和 Registry Mirrors 配置
## 新增功能

### 1. 生产级镜像预热脚本
- **preheat-images-pro.sh**: 修复所有旧版问题的生产级预热脚本
  - 基于退出码判断成功(不再依赖 grep 输出)
  - 自动重试机制(最多3次,间隔递增)
  - 修正所有镜像路径(使用正确的项目名)
  - 使用 Robot 账号(移除硬编码密码)
  - 移除 ELK 镜像(使用 Loki 替代)
  - 超时保护(每个镜像最长5分钟)
  - 详细错误报告(JSON 格式输出)

- **PREHEAT-GUIDE.md**: 完整的镜像预热使用指南
  - 分组预热支持(k8s/monitoring/loki/tempo/otel/database/base)
  - 性能对比和最佳实践
  - 常见问题排查

### 2. Registry Mirrors 配置
- **configure-containerd-mirrors.sh**: 配置 OrbStack containerd 使用 Harbor 作为多 registry 的 mirror
  - 支持 docker.io、registry.k8s.io、quay.io、ghcr.io
  - 自动创建 hosts.toml 配置文件
  - K8s YAML 可使用标准路径,自动通过 Harbor 拉取

- **REGISTRY-MIRRORS-SUCCESS.md**: 配置成功验证和使用说明
  - 性能提升验证(3.3倍加速)
  - 工作原理说明
  - 维护指南

## 测试结果

- 预热 23 个核心镜像(K8s + 监控 + 日志)成功率 100%
- Registry mirrors 配置后,标准路径拉取速度提升 3.3 倍
- 所有配置文件已移除硬编码密码,使用环境变量

## 相关文件

- preheat-images-pro.sh(主脚本)
- preheat-images-v2.sh(中间版本)
- PREHEAT-GUIDE.md(使用指南)
- configure-containerd-mirrors.sh(Registry mirrors 配置)
- REGISTRY-MIRRORS-SUCCESS.md(配置验证)
- preheat-report-20251213-122836.json(预热报告)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-13 13:06:12 +08:00
brunoandClaude 3e9128a4d7 feat: Add Harbor proxy cache documentation and configuration tools
## Summary
- Add comprehensive proxy cache usage guide emphasizing correct patterns
- Create automated setup scripts for Docker/Containerd configuration
- Generate K8s containerd configuration for transparent proxy
- Add image preheating and synchronization tools
- Provide client configuration scripts for Docker and Kubernetes

## Documentation
- HARBOR-PROXY-CACHE-GUIDE.md: Correct usage patterns (pull directly from Harbor, not manual push)
- HARBOR-PROXY-SUMMARY.md: Quick reference with path conversion rules and performance metrics
- K8S-HARBOR-CONFIG.md: Kubernetes-specific Harbor configuration guide
- harbor-image-usage.md: Practical image usage examples

## Configuration Tools
- setup-harbor-proxy.sh: Interactive configuration tool for Docker/Containerd
- configure-docker-client.sh: Docker daemon.json setup script
- configure-k8s-harbor.sh: Kubernetes Harbor integration script
- containerd-harbor-config.toml: Ready-to-use containerd config for K8s/K3s nodes

## Image Management
- sync-common-images.sh: Batch sync common Docker images (fixed for loop syntax)
- preheat-images.sh: Pre-cache frequently used images to Harbor

## Key Features
- Proxy Cache Projects: dockerhub, ghcr, quay, k8s-registry
- Transparent proxy support via registry-mirrors
- 7-10x performance improvement on cached pulls
- Self-signed certificate support with insecure_skip_verify

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-13 08:27:32 +08:00
brunoandClaude a9e1d4309c feat: Configure Harbor with HTTPS support and reset admin credentials
## Summary
- Enable HTTPS on port 443 with self-signed SSL certificates
- Reset admin password to admin123 for consistent access
- Configure external_url for proper Docker registry authentication
- Update comprehensive documentation with troubleshooting guide

## Changes

### Configuration
- harbor.yml: Enable HTTPS on port 8443, set external_url to https://harbor.omniverseai.net
- docker-compose.yml: Update port mappings to 80:8080 and 443:8443
- common/config/core/env: Set EXT_ENDPOINT=https://harbor.omniverseai.net
- common/config/nginx/nginx.conf: Enable HTTPS server block with SSL

### Documentation
- README.md: Complete rewrite with HTTPS setup, SSL certificates, troubleshooting
- HARBOR-SETUP-GUIDE.md: Update setup procedures

## SSL Certificate
- Generated self-signed certificate for harbor.omniverseai.net
- Certificate location: /Users/brunogao/certs/harbor.omniverseai.net.pem
- Includes SAN: DNS:harbor.omniverseai.net, IP:192.168.1.83

## Access Information
- Web UI: https://harbor.omniverseai.net (or http://192.168.1.83)
- Registry: harbor.omniverseai.net (HTTPS on port 443)
- Credentials: admin/admin123

## Testing
- ✅ Docker login successful
- ✅ Image push/pull verified with hello-world image
- ✅ Web UI accessible via HTTPS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-13 00:14:32 +08:00
bruno 6606f067a7 fix: 配置runner支持OrbStack - 添加privileged和docker-cli 2025-11-25 22:11:07 +08:00
bruno b53969e145 test: 测试修复后的CI/CD - Runner已配置docker-cli和privileged模式 2025-11-25 22:06:14 +08:00
bruno 66c47e0569 Add Harbor setup and configuration scripts 2025-11-21 20:24:04 +08:00
brunoandClaude b50d09dfb7 feat: 整合 Harbor 代理缓存和镜像管理功能
## 新增功能

### 代理缓存管理
- harbor-proxy-cache.sh: Harbor 代理缓存配置和管理脚本
- harbor-docker-config.sh: Docker 客户端配置脚本
- setup-proxy-quick.sh: 快速配置代理缓存

### 镜像配置
- configure-containerd-mirrors.sh: Containerd 镜像加速配置
- configure-k3s-mirrors.sh: K3s 集群镜像配置
- configure-registry-domains.sh: 注册表域名配置
- harbor-image-precache.sh: 镜像预缓存脚本
- harbor-k3s-config.sh: K3s Harbor 集成配置

### 部署工具
- deploy-to-ops.sh: 从代码仓库同步到运行环境的部署脚本

### 文档
- HARBOR_PROXY_CACHE_GUIDE.md: 代理缓存配置指南
- SMART_MIRROR_SETUP.md: 智能镜像加速配置

### 配置
- .gitignore: 排除运行时文件和敏感数据

## 架构优化

建立了清晰的开发-部署分离模式:
- ~/work/codes/tools/macos/harbor - 代码仓库(版本控制)
- ~/ops/harbor - 运行环境(实际部署)

通过 deploy-to-ops.sh 实现一键同步部署

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:40:08 +08:00
bruno 6ebfb24fd9 fix: Update runner Docker socket configuration and Gitea instance URL
- Changed docker-compose.yml to mount OrbStack Docker socket path (/Users/brunogao/.orbstack/run/docker.sock)
- Updated GITEA_INSTANCE_URL to use 192.168.1.83:33000 instead of gitea:3000 for proper DNS resolution
- Both runner-docker and runner-k8s now correctly point to OrbStack Docker daemon
- This resolves the 'Cannot connect to the Docker daemon' error and DNS resolution failures
2025-11-13 17:59:28 +08:00
brunoandClaude 24bd7e93eb feat: 添加 Gitea Action Runners 配置
- 添加两个 Action Runners:
  - runner-docker: 用于构建和推送 Docker 镜像
  - runner-k8s: 用于 Kubernetes 部署

- 新增文件:
  - docker-compose.yml: 更新以包含两个 runners
  - runner-k8s-config.yaml: K8s runner 配置
  - setup-runners.sh: 自动配置和启动 runners 脚本

关键特性:
✅ 自动注册到 Gitea
✅ Docker-in-Docker 支持
✅ Kubernetes 集群访问(挂载 kubeconfig)
✅ 健康检查和自动重启

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 11:58:11 +08:00