7.2.4. エアギャップされた OpenShift クラスターでの Clair データベースへのアクセスの設定

  • kubectl を使用して Clair データベースサービスを判別します。

    $ kubectl 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 データベースポートを転送し、これがローカルマシンからアクセスできるようにします。

    $ kubectl port-forward -n quay-enterprise service/example-registry-clair-postgres 5432:5432
  • Clair 設定ファイルを更新し、複数の connstring フィールドの host の値を localhost に置き換えます。以下に例を示します。

    clair-config.yaml

        ...
        connstring: host=localhost port=5432 dbname=postgres user=postgres password=postgres sslmode=disable
        ...

注記

kubectl port-forward を使用する代わりに kubefwd を使用できます。この方法では、Clair 設定ファイルの connstring フィールドを、localhost を使用するために変更する必要はありません。