「手把手教你」離線安裝 OpenShift LVM Storage Operator 全流程!
很多公司用的 OpenShift 集群是部署在內網里的,根本連不上外網。這時候要安裝一些官方組件,比如本地存儲用的 LVM Storage Operator,就沒辦法直接從網上拉取,搞不好還卡在某個步驟出不來。
而 LVM Storage 是紅帽推薦的方式,可以把服務器上的空硬盤直接用起來,給業務分配持久存儲空間,非常實用。
這篇文章就是來解決這個問題的:教你怎么在完全離線的環境下,一步步把 LVM Storage Operator 安裝好、跑起來。
1、目標是啥?
從 Red Hat 官方的 OperatorHub 上,把 lvms-operator
(LVM Storage Operator) 下載回來,離線安裝。你可以選擇下載 所有版本 或 指定版本(比如 4.14.11)。
準備條件:
?OCP版本: 4.16.36?Bastion(help node)節點操作系統: RHEL 9.4 x64?需要先在openshift集群完成倉庫部署。
2、看都有哪些 Operator 可下
oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14
這條命令會告訴你當前這個 Operator Catalog 里都有哪些可選的 Operator。比如你找的是 lvms-operator
,你可以看到它的名稱和默認的 channel(stable-4.14
)。
$ oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14
Logging to .oc-mirror.log
NAME DISPLAY NAME DEFAULT CHANNEL
3scale-operator Red Hat Integration - 3scale threescale-2.15
advanced-cluster-management Advanced Cluster Management for Kubernetes release-2.11
amq-broker-rhel8 Red Hat Integration - AMQ Broker for RHEL 8 (Multiarch) 7.12.x
amq-online Red Hat Integration - AMQ Online stable
amq-streams Streams for Apache Kafka stable
amq-streams-console Streams for Apache Kafka Console alpha
amq7-interconnect-operator Red Hat Integration - AMQ Interconnect 1.10.x
ansible-automation-platform-operator Ansible Automation Platform stable-2.5
ansible-cloud-addons-operator Ansible Cloud Addons stable-2.5-cluster-scoped
apicast-operator Red Hat Integration - 3scale APIcast gateway threescale-2.15
apicurio-registry-3 Red Hat build of Apicurio Registry 3 3.x
authorino-operator Red Hat - Authorino Operator stable
aws-efs-csi-driver-operator AWS EFS CSI Driver Operator stable
aws-load-balancer-operator AWS Load Balancer Operator stable-v1
bamoe-businessautomation-operator IBM Business Automation 8.x-stable
bamoe-kogito-operator IBM BAMOE Kogito Operator 8.x
bare-metal-event-relay Bare Metal Event Relay stable
businessautomation-operator Business Automation stable
cincinnati-operator OpenShift Update Service v1
cluster-kube-descheduler-operator Kube Descheduler Operator stable
cluster-logging Red Hat OpenShift Logging stable-6.0
cluster-observability-operator Cluster Observability Operator stable
clusterresourceoverride ClusterResourceOverride Operator stable
compliance-operator Compliance Operator stable
container-security-operator Red Hat Quay Container Security Operator stable-3.14
costmanagement-metrics-operator Cost Management Metrics Operator stable
cryostat-operator Red Hat build of Cryostat stable
datagrid Data Grid stable
deployment-validation-operator Deployment Validation Operator alpha
devspaces Red Hat OpenShift Dev Spaces stable
devworkspace-operator DevWorkspace Operator fast
dpu-network-operator DPU Network Operator stable
eap JBoss EAP stable
elasticsearch-operator OpenShift Elasticsearch Operator stable-5.8
external-dns-operator ExternalDNS Operator stable-v1
fence-agents-remediation Fence Agents Remediation Operator stable
file-integrity-operator File Integrity Operator stable
fuse-apicurito Red Hat Integration - API Designer fuse-apicurito-7.13.x
fuse-console Red Hat Integration - Fuse Console 7.13.x
fuse-online Red Hat Integration - Fuse Online latest
gatekeeper-operator-product Gatekeeper Operator stable
gcp-filestore-csi-driver-operator GCP Filestore CSI Driver Operator stable
ingress-node-firewall Ingress Node Firewall Operator stable
jaeger-product Red Hat OpenShift distributed tracing platform stable
jws-operator WebServer alpha
kernel-module-management Kernel Module Management stable
kernel-module-management-hub Kernel Module Management (Hub) stable
kiali-ossm Kiali Operator stable
klusterlet-product Klusterlet stable-2.5
kubernetes-nmstate-operator Kubernetes NMState Operator stable
kubevirt-hyperconverged OpenShift Virtualization stable
lifecycle-agent Lifecycle Agent stable
local-storage-operator Local Storage stable
logic-operator-rhel8 OpenShift Serverless Logic Operator alpha
loki-operator Loki Operator stable-6.0
lvms-operator LVM Storage stable-4.14
machine-deletion-remediation Machine Deletion Remediation operator stable
marin3r-operator Red Hat - MARIN3R stable
mcg-operator NooBaa Operator stable-4.14
metallb-operator MetalLB Operator stable
mta-operator Migration Toolkit for Applications Operator stable-v7.2
mtc-operator Migration Toolkit for Containers Operator release-v1.8
mtr-operator Migration Toolkit for Runtimes Operator alpha
mtv-operator Migration Toolkit for Virtualization Operator release-v2.7
multicluster-engine multicluster engine for Kubernetes stable-2.6
multicluster-global-hub-operator-rh Multicluster Global Hub Operator release-1.4
netobserv-operator Network Observability stable
nfd Node Feature Discovery Operator stable
node-healthcheck-operator Node Health Check Operator stable
node-maintenance-operator Node Maintenance Operator stable
node-observability-operator Node Observability Operator alpha
numaresources-operator numaresources-operator 4.14
ocs-client-operator OpenShift Data Foundation Client stable-4.14
ocs-operator OpenShift Container Storage stable-4.14
odf-compose-operator ODF Compose (DO NOT INSTALL) stable-4.14
odf-csi-addons-operator CSI Addons stable-4.14
odf-multicluster-orchestrator ODF Multicluster Orchestrator stable-4.14
odf-operator OpenShift Data Foundation stable-4.14
odr-cluster-operator Openshift DR Cluster Operator stable-4.14
odr-hub-operator Openshift DR Hub Operator stable-4.14
openshift-builds-operator Builds for Red Hat OpenShift Operator latest
openshift-cert-manager-operator cert-manager Operator for Red Hat OpenShift stable-v1
openshift-custom-metrics-autoscaler-operator Custom Metrics Autoscaler stable
openshift-gitops-operator Red Hat OpenShift GitOps latest
openshift-pipelines-operator-rh Red Hat OpenShift Pipelines pipelines-1.15
openshift-secondary-scheduler-operator Secondary Scheduler Operator for Red Hat OpenShift stable
opentelemetry-product Red Hat build of OpenTelemetry stable
orchestrator-operator Orchestrator Operator stable
power-monitoring-operator Power monitoring for Red Hat OpenShift tech-preview
ptp-operator PTP Operator stable
quay-bridge-operator Red Hat Quay Bridge Operator stable-3.14
quay-operator Red Hat Quay stable-3.14
red-hat-camel-k Red Hat Integration - Camel K 1.10.x
red-hat-hawtio-operator HawtIO Operator stable-v1
redhat-oadp-operator OADP Operator stable-1.4
rh-service-binding-operator Service Binding Operator stable
rhacs-operator Advanced Cluster Security for Kubernetes stable
rhbk-operator Red Hat build of Keycloak Operator stable-v26.0
rhdh Red Hat Developer Hub Operator fast
rhods-operator Red Hat OpenShift AI stable
rhpam-kogito-operator RHPAM Kogito Operator 7.x
rhsso-operator Red Hat Single Sign-On Operator stable
rhtas-operator Red Hat Trusted Artifact Signer stable
run-once-duration-override-operator Run Once Duration Override Operator stable
sandboxed-containers-operator OpenShift sandboxed containers Operator stable
secrets-store-csi-driver-operator Secrets Store CSI Driver Operator preview
security-profiles-operator Security Profiles Operator release-alpha-rhel-8
self-node-remediation Self Node Remediation Operator stable
serverless-operator Red Hat OpenShift Serverless stable
service-registry-operator Red Hat build of Apicurio Registry 2.x
service-telemetry-operator Service Telemetry Operator stable-1.5
servicemeshoperator Red Hat OpenShift Service Mesh 2 stable
servicemeshoperator3 Red Hat OpenShift Service Mesh 3 stable
skupper-operator Red Hat Service Interconnect stable-2
smart-gateway-operator Smart Gateway Operator stable-1.5
sriov-network-operator SR-IOV Network Operator stable
submariner Submariner stable-0.19
tang-operator NBDE Tang Server alpha
tempo-product Tempo Operator stable
topology-aware-lifecycle-manager Topology Aware Lifecycle Manager stable
vertical-pod-autoscaler VerticalPodAutoscaler stable
volsync-product VolSync stable
web-terminal Web Terminal fast
windows-machine-config-operator Windows Machine Config Operator stable
(base) [root@registry LVM-storage]#
3、看這個 Operator 都有哪些版本
oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14 --package='lvms-operator' --channel=stable-4.14
它會告訴你像 4.14.1
、4.14.11
、4.14.13
這些版本都可以下。你可以決定要不要全部下載,或者只要某個版本。
VERSIONS
4.14.8
4.14.9
4.14.10
4.14.11
4.14.4
4.14.2
4.14.3
4.14.5
4.14.6
4.14.7
4.14.1
4.14.12
4.14.13
4、配置鏡像下載文件
4.1 下載所有版本寫法
vim LVM-storage-ImageSetConfiguration.yaml
內容如下:
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
archiveSize: 4
storageConfig:
registry:
imageURL: registry.ocp.local:8443/mirror/oc-mirror-metadata
skipTLS: false
mirror:
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
packages:
- name: lvms-operator
channels:
- name: stable
4.2 只下載指定版本
(比如: 4.14.11)
vim LVM-storage-ImageSetConfiguration.yaml
內容如下:
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
archiveSize: 4
storageConfig:
registry:
imageURL: registry.ocp.local:8443/mirror/oc-mirror-metadata
skipTLS: false
mirror:
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
packages:
- name: lvms-operator
channels:
- name: stable
minVersion: "4.14.11"
maxVersion: "4.14.11"
5、開始下載鏡像
oc mirror --config=./LVM-storage-ImageSetConfiguration.yaml file://. | tee -a mirror.log
這條命令會:
1.按照你寫的配置文件,把鏡像從 Red Hat 官方拉下來2.存在你當前目錄里3.并生成一個工作目錄 oc-mirror-workspace
4.里面有各種 manifests、鏡像 blob 文件
你看到類似這些輸出說明下載成功:
wrote mirroring manifests to oc-mirror-workspace/...
<dir>
lvms4/lvms-must-gather-rhel9
blobs:
sha256:xxxxxx
sha256:yyyyyy
....
info: Mirroring completed in 5m45.52s (6.202MB/s)
Creating archive /data/OperatorHub_add/LVM-storage/mirror_seq1_000000.tar
Creating archive /data/OperatorHub_add/LVM-storage/mirror_seq1_000001.tar
以下內容是下載lvm-storage的介質。
$ ll LVM-storage/
total 5144252
-rw-r--r-- 1 root root 370 May 12 08:10 LVM-storage-ImageSetConfiguration.yaml
-rw-r--r-- 1 root root 55213 May 12 08:21 mirror.log
-rw-r--r-- 1 root root 4285552640 May 12 08:21 mirror_seq1_000000.tar
-rw-r--r-- 1 root root 982097920 May 12 08:21 mirror_seq1_000001.tar
drwxr-xr-x 5 root root 58 May 12 08:28 oc-mirror-workspace
可以打包至你的離線 openshift 環境上傳至私有倉庫。
tar zcvf LVM-storage.tar.gz LVM-storage
6、上傳到你自己的私有倉庫
我們離線環境沒法上網,所以得從有網的環境先把 Operator 的鏡像全下載下來,然后手動“搬運”進集群本地。
這個時候你已經用 oc-mirror
成功把 lvms-operator
的所有鏡像下載下來了,里面包含:
?CatalogSource 的配置文件?鏡像倉庫地址的映射(ImageContentSourcePolicy)?對應的 Operator 鏡像包
解壓介質包
tar zxvf LVM-storage.tar.gz
cd LVM-storage
上傳鏡像至鏡像倉庫。
oc mirror --from=./ docker://<YOUR_REGISTRY_URL>/<Project>/<Subpath>
?<YOUR_REGISTRY_URL>
替換為你的本地 registry;
?<Project>
是你創建的項目名;
?<Subpath>
是鏡像的路徑名。
例如:
oc mirror --from=./ docker://registry.ocp.local:8443/init/mirror
你看到的提示類似:
To upload local images to a registry, run:
oc adm catalog mirror file://redhat/redhat-operator-index:v4.14 REGISTRY/REPOSITORY
...
Writing image mapping to oc-mirror-workspace/results-1747038411/mapping.txt
Writing CatalogSource manifests to oc-mirror-workspace/results-1747038411
Writing ICSP manifests to oc-mirror-workspace/results-1747038411
就是讓你把下載好的鏡像用 oc adm catalog mirror
推到你自己私有的 registry(比如你自己搭的 registry.ocp.local)。
登陸 quay 倉庫查看推送內容。
img
7、可選步驟
7.1更新 pull secret(拉鏡像用的賬號密碼)
?? 這條命令是干嘛的?
oc set data secret/pull-secret -n openshift-config --from-file=.dockercnotallow=/root/.docker/config.json
OpenShift 集群拉鏡像(比如安裝 Operator 時)是需要“登錄”鏡像倉庫的。這個登錄信息就保存在一個叫 pull-secret
的 secret 里。
這條命令的意思就是:
?? 把你機器上 /root/.docker/config.json
的登錄信息,更新到 OpenShift 的 pull-secret 里去。
比如你本地配置了訪問你私有 registry 的賬號密碼,那就必須告訴 OpenShift,讓它也能用這個賬號去拉鏡像。
? 什么時候需要做這一步?
??? 你下載的鏡像倉庫是私有的(比如你建了一個 registry.ocp.local:8443
,設置了登錄密碼)?需要做!
?? 如果你拉的是公開鏡像,不需要認證的,那可以跳過這一步。
7.2禁用在線 OperatorHub 源
OpenShift 默認會連 Red Hat 的官方源,也就是:
?certified-operators
?community-operators
?redhat-operators
?redhat-marketplace
通過以下命令也可以看到:
$ oc get catalogsource -n openshift-marketplace
NAME DISPLAY TYPE PUBLISHER AGE
certified-operators Certified Operators grpc Red Hat 94m
community-operators Community Operators grpc Red Hat 94m
redhat-marketplace Red Hat Marketplace grpc Red Hat 94m
redhat-operators Red Hat Operators grpc Red Hat 94m
這些源都是“在線的”,連的是外網。
oc patch OperatorHub cluster --type json -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
?? 這條命令是干嘛的?
這條命令的意思就是:
?? 把 OpenShift 的所有“在線源”給關掉,只用你自己配的離線源。
? 為什么要關?
??? 如果你是純離線環境(根本連不了外網),關了不會有任何副作用,反而能避免 OpenShift 報一堆拉不動鏡像的錯誤。
??? 有時候你在離線環境沒關這些在線源,OperatorHub 頁面會顯示不出離線的 Operator,還報錯:拉不到 xxx 鏡像。
? 什么時候建議執行?
?如果你是完全離線環境
? 建議執行
?如果你是“半離線”,網絡偶爾能連外網 ? 看情況,可以不關。
執行后 openshift-marketplace 屏蔽掉了在線安裝的應用軟件包:
$ oc get packagemanifest -n openshift-marketplace
No resources found in openshift-marketplace namespace.
8、告訴 OpenShift 用我們自己的離線源
OpenShift 默認是連 Red Hat 的官方源安裝 Operator 的,現在要告訴它改用你下載回來的本地源。
8.1創建 CatalogSource
進入你剛剛的目錄,然后執行這個命令:
cd LVM-storage/oc-mirror-workspace/results-1747038411
oc create -f catalogSource-cs-redhat-operator-index.yaml
這個文件定義了一個新的 Operator 安裝源,也就是從你本地的 registry 去找 Operator,比如你本地搭了個 registry.ocp.local:8443
的倉庫。
再次檢查 catalogs。
$ oc get catalogsources.operators.coreos.com -n openshift-marketplace
NAME DISPLAY TYPE PUBLISHER AGE
certified-operators Certified Operators grpc Red Hat 141d
community-operators Community Operators grpc Red Hat 141d
cs-certified-operator-index grpc 140d
cs-redhat-operator-index grpc 7m39s 更新增加的catalogs
redhat-marketplace Red Hat Marketplace grpc Red Hat 141d
redhat-operators Red Hat Operators grpc Red Hat 141d
8.2設置鏡像源映射(ImageContentSourcePolicy)
然后執行:
oc create -f imageContentSourcePolicy.yaml
這個文件是告訴 OpenShift:“原來你要從 registry.redhat.io
拉鏡像,現在改成去 registry.ocp.local:8443
拉”。
但有時候你會看到這個報錯:
Error from server (AlreadyExists): error when creating "imageContentSourcePolicy.yaml": imagecontentsourcepolicies.operator.openshift.io "operator-0" already exists
意思是:這個配置你之前已經加過一次了,不能重復創建。
?? 解決辦法:直接編輯已有的那個配置,手動加上你需要的新內容就行了。
執行:
oc edit ImageContentSourcePolicy operator-0
在里面追加你的離線鏡像地址,比如加上下面這兩段:
- mirrors:
- registry.ocp.local:8443/init/mirror/openshift4
source: registry.redhat.io/openshift4
- mirrors:
- registry.ocp.local:8443/init/mirror/lvms4
source: registry.redhat.io/lvms4
改完保存退出。
8.3等節點自動滾動更新(這步要等一會)
你加完 ImageContentSourcePolicy 后,OpenShift 會自動讓所有節點重啟一下相關服務,讓系統知道以后鏡像要去新地址拉。
你可以這樣看更新進度:
oc get mcp
你可能會看到:
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE
master rendered-master-5df4ea31a549fd306c146c0e1ed2d426 False True False 3 2 3 0 141d
worker rendered-worker-9846e877644c118fd52da868a16245c5 False True False 3 0 0 0 141d
這說明正在更新中,等個十幾分鐘,直到你看到:
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE
master rendered-master-5df4ea31a549fd306c146c0e1ed2d426 True False False 3 3 3 0 141d
worker rendered-worker-82c510a8ed1808232c9a2d7d12632810 True False False 3 3 3 0 141d
就說明更新完成了,節點都識別了新的鏡像地址。
你也可以看一下 MachineConfig Operator 的狀態:
oc describe co/machine-config | grep -A 2 Extension
輸出長這樣就代表 OK:
Master: all 3 nodes are at latest configuration rendered-master-xxxxx
Worker: all 3 nodes are at latest configuration rendered-worker-xxxxx
9、用圖形界面安裝 LVM Storage Operator
前面這些是后臺準備工作,搞定之后,你就可以:
1.打開 OpenShift 的 Web 控制臺(console 頁面)2.進入 OperatorHub 頁面3.搜索你要裝的 LVM Storage Operator4.看到它成功顯示在列表里,說明 CatalogSource 生效了5.點進去圖形化安裝就行了 ?
image.png
在這里插入圖片描述
?1?? Update channel(更新通道) ? 選擇:stable-4.14
意思是你要安裝的是穩定版,適配 OpenShift 4.14 的版本。
?2?? Version(版本) ? 選擇:4.14.11
這個是 Operator 的具體版本。你選的是 4.14.11
,說明你用的是和你集群兼容的推薦版本。
?3?? Installation mode(安裝模式) ? 選擇:A specific namespace on the cluster
意思是只裝在某一個命名空間里,不能裝在整個集群里,這是這個 Operator 的限制。
?4?? Installed Namespace(安裝在哪個命名空間) ? 選擇:openshift-storage
(推薦) 系統建議用 openshift-storage
這個命名空間,說明這個是官方推薦的名字。 ?? 黃色提示:Namespace already exists
這個不是報錯,是告訴你這個命名空間已經存在了,沒關系,可以繼續用。
?5?? Update approval(更新策略) ? 選擇:Manual
(手動批準) 你選的是手動更新,這樣以后如果 Operator 有升級,系統不會自動裝,你要手動點“批準”才會更新。 ?? 藍色提示解釋: 如果你選了手動,同一個命名空間里的其他 Operator 也都會走手動流程。這是 OpenShift 的機制。 如果你希望以后自動升級,就要統一設置成 Automatic
。
安裝過程中
image.png
安裝成功顯示如下:
image.png
10、創建 LVMCluster 實例
當你圖形界面安裝完 LVM Storage Operator 后,別急,還差最后一塊磚——你得手動創建一個叫 LVMCluster
的實例,整個存儲才算真正“生效”。
圖片
看上面這張圖,下面給你解釋怎么操作:
?? 黃色提示欄:
LVMCluster required ?? 意思就是:你裝完 Operator 只是“架子搭好了”,但還沒“開業營業”。要真正用上本地存儲,就必須創建一個 LVMCluster 實例。
?? 第一步:點藍色按鈕 Create LVMCluster
這個按鈕就相當于“開通服務”,點進去之后你會填寫一些 LVM 存儲集群的基本配置。
?? 提示下方的“Create instance”也是一樣的作用:
這個是底下的另一種入口,作用和上面藍色按鈕一樣,點哪個都行。
?? 小科普:LVMCluster 是干嘛的? 它是這個 Operator 的“核心資源對象”,你可以理解為:
?Operator 是安裝工具?LVMCluster 才是你真正的“本地存儲集群配置” 你可以通過它指定哪些節點參與存儲,哪些盤被用來創建 PV,甚至指定調度策略。
image.png
上一步你點了“Create LVMCluster”,就到了這個填寫表單的界面。現在你只要把該填的填完,點創建,這個存儲集群就成型了!
?? 下面一項一項說清楚:
?? Name(必填)
??? 就是給你這個 LVMCluster 起個名字?示例圖里填的是 test-lvmcluster
?? 建議用有意義的名字,比如 local-lvm
或者你項目相關的名字
??? Labels(可選)
??? 是 Kubernetes 的標簽,方便后續資源篩選和管理?比如你打了 app=frontend
,那就表示這個 LVMCluster 是給 frontend 服務用的
??? 不是必須填,初學者可以先空著
?? Storage(重點)
展開下面的 storage
區域,是整個 LVMCluster 的核心配置。
?? deviceClasses
??? 是指你要用哪些盤來做 LVM 存儲池?每個 deviceClass
就像是一個“本地存儲的分類策略”
image.png
在這里插入圖片描述
?? thinPoolConfig(必填)
??? 這是在每個 deviceClass
里設置的 LVM thin pool(稀疏池)配置?一般默認就行,不需要改動(比如圖里就是 default
)
需要您在worker節點提前創建好卷組(VG)與邏輯卷(LV)。
pvcreate /dev/sdb
vgcreate data-vg /dev/sdb
lvcreate -l +100%FREE -T data-vg/thin-pool-1
?? 藍框提醒: “Some fields may not be represented in this form view...” ?? 意思是:這個表單可能漏了一些參數,如果你是高手可以切換到 YAML 模式填更詳細的內容。 ?? 但如果你是剛入門,表單填默認值直接點創建基本就夠用啦!
??fstype(文件系統類型):選擇為 xfs
(點擊下拉菜單選擇)。
??name(名字):填寫為 data-vg
。這就是你要創建的 VG(卷組)名稱。
(可選)其它配置項說明:
??default:如果你希望這個配置是默認的,可以勾選 default
。
??nodeSelector 和 tolerations:可以不填,除非你需要指定某些節點或容忍某些污點節點。
配置完成后,點擊左下角的藍色 Create
按鈕提交。
該圖為 LVMClusters 創建中。
image.png
該圖為 LVMClusters 創建成功。
image.png
命令行可以看到storageclass 資源對象。
$ kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
lvms-data-vg (default) topolvm.io Delete WaitForFirstConsumer true 40h
11、大功告成!
你現在已經:
?成功在 OpenShift 上用離線方式安裝了 LVM Storage Operator?安裝成功后創建了 LVMCluster?后續你就可以通過 LVM 提供的 storageclass 來動態申請 PVC 了!
12、小問答時間
小問答一:
問:離線環境中安裝 LVM Storage Operator 有哪些準備工作?
答:需要提前下載 Operator 鏡像與 Catalog 信息,并配置本地鏡像倉庫與 CatalogSource,確保 OpenShift 能在無外網的情況下完成安裝。
小問答二:
問:創建 LVMCluster 后如何判斷是否成功?
答:可通過 StorageClass 是否生成、PVC 是否能正常綁定來驗證;同時檢查對應 Pod 是否正常運行,無報錯事件。