新增元件
建立元件檔案、完成本機檢查,再提交包含 signed-off commits 的 pull request。
先選擇 capability 和上游專案,再建立元件檔案、完成本機檢查,最後提交 pull request。完成後,你會有一份通過檢查的元件檔案和一個 pull request。
- 使用
nix develop取得 Go、Helm、kubectl、kubeconform、etcd、kube-apiserver 和 kind。 - 執行
smoke和full檢查時,還需要 Linux 上的 Docker。
選擇 capability 和上游專案
Section titled “選擇 capability 和上游專案”選擇 capability(用途類別),再挑選採用 OSI 核准授權的上游專案。優先選擇 CNCF 或 Kubernetes SIG 專案。
如果授權屬於 optInOnly(例如 SSPL-1.0),每個 profile 都只能設為選用(optional)或 unsupported。
建立元件檔案
Section titled “建立元件檔案”參考相似的元件,建立 components/<id>/component.yaml,並在同一個目錄寫好 README。ID 是上游的名稱,例如 traefik。在 provides 寫出 capability,例如 provides: {capability: ingress}。
分別指定 single-node 和 multi-node 這兩個 profile(設定組合)的設定值,並各加一則註解,說明設定原因。
執行本機檢查
Section titled “執行本機檢查”執行以下指令:
cargo run -p zeabur-catalog -- check # schema, license, references, commentscargo run -p zeabur-catalog -- render # helm template + kubeconformgo run ./tools/cmd/catalog e2e -tier check # what every pull request runsgo run ./tools/cmd/catalog e2e -tier full <id>validate 檢查 schema、授權、參照和註解。render 執行 helm template 和 kubeconform。每個 pull request 都會執行 check 層。
提交 pull request
Section titled “提交 pull request”使用 git commit -s 建立含有 sign-off 的 commit,再開啟 pull request。