{"id":546,"date":"2020-03-25T17:42:24","date_gmt":"2020-03-25T09:42:24","guid":{"rendered":"https:\/\/www.yinyubo.cn\/?p=546"},"modified":"2022-05-17T09:41:14","modified_gmt":"2022-05-17T01:41:14","slug":"storageclass","status":"publish","type":"post","link":"https:\/\/www.yinyubo.com\/?p=546","title":{"rendered":"\u5728K8S\u91cc\u4f7f\u7528NFS\u505astorageclass"},"content":{"rendered":"<p>\u53c2\u8003github\uff1ahttps:\/\/github.com\/kubernetes-incubator\/external-storage\/tree\/master\/nfs-client<\/p>\n<hr \/>\n<p>1.\u4f7f\u7528helm\u5b89\u88c5nfs-client\uff0c\u6ce8\u610f\u586b\u5199nfs\u670d\u52a1\u5668\u7684\u5730\u5740\u548c\u66b4\u9732\u8def\u5f84<\/p>\n<pre class=\"lang:python decode:true \"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">$ helm install stable\/nfs-client-provisioner --set nfs.server=x.x.x.x --set nfs.path=\/exported\/path\n<\/code><\/pre>\n<hr \/>\n<p>2.\u7f16\u5199storageclass.yaml\u5e76\u4f7f\u5176\u751f\u6548<\/p>\n<pre class=\"lang:python decode:true\"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">apiVersion: storage.k8s.io\/v1\nkind: StorageClass\nmetadata:\n  name: managed-nfs-storage\nprovisioner: fuseim.pri\/ifs<\/code><\/pre>\n<hr \/>\n<p>3.\u8bbe\u7f6e\u8fd9\u4e2astorageclass\u4e3a\u9ed8\u8ba4storageclass<\/p>\n<pre class=\"lang:python decode:true \"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">kubectl patch storageclass nfs-client -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io\/is-default-class\":\"true\"}}}'<\/code><\/pre>\n<hr \/>\n<p>4.\u6ce8\u610f\u8fd9\u8fb9\u4e0b\u8f7dquay.azk8s.cn\/external_storage\/nfs-client-provisioner:v3.1.0-k8s1.11\u8fd9\u4e2a\u955c\u50cf\u53ef\u80fd\u5f88\u6162\uff0c\u53ef\u4ee5\u8c03\u6574\u6210\u56fd\u5185\u6e90\u4e0b\u8f7d\uff0c\u518d\u91cd\u547d\u540d\u3002\u4f8b\u5982\u4e0b\u9762\u7684\u547d\u4ee4<\/p>\n<pre class=\"lang:python decode:true \"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">docker pull quay.azk8s.cn\/external_storage\/nfs-client-provisioner:v3.1.0-k8s1.11\ndocker tag quay.azk8s.cn\/external_storage\/nfs-client-provisioner:v3.1.0-k8s1.11 quay.io\/external_storage\/nfs-client-provisioner:v3.1.0-k8s1.11<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003github\uff1ahttps:\/\/github.com\/kubernetes-incubator\/extern [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-k8s"],"_links":{"self":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=546"}],"version-history":[{"count":1,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions"}],"predecessor-version":[{"id":888,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions\/888"}],"wp:attachment":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}