新增範本
建立符合標準的範本,完成本機檢查後提交 Pull Request。
參考類似的範本建立檔案,加入煙霧測試(smoke check)。完成本機檢查後,再提交 Pull Request。
建立範本檔案
Section titled “建立範本檔案”參考類似的範本,建立 templates/<id>/template.yaml 和 manifests.yaml。檔案結構請參考範本檔案格式。
範本 ID 請使用小寫單字,字之間用連字號相連,最長 49 個字元。
符合範本標準
Section titled “符合範本標準”依照範本標準檢查範本:
- 固定映像檔版本。
- 符合 Restricted Pod Security。
- 為沒有登入功能的服務加入入站 NetworkPolicy。
- 設定資源上限。
- 為有狀態的資料提供備份。
加入煙霧測試
Section titled “加入煙霧測試”加入資源條件檢查,以及 HTTP 或 SQL 檢查,確認應用程式能正常回應。
準備 values.json,內容必須是 JSON 物件。範本要求的每個輸入都必須填入值。
執行以下指令:
cargo run -p zeabur-catalog -- checkgo run ./tools/cmd/catalog template lint -values values.json \ -domain app.example.test -cluster-issuer letsencrypt <id>go run ./tools/cmd/catalog e2e -tier full <id>提交 Pull Request
Section titled “提交 Pull Request”使用 git commit -s 建立附有簽署聲明的 commit,再提交 Pull Request。