8.2.3. 非接続の OpenShift Container Platform クラスター内の Clair データベースへのアクセスの設定
自己管理デプロイメントのために、切断された OpenShift Container Platform クラスターで Clair データベースへのアクセスを設定するには、データベースサービスを特定し、データベースポートを転送し、Clair config.yaml ファイルを更新して localhost を使用するようにします。これにより、clairctl ツールを使用してアップデーターバンドルをデータベースにインポートできます。
前提条件
-
clairctlコマンドラインユーティリティーツールをインストールしている。 - Clair をデプロイしている。
-
Clair の
config.yamlファイルで、disable_updatersおよびairgapパラメーターがTrueに設定されている。 - インターネットにアクセスできる Clair インスタンスからアップデーターバンドルをエクスポートしている。
手順
CLI ツール
ocを使用して、Clair データベースサービスを特定します。次に例を示します。$ oc get svc -n quay-enterprise出力例
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE example-registry-clair-app ClusterIP 172.30.224.93 <none> 80/TCP,8089/TCP 4d21h example-registry-clair-postgres ClusterIP 172.30.246.88 <none> 5432/TCP 4d21h ...Clair データベースポートを転送して、ローカルマシンからアクセスできるようにします。以下に例を示します。
$ oc port-forward -n quay-enterprise service/example-registry-clair-postgres 5432:5432Clair の
config.yamlファイルを更新します。次に例を示します。indexer: connstring: host=localhost port=5432 dbname=postgres user=postgres password=postgres sslmode=disable layer_scan_concurrency: 5 migrations: true scanlock_retry: 10 airgap: true scanner: repo: rhel-repository-scanner: repo2cpe_mapping_file: /data/repository-to-cpe.json package: rhel_containerscanner: name2repos_mapping_file: /data/container-name-repos-map.json各項目の説明:
connstring::データベースへの接続文字列を指定します。rhel-repository-scanner::リポジトリースキャナーの設定を指定します。rhel_containerscanner::コンテナースキャナーの設定を指定します。