2.5. 为您的远程 Git 存储库添加身份验证详情
director Operator (OSPdO)将呈现的 Ansible playbook 存储在远程 Git 存储库中,并使用此存储库跟踪 overcloud 配置更改。您可以使用支持 SSH 身份验证的任何 Git 存储库。您必须将 Git 存储库的详细信息作为名为 git-secret 的 Red Hat OpenShift Platform (RHOCP) Secret 资源提供。
先决条件
- 您的 OSPdO Git 存储库的 SSH 密钥对的私钥。
流程
创建
git-secretSecret 资源:$ oc create secret generic <secret_name> -n <namespace> \ --from-file=git_ssh_identity=<path_to_private_SSH_key> \ --from-literal=git_url=<git_server_URL>-
将
<secret_name> 替换为 secret 的名称,本例中为git-secret。 -
将
<namespace> 替换为在其中创建 secret 的命名空间的名称,例如openstack。 -
将
<path_to_private_SSH_key> 替换为访问 Git 存储库的私钥的路径。 -
使用存储 OSPdO 配置的 git 存储库的 SSH URL 替换
<git_server_URL>,例如ssh://<user>@<server>:2202/repo.git。
-
将
验证 Secret 资源是否已创建:
$ oc get secret/git-secret -n openstack