ark-controller-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseArk Controller Development
Ark Controller 开发指南
Guidance for developing the Ark Kubernetes operator in .
ark/本指南针对目录下的Ark Kubernetes Operator开发提供指导。
ark/When to use this skill
适用场景
- Modifying Go type definitions ()
api/v1alpha1/*_types.go - Fixing CRD/Helm chart sync errors
- Adding new CRD fields or resources
- 修改Go类型定义()
api/v1alpha1/*_types.go - 修复CRD/Helm Chart同步错误
- 添加新的CRD字段或资源
CRD Generation Flow
CRD生成流程
api/v1alpha1/*_types.go # Go types with markers
↓
make manifests # Generates CRDs and syncs to Helm chart
↓
config/crd/bases/*.yaml # Source CRDs (auto-generated)
dist/chart/templates/crd/ # Helm chart CRDs (auto-synced)make manifestsapi/v1alpha1/*_types.go # 带有标记的Go类型
↓
make manifests # 生成CRD并同步到Helm Chart
↓
config/crd/bases/*.yaml # 源CRD(自动生成)
dist/chart/templates/crd/ # Helm Chart中的CRD(自动同步)make manifestsFixing "CRDs out of sync" Errors
修复「CRD不同步」错误
When fails with CRD validation errors:
make buildbash
cd ark
make manifests
make build当因CRD验证失败时:
make buildbash
cd ark
make manifests
make buildKey Directories
关键目录
| Directory | Purpose |
|---|---|
| Go type definitions |
| Auto-generated source CRDs |
| Helm chart CRDs (auto-synced) |
| Reconciliation logic |
| Admission webhooks |
| AI/ML execution logic |
| 目录 | 用途 |
|---|---|
| Go类型定义 |
| 自动生成的源CRD |
| Helm Chart中的CRD(自动同步) |
| 协调逻辑 |
| 准入Webhook |
| AI/ML执行逻辑 |
Common Tasks
常见任务
After Modifying Types or Comments
修改类型或注释后
Go type comments become CRD field descriptions:
bash
cd ark
make manifests
make buildGo类型注释会成为CRD字段描述:
bash
cd ark
make manifests
make buildAfter Any Go Code Change
任何Go代码变更后
bash
make lint-fix # Format and fix linting
make build # Build and validatebash
make lint-fix # 格式化并修复代码规范问题
make build # 构建并验证