{"id":1190,"date":"2026-07-23T06:54:20","date_gmt":"2026-07-23T06:54:20","guid":{"rendered":"https:\/\/opshub.com.cn\/?p=1190"},"modified":"2026-07-23T09:30:23","modified_gmt":"2026-07-23T09:30:23","slug":"%e5%9c%a8rancher%e9%87%8c%e5%ae%89%e8%a3%85longhorn%e5%88%86%e5%b8%83%e5%bc%8f%e5%9d%97%e5%ad%98%e5%82%a8","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=1190","title":{"rendered":"\u5728rancher\u91cc\u5b89\u88c5longhorn\u5206\u5e03\u5f0f\u5757\u5b58\u50a8"},"content":{"rendered":"\n<p>rancher\u7248\u672c\uff1av2.5.17<\/p>\n\n\n\n<p>\u64cd\u4f5c\u7cfb\u7edf\uff1acentos 8.4.2105<\/p>\n\n\n\n<p>\u4e00\u3001\u5b89\u88c5longhorn<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A container runtime compatible with Kubernetes (Docker v1.13+, containerd v1.3.7+, etc.)<\/li>\n\n\n\n<li>Kubernetes v1.18+<\/li>\n\n\n\n<li>Make sure&nbsp;<code>bash<\/code>,&nbsp;<code>curl<\/code>,&nbsp;<code>findmnt<\/code>,&nbsp;<code>grep<\/code>,&nbsp;<code>awk<\/code>&nbsp;and&nbsp;<code>blkid<\/code>&nbsp;has been installed in all nodes of the Kubernetes cluster.<\/li>\n\n\n\n<li>Make sure&nbsp;<code>open-iscsi<\/code>&nbsp;has been installed, and the&nbsp;<code>iscsid<\/code>&nbsp;daemon is running on all nodes of the Kubernetes cluster. For GKE, recommended Ubuntu as guest OS image since it contains&nbsp;<code>open-iscsi<\/code>&nbsp;already.<\/li>\n<\/ol>\n\n\n\n<p>\u7b2c4\u70b9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install iscsi-initiator-utils -y\nsystemctl enable --now iscsid<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1974\" height=\"507\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_133833_811.png\" alt=\"\" class=\"wp-image-1192\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2547\" height=\"1182\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_134015_111.png\" alt=\"\" class=\"wp-image-1194\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2538\" height=\"600\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_134230_948.png\" alt=\"\" class=\"wp-image-1196\"\/><\/figure>\n\n\n\n<p>\u70b9\u51fb\u201c\u5b89\u88c5\u201d<\/p>\n\n\n\n<p>\u5b89\u88c5\u5982\u679c\u5931\u8d25\uff0c\u53ef\u4ee5\u91cd\u8bd5\u5b89\u88c5\uff0c\u5728\u91cd\u8bd5\u5b89\u88c5\u4e4b\u524d\uff0c\u5148\u5378\u8f7d\u5e72\u51c0longhorn\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>helm uninstall longhorn -n longhorn-system --no-hooks --wait --timeout 10m<\/code><\/pre>\n\n\n\n<p>release &#8220;longhorn&#8221; uninstalled<\/p>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u8fdb\u5165longhorn ui\u754c\u9762\u67e5\u770b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"513\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_135313_749.png\" alt=\"\" class=\"wp-image-1198\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2544\" height=\"1388\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_135505_963.png\" alt=\"\" class=\"wp-image-1200\"\/><\/figure>\n\n\n\n<p>\u4e8c\u3001\u4f7f\u7528longhorn<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2547\" height=\"441\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_140346_148.png\" alt=\"\" class=\"wp-image-1202\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1004\" height=\"1368\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_140535_254.png\" alt=\"\" class=\"wp-image-1204\"\/><\/figure>\n\n\n\n<p>\u521b\u5efa\u5b8c\u540e\uff0c\u72b6\u6001\u662fDetached\uff0c\u8fd9\u91cc\u4e0d\u9700\u8981\u624b\u52a8Attach\uff0c\u8bb0\u4f4fName\uff1aapp-test-v-0002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2103\" height=\"161\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_140943_448.png\" alt=\"\" class=\"wp-image-1206\"\/><\/figure>\n\n\n\n<p>\u7136\u540e\uff0c\u56de\u5230\uff1a\u96c6\u7fa4\u6d4f\u89c8\u5668\uff0c\u5b58\u50a8\uff0cPersistentVolumes\uff0c\u521b\u5efa<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2544\" height=\"819\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_141112_876.png\" alt=\"\" class=\"wp-image-1208\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2151\" height=\"1290\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_141510_504.png\" alt=\"\" class=\"wp-image-1210\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1209\" height=\"519\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_141659_464.png\" alt=\"\" class=\"wp-image-1212\"\/><\/figure>\n\n\n\n<p>\u521b\u5efapv\u540e\uff0c\u72b6\u6001\u662f\uff1aavailable<\/p>\n\n\n\n<p>\u521b\u5efapvc\uff08\u6301\u4e45\u5377\u6d88\u8d39\uff09\uff0c\u5b58\u50a8\uff0cPersistentVolumeClaims<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2553\" height=\"1158\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_142131_210.png\" alt=\"\" class=\"wp-image-1214\"\/><\/figure>\n\n\n\n<p>\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u72b6\u6001\u662f\uff1abound<\/p>\n\n\n\n<p>\u56de\u5230Longhorn ui\uff0c\u67e5\u770b\u5377\u7684pv\/pvc\u5206\u914d\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2538\" height=\"963\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_142420_865.png\" alt=\"\" class=\"wp-image-1216\"\/><\/figure>\n\n\n\n<p>\u5f80\u540e\uff0c\u521b\u5efadepolyment\/StatefulSet\u65f6\u5019\uff0clonghorn\u7684\u5377\u4f1a\u81ea\u52a8\u9644\u5230\u8282\u70b9\u4e0a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2172\" height=\"393\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_144515_256.png\" alt=\"\" class=\"wp-image-1224\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2151\" height=\"879\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_143551_204.png\" alt=\"\" class=\"wp-image-1220\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2121\" height=\"900\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_143817_747.png\" alt=\"\" class=\"wp-image-1222\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"837\" height=\"791\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_144659_260.png\" alt=\"\" class=\"wp-image-1226\"\/><\/figure>\n\n\n\n<p>Longhorn \u6302\u8f7d\u6301\u4e45\u5377\uff08PV\/PVC\uff09\u5230 Nginx Pod \u7684 <code>\/usr\/share\/nginx\/html<\/code> \u540e, \u5982\u679c\u60a8\u5e0c\u671b\u6bcf\u6b21\u90e8\u7f72\u6216\u66f4\u65b0\u65f6\u81ea\u52a8\u51c6\u5907\u597d\u9759\u6001\u9875\u9762\uff08\u9002\u5408 CICD \u6216\u751f\u4ea7\u73af\u5883\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528\u521d\u59cb\u5316\u5bb9\u5668\u81ea\u52a8\u5bfc\u5165\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1089\" height=\"594\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_155418_314.png\" alt=\"\" class=\"wp-image-1232\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2133\" height=\"759\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_155949_218.png\" alt=\"\" class=\"wp-image-1234\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2139\" height=\"849\" src=\"https:\/\/opshub.com.cn\/wp-content\/uploads\/2026\/07\/ScreenShot_2026-07-23_155828_251.png\" alt=\"\" class=\"wp-image-1236\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>rancher\u7248\u672c\uff1av2.5.17 \u64cd\u4f5c\u7cfb\u7edf\uff1acentos 8.4.2105 \u4e00\u3001\u5b89\u88c5longhorn Prerequisites \u7b2c4\u70b9\uff1a \u70b9\u51fb\u201c\u5b89\u88c5\u201d \u5b89\u88c5\u5982\u679c\u5931\u8d25\uff0c\u53ef\u4ee5\u91cd\u8bd5\u5b89\u88c5\uff0c\u5728\u91cd\u8bd5\u5b89\u88c5\u4e4b\u524d\uff0c\u5148\u5378\u8f7d\u5e72\u51c0longhorn\uff1a release &#8220;longhorn&#8221; uninstalled \u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u8fdb\u5165longhorn ui\u754c\u9762\u67e5\u770b \u4e8c\u3001\u4f7f\u7528longhorn \u521b\u5efa\u5b8c\u540e\uff0c\u72b6\u6001\u662fDetached\uff0c\u8fd9\u91cc\u4e0d\u9700\u8981\u624b\u52a8Attach\uff0c\u8bb0\u4f4fName\uff1aapp-test-v-0002 \u7136\u540e\uff0c\u56de\u5230\uff1a\u96c6\u7fa4\u6d4f\u89c8\u5668\uff0c\u5b58\u50a8\uff0cPersistentVolumes\uff0c\u521b\u5efa \u521b\u5efapv\u540e\uff0c\u72b6\u6001\u662f\uff1aavailable \u521b\u5efapvc\uff08\u6301\u4e45\u5377\u6d88\u8d39\uff09\uff0c\u5b58\u50a8\uff0cPersistentVolumeClaims \u521b\u5efa\u5b8c\u6210\u540e\uff0c\u72b6\u6001\u662f\uff1abound \u56de\u5230Longhorn ui\uff0c\u67e5\u770b\u5377\u7684pv\/pvc\u5206\u914d\uff1a \u5f80\u540e\uff0c\u521b\u5efadepolyment\/StatefulSet\u65f6\u5019\uff0clonghorn\u7684\u5377\u4f1a\u81ea\u52a8\u9644\u5230\u8282\u70b9\u4e0a Longhorn \u6302\u8f7d\u6301\u4e45\u5377\uff08PV\/PVC\uff09\u5230 Nginx Pod \u7684 \/usr\/share\/nginx\/html \u540e, \u5982\u679c\u60a8\u5e0c\u671b\u6bcf\u6b21\u90e8\u7f72\u6216\u66f4\u65b0\u65f6\u81ea\u52a8\u51c6\u5907\u597d\u9759\u6001\u9875\u9762\uff08\u9002\u5408 CICD \u6216\u751f\u4ea7\u73af\u5883\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528\u521d\u59cb\u5316\u5bb9\u5668\u81ea\u52a8\u5bfc\u5165\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1190","post","type-post","status-publish","format-standard","hentry","category-dockerkubernetes"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1190"}],"version-history":[{"count":3,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1190\/revisions"}],"predecessor-version":[{"id":1238,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1190\/revisions\/1238"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}