mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-29 14:38:50 +00:00
607 lines
34 KiB
JavaScript
607 lines
34 KiB
JavaScript
"use strict";
|
||
(self["webpackChunkrancher_docs"] = self["webpackChunkrancher_docs"] || []).push([[36322],{
|
||
|
||
/***/ 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);
|
||
}
|
||
|
||
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 14769:
|
||
/***/ ((__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: '启用 Prometheus Federator'
|
||
};
|
||
const contentTitle = undefined;
|
||
const metadata = {
|
||
"unversionedId": "how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/enable-prometheus-federator",
|
||
"id": "version-2.6/how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/enable-prometheus-federator",
|
||
"title": "启用 Prometheus Federator",
|
||
"description": "要求",
|
||
"source": "@site/i18n/zh/docusaurus-plugin-content-docs/version-2.6/how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/enable-prometheus-federator.md",
|
||
"sourceDirName": "how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides",
|
||
"slug": "/how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/enable-prometheus-federator",
|
||
"permalink": "/zh/v2.6/how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/enable-prometheus-federator",
|
||
"draft": false,
|
||
"editUrl": "https://github.com/rancher/rancher-docs/edit/main/versioned_docs/version-2.6/how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/enable-prometheus-federator.md",
|
||
"tags": [],
|
||
"version": "2.6",
|
||
"lastUpdatedAt": 1686824534,
|
||
"formattedLastUpdatedAt": "2023年6月15日",
|
||
"frontMatter": {
|
||
"title": "启用 Prometheus Federator"
|
||
},
|
||
"sidebar": "tutorialSidebar",
|
||
"previous": {
|
||
"title": "Prometheus Federator 指南",
|
||
"permalink": "/zh/v2.6/how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/"
|
||
},
|
||
"next": {
|
||
"title": "卸载 Prometheus Federator",
|
||
"permalink": "/zh/v2.6/how-to-guides/advanced-user-guides/monitoring-alerting-guides/prometheus-federator-guides/uninstall-prometheus-federator"
|
||
}
|
||
};
|
||
const assets = {};
|
||
const toc = [
|
||
{
|
||
value: '要求',
|
||
id: '要求',
|
||
level: 2
|
||
},
|
||
{
|
||
value: '确保 cattle-monitoring-system 命名空间位于 System 项目中(或者位于一个锁定并能访问集群中其他项目的项目中)',
|
||
id: '确保-cattle-monitoring-system-命名空间位于-system-项目中或者位于一个锁定并能访问集群中其他项目的项目中',
|
||
level: 3
|
||
},
|
||
{
|
||
value: '将 rancher-monitoring 配置为仅监视 Helm Chart 创建的资源',
|
||
id: '将-rancher-monitoring-配置为仅监视-helm-chart-创建的资源',
|
||
level: 3
|
||
},
|
||
{
|
||
value: '提高 Cluster Prometheus 的 CPU/内存限制',
|
||
id: '提高-cluster-prometheus-的-cpu内存限制',
|
||
level: 3
|
||
},
|
||
{
|
||
value: '安装 Prometheus Federator 应用程序',
|
||
id: '安装-prometheus-federator-应用程序',
|
||
level: 2
|
||
}
|
||
];
|
||
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)("h2", {
|
||
"id": "要求"
|
||
}, `要求`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `默认情况下,Prometheus Federator 已配置并旨在与 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "p",
|
||
"href": "https://rancher.com/docs/rancher/v2.6/en/monitoring-alerting/"
|
||
}, `rancher-monitoring`), ` 一起部署。rancher-monitoring 同时部署了 Prometheus Operator 和 Cluster Prometheus,每个项目监控堆栈(Project Monitoring Stack)默认会联合命名空间范围的指标。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `有关安装 rancher-monitoring 的说明,请参阅`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "p",
|
||
"href": "/zh/v2.6/how-to-guides/advanced-user-guides/monitoring-alerting-guides/enable-monitoring"
|
||
}, `此页面`), `。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `默认配置与你的 rancher-monitoring 堆栈是兼容的。但是,为了提高集群中 Prometheus Federator 的安全性和可用性,我们建议对 rancher-monitoring 进行以下额外的配置:`), /*#__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)("a", {
|
||
parentName: "li",
|
||
"href": "#%E7%A1%AE%E4%BF%9D-cattle-monitoring-system-%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4%E4%BD%8D%E4%BA%8E-system-%E9%A1%B9%E7%9B%AE%E4%B8%AD%E6%88%96%E8%80%85%E4%BD%8D%E4%BA%8E%E4%B8%80%E4%B8%AA%E9%94%81%E5%AE%9A%E5%B9%B6%E8%83%BD%E8%AE%BF%E9%97%AE%E9%9B%86%E7%BE%A4%E4%B8%AD%E5%85%B6%E4%BB%96%E9%A1%B9%E7%9B%AE%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD"
|
||
}, `确保 cattle-monitoring-system 命名空间位于 System 项目中`)), /*#__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": "#%E5%B0%86-rancher-monitoring-%E9%85%8D%E7%BD%AE%E4%B8%BA%E4%BB%85%E7%9B%91%E8%A7%86-helm-chart-%E5%88%9B%E5%BB%BA%E7%9A%84%E8%B5%84%E6%BA%90"
|
||
}, `将 rancher-monitoring 配置为仅监视 Helm Chart 创建的资源`)), /*#__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": "#%E6%8F%90%E9%AB%98-cluster-prometheus-%E7%9A%84-cpu%E5%86%85%E5%AD%98%E9%99%90%E5%88%B6"
|
||
}, `提高 Cluster Prometheus 的 CPU/内存限制`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("h3", {
|
||
"id": "确保-cattle-monitoring-system-命名空间位于-system-项目中或者位于一个锁定并能访问集群中其他项目的项目中"
|
||
}, `确保 cattle-monitoring-system 命名空间位于 System 项目中(或者位于一个锁定并能访问集群中其他项目的项目中)`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("img", {
|
||
alt: "选择项目/命名空间",
|
||
src: (__webpack_require__(96912)/* ["default"] */ .Z),
|
||
width: "1118",
|
||
height: "402"
|
||
})), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `Prometheus Operator 的安全模型有一定的要求,即希望部署它的命名空间(例如,`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `cattle-monitoring-system`), `)对除集群管理员之外的任何用户都只有有限的访问权限,从而避免通过 Pod 内执行(例如正在执行的 Helm 操作的 Job)来提升权限。此外,如果将 Prometheus Federator 和所有 Project Prometheus 堆栈都部署到 System 项目中,即使网络策略是通过项目网络隔离定义的,每个 Project Prometheus 都依然能够在所有项目中抓取工作负载。它还为项目所有者、项目成员和其他用户提供有限的访问权限,从而确保这些用户无法访问他们不应访问的数据(例如,在 pod 中执行,在项目外部抓取命名空间数据等)。`), /*#__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)("p", {
|
||
parentName: "li"
|
||
}, `打开 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `System`), ` 项目以检查你的命名空间:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", {
|
||
parentName: "li"
|
||
}, `在 Rancher UI 中单击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `Cluster > Projects/Namespaces`), `。这将显示 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `System`), ` 项目中的所有命名空间:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", {
|
||
parentName: "li"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("img", {
|
||
alt: "选择项目/命名空间",
|
||
src: (__webpack_require__(56814)/* ["default"] */ .Z),
|
||
width: "894",
|
||
height: "693"
|
||
}))), /*#__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)("p", {
|
||
parentName: "li"
|
||
}, `如果你在 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `cattle-monitoring-system`), ` 命名空间中已经安装了一个 Monitoring V2,但该命名空间不在 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `System`), ` 项目中,你可以将 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `cattle- monitoring-system`), ` 命名空间移动到 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `System`), ` 项目或另一个访问受限的项目中。为此,你有以下两种方法:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("ul", {
|
||
parentName: "li"
|
||
}, /*#__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", {
|
||
parentName: "li"
|
||
}, `将命名空间拖放到 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `System`), ` 项目。`)), /*#__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", {
|
||
parentName: "li"
|
||
}, `选择命名空间右侧的 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `⋮`), `,点击 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `Move`), `,然后从 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `Target Project`), ` 下拉列表中选择 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `System`), `:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", {
|
||
parentName: "li"
|
||
}, ` `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("img", {
|
||
alt: "移至新项目",
|
||
src: (__webpack_require__(81643)/* ["default"] */ .Z),
|
||
width: "484",
|
||
height: "347"
|
||
})))))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("h3", {
|
||
"id": "将-rancher-monitoring-配置为仅监视-helm-chart-创建的资源"
|
||
}, `将 rancher-monitoring 配置为仅监视 Helm Chart 创建的资源`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `每个项目监控堆栈都会监视其他命名空间并收集其他自定义工作负载指标或仪表板。因此,我们建议在所有选择器上配置以下设置,以确保 Cluster Prometheus 堆栈仅监控由 Helm Chart 创建的资源:`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("pre", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("code", {
|
||
parentName: "pre"
|
||
}, `matchLabels:
|
||
release: "rancher-monitoring"
|
||
`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `建议为以下选择器字段赋予此值:`), /*#__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"
|
||
}, `.Values.alertmanager.alertmanagerSpec.alertmanagerConfigSelector`)), /*#__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"
|
||
}, `.Values.prometheus.prometheusSpec.serviceMonitorSelector`)), /*#__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"
|
||
}, `.Values.prometheus.prometheusSpec.podMonitorSelector`)), /*#__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"
|
||
}, `.Values.prometheus.prometheusSpec.ruleSelector`)), /*#__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"
|
||
}, `.Values.prometheus.prometheusSpec.probeSelector`))), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `启用此设置后,你始终可以通过向它们添加 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `release: "rancher-monitoring"`), ` 标签来创建由 Cluster Prometheus 抓取的 ServiceMonitor 或 PodMonitor。在这种情况下,即使这些 ServiceMonitor 或 PodMonitor 所在的命名空间不是 System 命名空间,项目监控堆栈也会默认自动忽略它们。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("admonition", {
|
||
"type": "note"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", {
|
||
parentName: "admonition"
|
||
}, `如果你不希望用户能够在 Project 命名空间中创建聚合到 Cluster Prometheus 中的 ServiceMonitor 和 PodMonitor,你可以另外将 Chart 上的 namespaceSelectors 设置为仅目标 System 命名空间(必须包含 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `cattle-monitoring-system`), ` 和 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `cattle-dashboards`), `,默认情况下资源通过 rancher-monitoring 部署到该命名空间中。你还需要监控 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `default`), ` 命名空间以获取 apiserver 指标,或创建自定义 ServiceMonitor 以抓取位于 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `default`), ` 命名空间中的 Service 的 apiserver 指标),从而限制你的 Cluster Prometheus 获取其他 Prometheus Operator CR。在这种情况下,建议设置 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `.Values.prometheus.prometheusSpec.ignoreNamespaceSelectors=true`), `。这样,你可以定义能从 System 命名空间中监视非 System 命名空间的 ServiceMonitor。`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("h3", {
|
||
"id": "提高-cluster-prometheus-的-cpu内存限制"
|
||
}, `提高 Cluster Prometheus 的 CPU/内存限制`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", null, `根据集群的设置,我们一般建议为 Cluster Prometheus 配置大量的专用内存,以避免因内存不足的错误(OOMKilled)而重启。通常情况下,集群中创建的改动项(churn)会导致大量高基数指标在一个时间块内生成并被 Prometheus 引入,然后导致这些错误。这也是为什么默认的 Rancher Monitoring 堆栈希望能分配到大约 4GB 的 RAM 以在正常大小的集群中运行的原因之一。但是,如果你引入向同一个 Cluster Prometheus 发送 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `/federate`), ` 请求的项目监控堆栈,并且项目监控堆栈依赖于 Cluster Prometheus 的启动状态来在其命名空间上联合系统数据,那么你更加需要为 Cluster Prometheus 分配足够的 CPU/内存,以防止集群中的所有 Prometheus 项目出现数据间隙的中断。`), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("admonition", {
|
||
"type": "note"
|
||
}, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("p", {
|
||
parentName: "admonition"
|
||
}, `我们没有 Cluster Prometheus 内存配置的具体建议,因为这完全取决于用户的设置(即遇到高改动率的可能性以及可能同时生成的指标的规模)。不同的设置通常有不同的推荐参数。`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("h2", {
|
||
"id": "安装-prometheus-federator-应用程序"
|
||
}, `安装 Prometheus Federator 应用程序`), /*#__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"
|
||
}, `转到要安装 Prometheus Federator 的集群,然后单击 `, /*#__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"
|
||
}, `应用 > Charts`), `。`), /*#__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"
|
||
}, `Prometheus Federator`), ` Chart。`), /*#__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)("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"
|
||
}, `项目 Release 命名空间项目 ID`), ` 字段中,`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "li"
|
||
}, `System 项目`), `是默认值,但你可以使用具有类似`, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("a", {
|
||
parentName: "li",
|
||
"href": "#%E7%A1%AE%E4%BF%9D-cattle-monitoring-system-%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4%E4%BD%8D%E4%BA%8E-system-%E9%A1%B9%E7%9B%AE%E4%B8%AD%E6%88%96%E8%80%85%E4%BD%8D%E4%BA%8E%E4%B8%80%E4%B8%AA%E9%94%81%E5%AE%9A%E5%B9%B6%E8%83%BD%E8%AE%BF%E9%97%AE%E9%9B%86%E7%BE%A4%E4%B8%AD%E5%85%B6%E4%BB%96%E9%A1%B9%E7%9B%AE%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD"
|
||
}, `有限访问权限`), `的另一个项目覆盖它。你可以在 local 上游集群中运行以下命令来找到项目 ID:`)), /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("pre", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("code", {
|
||
parentName: "pre",
|
||
"className": "language-plain"
|
||
}, `kubectl get projects -A -o custom-columns="NAMESPACE":.metadata.namespace,"ID":.metadata.name,"NAME":.spec.displayName
|
||
`)), /*#__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)("p", null, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("strong", {
|
||
parentName: "p"
|
||
}, `结果`), `:Prometheus Federator 应用程序已部署在 `, /*#__PURE__*/ (0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .mdx */ .kt)("inlineCode", {
|
||
parentName: "p"
|
||
}, `cattle-monitoring-system`), ` 命名空间中。`));
|
||
}
|
||
MDXContent.isMDXComponent = true;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ 56814:
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
|
||
/* harmony export */ });
|
||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__webpack_require__.p + "assets/images/cattle-monitoring-system-8e4a3ee096b3865e2d8878fd7f7f1eab.png");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 96912:
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
|
||
/* harmony export */ });
|
||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__webpack_require__.p + "assets/images/install-in-system-project-835e5a71298c8874a2011604b5d28618.png");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 81643:
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
|
||
/* harmony export */ });
|
||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__webpack_require__.p + "assets/images/move-to-new-project-c7bc87d42c5189c2cccb2e25960da44e.png");
|
||
|
||
/***/ })
|
||
|
||
}]); |