6.3.4. 配置对 air-gapped OpenShift 集群中的 Clair 数据库的访问
- 使用 - kubectl确定 Clair 数据库服务:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- 转发 Clair 数据库端口,以便可以从本地机器访问,例如: - kubectl port-forward -n quay-enterprise service/example-registry-clair-postgres 5432:5432 - $ kubectl port-forward -n quay-enterprise service/example-registry-clair-postgres 5432:5432- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- 更新 Clair 配置文件,将多个 - connstring字段中- 的主机值替换为- localhost,例如:- clair-config.yaml - ... connstring: host=localhost port=5432 dbname=postgres user=postgres password=postgres sslmode=disable ...- ... connstring: host=localhost port=5432 dbname=postgres user=postgres password=postgres sslmode=disable ...- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
注意
						作为使用 kubectl port-forward 的替代选择,您可以使用 kubefwd 替代。使用此方法时,不需要修改 Clair 配置文件中的 connstring 字段来使用 localhost。