{"id":142213,"date":"2019-04-27T08:35:13","date_gmt":"2019-04-27T00:35:13","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=142213"},"modified":"2019-04-10T12:36:22","modified_gmt":"2019-04-10T04:36:22","slug":"kubernetes-storageclass","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/kubernetes-storageclass.html","title":{"rendered":"\u7ec6\u8ff0Kubernetes\u4e2d\u7684StorageClass\u548c\u52a8\u6001\u5377\u4f9b\u7ed9"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u5b58\u50a8\u662f\u5bb9\u5668\u8fd0\u884c\u73af\u5883\u7684\u91cd\u8981\u4e00\u73af\uff0cKubernetes \u63d0\u4f9b\u4e86\u4e00\u4e9b\u7528\u4e8e\u5b58\u50a8\u7ba1\u7406\u7684\u57fa\u7840\u80fd\u529b\u3002\u52a8\u6001\u5377\u4f9b\u7ed9\u662f\u4e00\u4e2a Kubernetes \u72ec\u6709\u7684\u529f\u80fd\uff0c\u8fd9\u4e00\u529f\u80fd\u5141\u8bb8\u6309\u9700\u521b\u5efa\u5b58\u50a8\u5377\u3002\u5728\u6ca1\u6709\u8fd9\u79cd\u80fd\u529b\u4e4b\u524d\uff0c\u96c6\u7fa4\u7ba1\u7406\u5458\u9700\u8981\u6253\u7535\u8bdd\u7ed9\u4ed6\u4eec\u7684\u4e91\u6216\u8005\u5b58\u50a8\u63d0\u4f9b\u8005\u6765\u521b\u5efa\u65b0\u7684\u5b58\u50a8\u5377\uff0c\u6210\u529f\u4ee5\u540e\u518d\u521b\u5efa PersistentVolume\u5bf9\u8c61\uff0c\u624d\u80fd\u591f\u5728 Kubernetes \u4e2d\u4f7f\u7528\u3002\u52a8\u6001\u5377\u4f9b\u7ed9\u80fd\u529b\u8ba9\u7ba1\u7406\u5458\u4e0d\u5fc5\u8fdb\u884c\u9884\u5148\u521b\u5efa\u5b58\u50a8\u5377\uff0c\u800c\u662f\u968f\u7528\u6237\u9700\u6c42\u8fdb\u884c\u521b\u5efa\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u65b0\u7279\u6027<\/strong><\/span><\/div>\n Alpha \u7248\u672c\u7684\u52a8\u6001\u5377\uff0c\u4e00\u4e2a\u96c6\u7fa4\u540c\u65f6\u53ea\u80fd\u5141\u8bb8\u5355\u72ec\u7684\u3001\u88ab\u786c\u7f16\u7801\u7684\u63d0\u4f9b\u8005\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c Kubernetes \u8981\u63d0\u4f9b\u52a8\u6001\u5377\u7684\u65f6\u5019\uff0c\u5373\u4f7f\u96c6\u7fa4\u4e2d\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5b58\u50a8\u7cfb\u7edf\uff0cKubernetes \u4e5f\u53ea\u4f1a\u4f7f\u7528\u540c\u4e00\u4e2a\u5b58\u50a8\u5377\u63d2\u4ef6\u3002\u5b58\u50a8\u63d0\u4f9b\u8005\u7684\u9009\u578b\u662f\u57fa\u4e8e\u4e91\u73af\u5883\u7c7b\u578b\u51b3\u5b9a\u7684 \u2014\u2014 AWS \u7684 EBS\uff0cGoogle Cloud \u7684 Persistent Disk \u6216\u8005\u662f OpenStack \u7684 Cinder\uff0c\u4ee5\u53ca vSphere \u7684 vSphere Volume\u3002\u53e6\u5916\u53ea\u6709\u5bb9\u91cf\u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u3002\u8fd9\u5c31\u610f\u5473\u7740\uff0c\u5373\u4f7f\u6709\u5176\u4ed6\u53c2\u6570\u53ef\u7528\uff0c\u6240\u6709\u7684\u52a8\u6001\u5377\u9664\u4e86\u5c3a\u5bf8\u5927\u5c0f\uff0c\u5176\u4ed6\u90fd\u662f\u4e00\u6837\u7684\u3002<\/p>\n \u867d\u8bf4\u8fd9\u4e00\u529f\u80fd\u7684 Alpha \u7248\u672c\u5b9e\u7528\u6027\u6709\u9650\uff0c\u8fd9\u6bd5\u7adf\u662f\u8fc8\u51fa\u4e86\u4e00\u6b65\uff0c\u6709\u52a9\u4e8e\u786e\u5b9a\u4eca\u540e\u7684\u53d1\u5c55\u65b9\u5411\u3002<\/p>\n Kubernetes 1.4 \u4e2d\u52a0\u5165\u4e86\u4e00\u4e2a \u65b0\u7684 API \u5bf9\u8c61 StorageClass\uff0c\u53ef\u4ee5\u5b9a\u4e49\u591a\u4e2a StorageClass \u5bf9\u8c61\uff0c\u5e76\u53ef\u4ee5\u5206\u522b\u6307\u5b9a\u5b58\u50a8\u63d2\u4ef6\u3001\u8bbe\u7f6e\u53c2\u6570\uff0c\u7528\u4e8e\u63d0\u4f9b\u4e0d\u540c\u7684\u5b58\u50a8\u5377\u3002\u8fd9\u6837\u7684\u8bbe\u8ba1\u8ba9\u96c6\u7fa4\u7ba1\u7406\u5458\u80fd\u591f\u5728\u540c\u4e00\u4e2a\u96c6\u7fa4\u5185\uff0c\u5b9a\u4e49\u548c\u63d0\u4f9b\u4e0d\u540c\u7c7b\u578b\u7684\u3001\u4e0d\u540c\u53c2\u6570\u7684\u5377\uff08\u76f8\u540c\u6216\u8005\u4e0d\u540c\u7684\u5b58\u50a8\u7cfb\u7edf\uff09\u3002\u8fd9\u6837\u7684\u8bbe\u8ba1\u8fd8\u786e\u4fdd\u4e86\u6700\u7ec8\u7528\u6237\u5728\u65e0\u9700\u4e86\u89e3\u592a\u591a\u7684\u60c5\u51b5\u4e0b\uff0c\u6709\u80fd\u529b\u9009\u62e9\u4e0d\u540c\u7684\u5b58\u50a8\u9009\u9879\u3002<\/p>\n \u7ba1\u7406\u5458\u914d\u7f6e<\/strong><\/span><\/div>\n \u96c6\u7fa4\u7ba1\u7406\u5458\u5b9a\u4e49\u5e76\u53d1\u5e03\u4e86\u4e24\u4e2a StorageClass \u5bf9\u8c61<\/p>\n \r\nkind: StorageClass\r\napiVersion: storage.k8s.io\/v1beta1\r\nmetadata:\r\n name: slow\r\nprovisioner: kubernetes.io\/gce-pd\r\nparameters:\r\n type: pd-standard\r\n<\/pre>\n |