mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-29 14:38:50 +00:00
638 lines
34 KiB
JavaScript
638 lines
34 KiB
JavaScript
"use strict";
|
||
(self["webpackChunkrancher_docs"] = self["webpackChunkrancher_docs"] || []).push([[81420],{
|
||
|
||
/***/ 3905:
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ Zo: () => (/* binding */ MDXProvider),
|
||
/* harmony export */ kt: () => (/* binding */ createElement)
|
||
/* harmony export */ });
|
||
/* unused harmony exports MDXContext, useMDXComponents, withMDXComponents */
|
||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294);
|
||
|
||
|
||
function _defineProperty(obj, key, value) {
|
||
if (key in obj) {
|
||
Object.defineProperty(obj, key, {
|
||
value: value,
|
||
enumerable: true,
|
||
configurable: true,
|
||
writable: true
|
||
});
|
||
} else {
|
||
obj[key] = value;
|
||
}
|
||
|
||
return obj;
|
||
}
|
||
|
||
function _extends() {
|
||
_extends = Object.assign || function (target) {
|
||
for (var i = 1; i < arguments.length; i++) {
|
||
var source = arguments[i];
|
||
|
||
for (var key in source) {
|
||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||
target[key] = source[key];
|
||
}
|
||
}
|
||
}
|
||
|
||
return target;
|
||
};
|
||
|
||
return _extends.apply(this, arguments);
|
||
}
|
||
|
||
function ownKeys(object, enumerableOnly) {
|
||
var keys = Object.keys(object);
|
||
|
||
if (Object.getOwnPropertySymbols) {
|
||
var symbols = Object.getOwnPropertySymbols(object);
|
||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||
});
|
||
keys.push.apply(keys, symbols);
|
||
}
|
||
|
||
return keys;
|
||
}
|
||
|
||
function _objectSpread2(target) {
|
||
for (var i = 1; i < arguments.length; i++) {
|
||
var source = arguments[i] != null ? arguments[i] : {};
|
||
|
||
if (i % 2) {
|
||
ownKeys(Object(source), true).forEach(function (key) {
|
||
_defineProperty(target, key, source[key]);
|
||
});
|
||
} else if (Object.getOwnPropertyDescriptors) {
|
||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||
} else {
|
||
ownKeys(Object(source)).forEach(function (key) {
|
||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||
});
|
||
}
|
||
}
|
||
|
||
return target;
|
||
}
|
||
|
||
function _objectWithoutPropertiesLoose(source, excluded) {
|
||
if (source == null) return {};
|
||
var target = {};
|
||
var sourceKeys = Object.keys(source);
|
||
var key, i;
|
||
|
||
for (i = 0; i < sourceKeys.length; i++) {
|
||
key = sourceKeys[i];
|
||
if (excluded.indexOf(key) >= 0) continue;
|
||
target[key] = source[key];
|
||
}
|
||
|
||
return target;
|
||
}
|
||
|
||
function _objectWithoutProperties(source, excluded) {
|
||
if (source == null) return {};
|
||
|
||
var target = _objectWithoutPropertiesLoose(source, excluded);
|
||
|
||
var key, i;
|
||
|
||
if (Object.getOwnPropertySymbols) {
|
||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
||
|
||
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
||
key = sourceSymbolKeys[i];
|
||
if (excluded.indexOf(key) >= 0) continue;
|
||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
||
target[key] = source[key];
|
||
}
|
||
}
|
||
|
||
return target;
|
||
}
|
||
|
||
var isFunction = function isFunction(obj) {
|
||
return typeof obj === 'function';
|
||
};
|
||
|
||
var MDXContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({});
|
||
var withMDXComponents = function withMDXComponents(Component) {
|
||
return function (props) {
|
||
var allComponents = useMDXComponents(props.components);
|
||
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
||
components: allComponents
|
||
}));
|
||
};
|
||
};
|
||
var useMDXComponents = function useMDXComponents(components) {
|
||
var contextComponents = react__WEBPACK_IMPORTED_MODULE_0__.useContext(MDXContext);
|
||
var allComponents = contextComponents;
|
||
|
||
if (components) {
|
||
allComponents = isFunction(components) ? components(contextComponents) : _objectSpread2(_objectSpread2({}, contextComponents), components);
|
||
}
|
||
|
||
return allComponents;
|
||
};
|
||
var MDXProvider = function MDXProvider(props) {
|
||
var allComponents = useMDXComponents(props.components);
|
||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(MDXContext.Provider, {
|
||
value: allComponents
|
||
}, props.children);
|
||
};
|
||
|
||
var TYPE_PROP_NAME = 'mdxType';
|
||
var DEFAULTS = {
|
||
inlineCode: 'code',
|
||
wrapper: function wrapper(_ref) {
|
||
var children = _ref.children;
|
||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {}, children);
|
||
}
|
||
};
|
||
var MDXCreateElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function (props, ref) {
|
||
var propComponents = props.components,
|
||
mdxType = props.mdxType,
|
||
originalType = props.originalType,
|
||
parentName = props.parentName,
|
||
etc = _objectWithoutProperties(props, ["components", "mdxType", "originalType", "parentName"]);
|
||
|
||
var components = useMDXComponents(propComponents);
|
||
var type = mdxType;
|
||
var Component = components["".concat(parentName, ".").concat(type)] || components[type] || DEFAULTS[type] || originalType;
|
||
|
||
if (propComponents) {
|
||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, _objectSpread2(_objectSpread2({
|
||
ref: ref
|
||
}, etc), {}, {
|
||
components: propComponents
|
||
}));
|
||
}
|
||
|
||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, _objectSpread2({
|
||
ref: ref
|
||
}, etc));
|
||
});
|
||
MDXCreateElement.displayName = 'MDXCreateElement';
|
||
function createElement (type, props) {
|
||
var args = arguments;
|
||
var mdxType = props && props.mdxType;
|
||
|
||
if (typeof type === 'string' || mdxType) {
|
||
var argsLength = args.length;
|
||
var createElementArgArray = new Array(argsLength);
|
||
createElementArgArray[0] = MDXCreateElement;
|
||
var newProps = {};
|
||
|
||
for (var key in props) {
|
||
if (hasOwnProperty.call(props, key)) {
|
||
newProps[key] = props[key];
|
||
}
|
||
}
|
||
|
||
newProps.originalType = type;
|
||
newProps[TYPE_PROP_NAME] = typeof type === 'string' ? type : mdxType;
|
||
createElementArgArray[1] = newProps;
|
||
|
||
for (var i = 2; i < argsLength; i++) {
|
||
createElementArgArray[i] = args[i];
|
||
}
|
||
|
||
return react__WEBPACK_IMPORTED_MODULE_0__.createElement.apply(null, createElementArgArray);
|
||
}
|
||
|
||
return react__WEBPACK_IMPORTED_MODULE_0__.createElement.apply(null, args);
|
||
}
|
||
|
||
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 96561:
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ assets: () => (/* binding */ assets),
|
||
/* harmony export */ contentTitle: () => (/* binding */ contentTitle),
|
||
/* harmony export */ "default": () => (/* binding */ MDXContent),
|
||
/* harmony export */ frontMatter: () => (/* binding */ frontMatter),
|
||
/* harmony export */ metadata: () => (/* binding */ metadata),
|
||
/* harmony export */ toc: () => (/* binding */ toc)
|
||
/* harmony export */ });
|
||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294);
|
||
/* harmony import */ var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3905);
|
||
/* @jsxRuntime classic */ /* @jsx mdx */ /* @jsxFrag React.Fragment */ function _define_property(obj, key, value) {
|
||
if (key in obj) {
|
||
Object.defineProperty(obj, key, {
|
||
value: value,
|
||
enumerable: true,
|
||
configurable: true,
|
||
writable: true
|
||
});
|
||
} else {
|
||
obj[key] = value;
|
||
}
|
||
return obj;
|
||
}
|
||
function _object_spread(target) {
|
||
for(var i = 1; i < arguments.length; i++){
|
||
var source = arguments[i] != null ? arguments[i] : {};
|
||
var ownKeys = Object.keys(source);
|
||
if (typeof Object.getOwnPropertySymbols === "function") {
|
||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||
}));
|
||
}
|
||
ownKeys.forEach(function(key) {
|
||
_define_property(target, key, source[key]);
|
||
});
|
||
}
|
||
return target;
|
||
}
|
||
function ownKeys(object, enumerableOnly) {
|
||
var keys = Object.keys(object);
|
||
if (Object.getOwnPropertySymbols) {
|
||
var symbols = Object.getOwnPropertySymbols(object);
|
||
if (enumerableOnly) {
|
||
symbols = symbols.filter(function(sym) {
|
||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||
});
|
||
}
|
||
keys.push.apply(keys, symbols);
|
||
}
|
||
return keys;
|
||
}
|
||
function _object_spread_props(target, source) {
|
||
source = source != null ? source : {};
|
||
if (Object.getOwnPropertyDescriptors) {
|
||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||
} else {
|
||
ownKeys(Object(source)).forEach(function(key) {
|
||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||
});
|
||
}
|
||
return target;
|
||
}
|
||
function _object_without_properties(source, excluded) {
|
||
if (source == null) return {};
|
||
var target = _object_without_properties_loose(source, excluded);
|
||
var key, i;
|
||
if (Object.getOwnPropertySymbols) {
|
||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
||
for(i = 0; i < sourceSymbolKeys.length; i++){
|
||
key = sourceSymbolKeys[i];
|
||
if (excluded.indexOf(key) >= 0) continue;
|
||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
||
target[key] = source[key];
|
||
}
|
||
}
|
||
return target;
|
||
}
|
||
function _object_without_properties_loose(source, excluded) {
|
||
if (source == null) return {};
|
||
var target = {};
|
||
var sourceKeys = Object.keys(source);
|
||
var key, i;
|
||
for(i = 0; i < sourceKeys.length; i++){
|
||
key = sourceKeys[i];
|
||
if (excluded.indexOf(key) >= 0) continue;
|
||
target[key] = source[key];
|
||
}
|
||
return target;
|
||
}
|
||
|
||
|
||
const frontMatter = {
|
||
title: '在 Rancher 中动态配置新存储'
|
||
};
|
||
const contentTitle = undefined;
|
||
const metadata = {
|
||
"unversionedId": "how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/dynamically-provision-new-storage",
|
||
"id": "how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/dynamically-provision-new-storage",
|
||
"title": "在 Rancher 中动态配置新存储",
|
||
"description": "本文介绍如何为 Rancher 中的工作负载配置新的持久存储。",
|
||
"source": "@site/i18n/zh/docusaurus-plugin-content-docs/current/how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/dynamically-provision-new-storage.md",
|
||
"sourceDirName": "how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage",
|
||
"slug": "/how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/dynamically-provision-new-storage",
|
||
"permalink": "/zh/how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/dynamically-provision-new-storage",
|
||
"draft": false,
|
||
"editUrl": "https://github.com/rancher/rancher-docs/edit/main/docs/how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/dynamically-provision-new-storage.md",
|
||
"tags": [],
|
||
"version": "current",
|
||
"lastUpdatedAt": 1717022978,
|
||
"formattedLastUpdatedAt": "2024年5月29日",
|
||
"frontMatter": {
|
||
"title": "在 Rancher 中动态配置新存储"
|
||
},
|
||
"sidebar": "tutorialSidebar",
|
||
"previous": {
|
||
"title": "设置现有存储",
|
||
"permalink": "/zh/how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/set-up-existing-storage"
|
||
},
|
||
"next": {
|
||
"title": "使用外部 Ceph 驱动",
|
||
"permalink": "/zh/how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/use-external-ceph-driver"
|
||
}
|
||
};
|
||
const assets = {};
|
||
const toc = [
|
||
{
|
||
value: '先决条件',
|
||
id: '先决条件',
|
||
level: 3
|
||
},
|
||
{
|
||
value: '1. 添加一个存储类并将其配置为使用你的存储',
|
||
id: '1-添加一个存储类并将其配置为使用你的存储',
|
||
level: 3
|
||
},
|
||
{
|
||
value: '2. 为使用 StatefulSet 部署的 Pod 使用存储类',
|
||
id: '2-为使用-statefulset-部署的-pod-使用存储类',
|
||
level: 3
|
||
}
|
||
];
|
||
const layoutProps = {
|
||
toc
|
||
};
|
||
const MDXLayout = "wrapper";
|
||
function MDXContent(_param) {
|
||
var { components } = _param, props = _object_without_properties(_param, [
|
||
"components"
|
||
]);
|
||
return /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)(MDXLayout, _object_spread_props(_object_spread({}, layoutProps, props), {
|
||
components: components,
|
||
mdxType: "MDXLayout"
|
||
}), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `本文介绍如何为 Rancher 中的工作负载配置新的持久存储。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `本节假设你了解 Kubernetes 的存储类和持久卷声明的概念。如需更多信息,请参阅`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "p",
|
||
"href": "/zh/how-to-guides/new-user-guides/manage-clusters/create-kubernetes-persistent-storage/manage-persistent-storage/about-persistent-storage"
|
||
}, `存储的工作原理`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `新存储通常由 Amazon EBS 等云提供商提供。但是,新存储不一定要在云中。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `如果你有一个块存储池并且不想使用云提供商,你可以使用 Longhorn 为 Kubernetes 集群提供持久存储。详情请参见`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "p",
|
||
"href": "../../../../../integrations-in-rancher/longhorn.md"
|
||
}, `本页面`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `要为你的工作负载配置新存储,请执行以下步骤:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("ol", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "li",
|
||
"href": "#1-%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%AD%98%E5%82%A8%E7%B1%BB%E5%B9%B6%E5%B0%86%E5%85%B6%E9%85%8D%E7%BD%AE%E4%B8%BA%E4%BD%BF%E7%94%A8%E4%BD%A0%E7%9A%84%E5%AD%98%E5%82%A8"
|
||
}, `添加一个存储类并将其配置为使用你的存储`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "li",
|
||
"href": "#2-%E4%B8%BA%E4%BD%BF%E7%94%A8-statefulset-%E9%83%A8%E7%BD%B2%E7%9A%84-pod-%E4%BD%BF%E7%94%A8%E5%AD%98%E5%82%A8%E7%B1%BB"
|
||
}, `为使用 StatefulSet 部署的 Pod 使用存储类`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("h3", {
|
||
"id": "先决条件"
|
||
}, `先决条件`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("ul", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ul"
|
||
}, `设置持久存储需要`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "li"
|
||
}, `管理卷`), `的`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "li",
|
||
"href": "/zh/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/cluster-and-project-roles#%E9%A1%B9%E7%9B%AE%E8%A7%92%E8%89%B2%E5%8F%82%E8%80%83"
|
||
}, `角色`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ul"
|
||
}, `如果你要为云集群配置存储,则存储和集群主机必须使用相同的云提供商。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ul"
|
||
}, `必须启用云提供商。有关启用云提供商的详细信息,请参阅`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "li",
|
||
"href": "../../../../../pages-for-subheaders/set-up-cloud-providers.md"
|
||
}, `此页面`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ul"
|
||
}, `确保你的存储卷插件可以启用。`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `默认情况下启用以下存储卷插件:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("table", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("thead", {
|
||
parentName: "table"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "thead"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("th", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `名称`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("th", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `插件`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tbody", {
|
||
parentName: "table"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `Amazon EBS Disk`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `aws-ebs`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `AzureFile`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `azure-file`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `AzureDisk`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `azure-disk`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `Google Persistent Disk`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `gce-pd`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `Longhorn`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `flex-volume-longhorn`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `VMware vSphere Volume`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `vsphere-volume`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `本地`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `local`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `网络文件系统`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `nfs`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("tr", {
|
||
parentName: "tbody"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, `hostPath`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("td", {
|
||
parentName: "tr",
|
||
"align": null
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "td"
|
||
}, `host-path`))))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `如果你的存储卷插件没有在上述列表中,你需要`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "p",
|
||
"href": "/zh/how-to-guides/advanced-user-guides/enable-experimental-features/unsupported-storage-drivers"
|
||
}, `使用功能开关来启用不受支持的存储驱动`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("h3", {
|
||
"id": "1-添加一个存储类并将其配置为使用你的存储"
|
||
}, `1. 添加一个存储类并将其配置为使用你的存储`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `这些步骤描述了如何在集群级别设置存储类:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("ol", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `点击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `☰ > 集群管理`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `转到要动态配置持久存储卷的集群,然后单击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `Explore`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `存储 > 存储类`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `创建`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `输入存储类的名称。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `从 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `Provisioner`), ` 下拉列表中,选择要用于动态配置存储卷的服务。例如,如果你有一个 Amazon EC2 集群并且想要使用云存储,请使用 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "li"
|
||
}, `Amazon EBS Disk`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `参数`), `选项卡中,填写服务用于动态配置存储卷所需的信息。每个卷插件都需要不同的信息来动态配置存储卷。有关如何获取此信息的帮助,请参阅服务文档。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `创建`), `。`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `结果`), `:存储类可供 PVC 使用。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `有关存储类参数的完整信息,请参阅官方 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "p",
|
||
"href": "https://kubernetes.io/docs/concepts/storage/storage-classes/#parameters"
|
||
}, `Kubernetes 文档`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("h3", {
|
||
"id": "2-为使用-statefulset-部署的-pod-使用存储类"
|
||
}, `2. 为使用 StatefulSet 部署的 Pod 使用存储类`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `StatefulSet 管理 Pod 的部署和扩展,同时为每个 Pod 维护一个粘性标识。在这个 StatefulSet 中,我们将配置一个 VolumeClaimTemplate。StatefulSet 管理的每个 Pod 都将部署一个基于此 VolumeClaimTemplate 的 PersistentVolumeClaim。PersistentVolumeClaim 将引用我们创建的 StorageClass。因此,在部署 StatefulSet 管理的每个 Pod 时,都会使用 PersistentVolumeClaim 中定义的 StorageClass 来绑定到动态配置的存储。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("ol", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `点击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `☰ > 集群管理`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `转到要将 StorageClass 用于工作负载的集群,然后单击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `Explore`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在左侧导航栏中,单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `工作负载`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `创建`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `单击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `StatefulSet`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `卷声明模板`), `选项卡上,单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `添加声明模板`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `输入持久卷的名称。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `存储类`), `字段中,选择将为此 StatefulSet 管理的 pod 动态配置存储的 StorageClass。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `挂载点`), `字段中,输入工作负载将用于访问卷的路径。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `点击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `启动`), `。`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `结果`), `:StatefulSet 管理的每个 Pod 部署完成后,都会向 Kubernetes master 请求指定的磁盘空间。如果在部署工作负载时具有指定资源的 PV 是可用的,则 Kubernetes master 会将 PV 绑定到具有兼容 PVC 的 Pod。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `要将 PVC 附加到现有工作负载,`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("ol", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `点击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `☰ > 集群管理`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `转到要将 StorageClass 用于工作负载的集群,然后单击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `Explore`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在左侧导航栏中,单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `工作负载`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `单击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `⋮ > 编辑配置`), `,转到使用由 StorageClass 配置的存储的工作负载。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `卷声明模板`), `中,单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `添加声明模板`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `输入持久卷名称。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `存储类`), `字段中,选择将为此 StatefulSet 管理的 pod 动态配置存储的 StorageClass。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `在`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `挂载点`), `字段中,输入工作负载将用于访问卷的路径。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("li", {
|
||
parentName: "ol"
|
||
}, `单击`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "li"
|
||
}, `保存`), `。`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `结果`), `:工作负载将向 Kubernetes master 请求指定的磁盘空间。如果在部署工作负载时具有指定资源的 PV 是可用的,则 Kubernetes master 会将 PV 绑定到 PVC。否则,Rancher 将配置新的持久存储。`));
|
||
}
|
||
MDXContent.isMDXComponent = true;
|
||
|
||
|
||
/***/ })
|
||
|
||
}]); |