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 インスタンスからアップデーターバンドルをエクスポートしている。

手順

  1. 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
    ...

  2. Clair データベースポートを転送して、ローカルマシンからアクセスできるようにします。以下に例を示します。

    $ oc port-forward -n quay-enterprise service/example-registry-clair-postgres 5432:5432
  3. Clair の 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:: コンテナースキャナーの設定を指定します。

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る