Image Catalog#
ImageCatalog およびClusterImageCatalog は、 Cluster
を作成するためのイメージを定義できるようにする重要なリソースです。
主な違いはスコープにあります。ImageCatalog
は名前空間ですが、ClusterImageCatalog はクラスタースコープです。
どちらも、イメージのリストで構成される共通の構造を共有し、各イメージのメジャーバージョンを示すmajor
フィールドを備えています。
警告
オペレーターはユーザー定義のメジャーバージョンを信頼し、PostgreSQLバージョンの検出の実行を控えます。カタログで宣言されたメジャーバージョンとPostgreSQLイメージ間のアライメントを保証するのはユーザーの責任です。
major
フィールドの値は、カタログ内で一意を維持し、イメージ間の重複を防ぐ必要があります。ただし、別のカタログは、同じmajor
値で異なるイメージを公開する場合があります。
名前空間``ImageCatalog`` の例
apiVersion: postgresql.k8s.enterprisedb.io/v1
kind: ImageCatalog
metadata:
name: postgresql
namespace: default
spec:
images:
- major: 15
image: quay.io/enterprisedb/postgresql:15.6
- major: 16
image: quay.io/enterprisedb/postgresql:17.4
``ClusterImageCatalog`` リソースを使用したクラスター全体のカタログの例
apiVersion: postgresql.k8s.enterprisedb.io/v1
kind: ClusterImageCatalog
metadata:
name: postgresql
spec:
images:
- major: 15
image: quay.io/enterprisedb/postgresql:15.6
- major: 16
image: quay.io/enterprisedb/postgresql:17.4
Cluster リソースは、 ImageCatalog
またはClusterImageCatalog
を参照して、目的の画像を正確に指定する柔軟性を備えています。
apiVersion: postgresql.k8s.enterprisedb.io/v1
kind: Cluster
metadata:
name: cluster-example
spec:
instances: 3
imageCatalogRef:
apiGroup: postgresql.k8s.enterprisedb.io
kind: ImageCatalog
name: postgresql
major: 16
storage:
size: 1Gi
これらのカタログを使用するクラスターは、継続的な監視を維持します。カタログ内の画像が変更されると、その特定のエントリを参照する 関連するすべてのクラスター の自動更新がトリガーされます。
KubernetesカタログのEDB Postgres#
EDB Postgres for
Kubernetesプロジェクトは、提供するイメージのClusterImageCatalogs
を維持します。これらのカタログは、各メジャーバージョンの最新のイメージで定期的に更新されます。
EDB Postgres for
KubernetesプロジェクトのGitHubリポジトリからClusterImageCatalog.yaml
ファイルを適用することにより、クラスター管理者は、クラスターが指定されたメジャーリリース内の最新バージョンに自動的に更新されるようにできます。
PostgreSQLコンテナイメージ#
latest version of the cluster catalog for the PostgreSQL Container Images をインストールできます
cloudnative-pg/postgres-containers リポジトリ)
kubectl apply \
-f https://raw.githubusercontent.com/cloudnative-pg/postgres-containers/main/Debian/ClusterImageCatalog-bookworm.yaml
PostGISコンテナイメージ#
latest version of the cluster catalog for the PostGIS Container Images をインストールできます
cloudnative-pg/postgis-containers リポジトリ)
kubectl apply \
-f https://raw.githubusercontent.com/cloudnative-pg/postgis-containers/main/PostGIS/ClusterImageCatalog.yaml