1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Kubernetes: CRD設計チェックリスト

Posted at

Kubernetesオペレーター開発者がCRDを設計するときに考慮することです。

基本構造設計

  • APIグループとバージョン(apiVersion)が適切に定義されているか
  • リソース名(Kind, plural, singular, shortNames)が命名規則に従っているか
  • スコープ(Namespaced/Cluster)が適切に選択されているか
  • .spec.statusの責務が明確に分離されているか

スキーマ定義

  • すべてのフィールドにOpenAPI v3スキーマが定義されているか
  • 各フィールドに適切な型とバリデーションルールが設定されているか
  • 必須フィールド(required)が適切に指定されているか
  • デフォルト値が必要なフィールドにdefaultが設定されているか
  • フィールドのdescriptionが明確に書かれているか
  • nullableの使用が適切か(特にデフォルト値との関係)

サブリソース

  • Statusサブリソース(spec.subresources.status)が有効化されているか
  • レプリカを持つリソースの場合、Scaleサブリソースが設定されているか
  • 追加プリンタ列(additionalPrinterColumns)が定義されているか

バリデーション

  • フィールドの制約(min/max, pattern等)が適切に設定されているか
  • CELを使った複雑なバリデーションルールが必要な箇所に定義されているか
  • Validation Webhookの必要性を検討したか

バージョニング

  • バージョン戦略(alpha→beta→v1)が計画されているか
  • 複数バージョン提供時のConversion Webhookの必要性を検討したか
  • ストレージバージョン(storage: true)が適切に設定されているか
  • 非推奨化(deprecation)の計画があるか

将来性

  • フィールド設計に拡張の余地があるか
  • 後方互換性を維持できる構造になっているか
  • 標準的なKubernetesパターン(PodTemplateSpec等)を適切に再利用しているか

ドキュメント

  • 各フィールドの説明が十分か
  • 制限事項が明記されているか
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?