Cloud Cost Sense
Google Artifact Registry の費用:保存、転送、cleanup policy
保存 image layer、repository location、download、脆弱性 scan、cleanup policy から Google Artifact Registry の費用を見積もります。
保存 layer と version の増加を見積もる
Artifact Registry storage は保存中の artifact が基準です。Container layer や package の圧縮 size と保持する version 数を確認します。共有 layer により実際の増加は image size と tag 数の単純な積より小さい場合がありますが、base image を頻繁に変えると新しい layer が増えます。Source code の size ではなく、一つの release cycle で repository storage を測定してください。
Standard repository と remote repository は artifact を保存しますが、virtual repository は独自の copy を保存せず upstream へ request を送ります。Storage の無料枠は project ごとではなく billing account 全体に適用されます。変わり得る金額を固定せず、公式の最新料金ページで allowance と rate を確認します。
Repository から consumer までの download 経路を整理する
Data transfer は repository の location と artifact の配信先で変わります。同じ location への pull は転送料を避けられる場合がありますが、region 間、大陸間、Internet、on-premises への download には異なる rate が適用され得ます。Cloud Run、GKE node、Compute Engine VM、CI runner、開発端末の location を記録してください。
転送量は deployment ごとの image または package byte に、deployment、新規 node、environment、destination の数を掛けて見積もります。Layer cache は反復 download を減らしますが、autoscaling、一時的な CI worker、頻繁な base-image 更新は効果を弱めます。Latency、resilience、data residency が許せば、repository を主要 runtime と同じ location に置きます。
Scan 費用を加え、安全に cleanup する
関連する scanning API と対応機能を有効にすると、脆弱性 scan は別の費用要素になります。対象 repository と artifact type、新しい image の push 頻度、CI の on-demand scan を調べてください。すべての scan を同じ料金と考える前に、最新の Artifact Analysis 料金と Security Command Center tier を確認します。
Cleanup policy で不要な version を削除し、production release や一定数の最新 version を保持します。最初に dry run で一致対象を確認し、rollback artifact を保護してから削除を有効にしてください。Cleanup は background で動くため、storage は即時には減りません。通常の release 月と build 頻度が高い月を比較し、導入後の storage と transfer の請求を監視します。