17.2. 配置 airgapped 环境
要配置 airgapped 环境,您必须有权访问 registry.redhat.io 和 airgapped 环境的 registry。有关如何访问这两个 registry 的更多信息,请参阅将 目录内容镜像到 airgapped registry。
流程
创建
openstack命名空间:$ oc new-project openstack创建索引镜像并将其推送到 registry:
$ podman login registry.redhat.io $ podman login your.registry.local $ BUNDLE_IMG="registry.redhat.io/rhosp-rhel8/osp-director-operator-bundle@sha256:c19099ac3340d364307a43e0ae2be949a588fefe8fcb17663049342e7587f055"注意您可以从中获取最新的捆绑包镜像: 认证的容器镜像。搜索
osp-director-operator-bundle。根据 Operator 索引镜像镜像相关的镜像:
$ oc adm catalog mirror ${INDEX_IMG} your.registry.local --insecure --index-filter-by-os='Linux/x86_64'当镜像(mirror)完成后,会在当前目录中生成一个
manifests目录,名为manifests-osp-director-operator-index-<random_number>。将创建的 ImageContentSourcePolicy 应用到集群:$ os apply -f manifests-osp-director-operator-index-<random_number>/imageContentSourcePolicy.yaml-
将
<random_number> 替换为随机生成的数字。
-
将
创建名为
osp-director-operator.yaml的文件,并包含以下 YAML 内容来配置安装 director Operator 所需的三个资源:apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: osp-director-operator-index namespace: openstack spec: sourceType: grpc image: your.registry.local/osp-director-operator-index:1.3.x-y --- apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: "osp-director-operator-group" namespace: openstack spec: targetNamespaces: - openstack --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: osp-director-operator-subscription namespace: openstack spec: config: env: - name: WATCH_NAMESPACE value: openstack,openshift-machine-api,openshift-sriov-network-operator source: osp-director-operator-index sourceNamespace: openstack name: osp-director-operator在
openstack命名空间中创建新资源:$ oc apply -f osp-director-operator.yaml将所需的 overcloud 镜像复制到存储库:
$ for i in $(podman search --limit 1000 "registry.redhat.io/rhosp-rhel9/openstack" --format="{{ .Name }}" | awk '{print $1 ":" "17.1.0"}' | awk -F "/" '{print $2 "/" $3}'); do skopeo copy --all docker://registry.redhat.io/$i docker://your.registry.local/$i;done注意如果使用 Red Hat Satellite 作为本地 registry,请参阅 为容器镜像准备 Satellite 服务器。
- 现在,您可以继续安装 和准备 director Operator。
验证
确认您已成功安装了 director Operator:
$ oc get operators NAME AGE osp-director-operator.openstack 5m