Files
rancher-docs/zh/v2.7/reference-guides/prometheus-federator.html

30 lines
40 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="zh" dir="ltr" class="docs-wrapper docs-doc-page docs-version-2.7 plugin-docs plugin-id-default docs-doc-id-reference-guides/prometheus-federator/prometheus-federator" data-has-hydrated="false">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.4.3">
<title data-rh="true">Prometheus Federator | Rancher</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://ranchermanager.docs.rancher.com/zh/v2.7/reference-guides/prometheus-federator"><meta data-rh="true" name="docusaurus_locale" content="zh"><meta data-rh="true" name="docsearch:language" content="zh"><meta data-rh="true" name="docusaurus_version" content="2.7"><meta data-rh="true" name="docusaurus_tag" content="docs-default-2.7"><meta data-rh="true" name="docsearch:version" content="2.7"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-2.7"><meta data-rh="true" property="og:title" content="Prometheus Federator | Rancher"><meta data-rh="true" name="description" content="Prometheus Federator(也称为 Project Monitoring V2)基于 rancher/helm-project-operator 部署一个 Helm Project Operator。该 Operator 管理 Helm Chart 的部署,每个 Operator 都包含一个 Project Monitoring Stack,而每个堆栈都包含:"><meta data-rh="true" property="og:description" content="Prometheus Federator(也称为 Project Monitoring V2)基于 rancher/helm-project-operator 部署一个 Helm Project Operator。该 Operator 管理 Helm Chart 的部署,每个 Operator 都包含一个 Project Monitoring Stack,而每个堆栈都包含:"><link data-rh="true" rel="icon" href="/zh/img/favicon.png"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/v2.7/reference-guides/prometheus-federator" hreflang="en"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/zh/v2.7/reference-guides/prometheus-federator" hreflang="zh"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/v2.7/reference-guides/prometheus-federator" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://30NEY6C9UY-dsn.algolia.net" crossorigin="anonymous"><link data-rh="true" rel="canonical" href="https://ranchermanager.docs.rancher.com/zh/reference-guides/prometheus-federator"><link rel="preconnect" href="https://www.googletagmanager.com">
<script>window.dataLayer=window.dataLayer||[]</script>
<script>!function(e,t,a,n,g){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var m=t.getElementsByTagName(a)[0],r=t.createElement(a);r.async=!0,r.src="https://www.googletagmanager.com/gtm.js?id=GTM-57KS2MW",m.parentNode.insertBefore(r,m)}(window,document,"script","dataLayer")</script>
<link rel="search" type="application/opensearchdescription+xml" title="Rancher" href="/zh/opensearch.xml">
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" charset="UTF-8" data-domain-script="0f98beb0-fc4c-417d-a42e-564e2cae42d2" async></script>
<script src="/scripts/optanonwrapper.js" async></script><link rel="stylesheet" href="/zh/assets/css/styles.29ec6351.css">
<link rel="preload" href="/zh/assets/js/runtime~main.7955d3d3.js" as="script">
<link rel="preload" href="/zh/assets/js/main.129d8862.js" as="script">
</head>
<body class="navigation-with-keyboard">
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-57KS2MW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div role="region" aria-label="跳到主要内容"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">跳到主要内容</a></div><nav aria-label="主导航" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="切换导航栏" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/zh/"><div class="navbar__logo"><img src="/zh/img/rancher-logo-horiz-color.svg" alt="logo" class="themedImage_ToTc themedImage--light_HNdA"><img src="/zh/img/rancher-logo-horiz-color.svg" alt="logo" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate"></b></a><div class="navbar__item dropdown dropdown--hoverable"><a aria-current="page" class="navbar__link active" aria-haspopup="true" aria-expanded="false" role="button" href="/zh/v2.7">v2.7</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/zh/reference-guides/prometheus-federator">Latest</a></li><li><a class="dropdown__link" href="/zh/v2.9/reference-guides/prometheus-federator">v2.9 (Preview)</a></li><li><a class="dropdown__link" href="/zh/v2.8/reference-guides/prometheus-federator">v2.8</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/zh/v2.7/reference-guides/prometheus-federator">v2.7</a></li><li><a class="dropdown__link" href="/zh/v2.6/reference-guides/prometheus-federator">v2.6</a></li><li><a class="dropdown__link" href="/zh/v2.5">v2.5</a></li><li><a class="dropdown__link" href="/zh/v2.0-v2.4">v2.0-v2.4</a></li><li><a class="dropdown__link" href="/zh/versions">All versions</a></li></ul></div><div class="navbar__item dropdown dropdown--hoverable"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link"><svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" class="iconLanguage_nlXk"><path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>简体中文</a><ul class="dropdown__menu"><li><a href="/v2.7/reference-guides/prometheus-federator" target="_self" rel="noopener noreferrer" class="dropdown__link" lang="en">English</a></li><li><a href="/zh/v2.7/reference-guides/prometheus-federator" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active" lang="zh">简体中文</a></li></ul></div><div class="searchBox_ZlJk"><button type="button" class="DocSearch DocSearch-Button" aria-label="搜索"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">搜索</span></span><span class="DocSearch-Button-Keys"></span></button></div></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">Quick Links</a><ul class="dropdown__menu"><li><a href="https://github.com/rancher/rancher" target="_blank" rel="noopener noreferrer" class="dropdown__link">GitHub<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://github.com/rancher/rancher-docs" target="_blank" rel="noopener noreferrer" class="dropdown__link">Docs GitHub<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">More from SUSE</a><ul class="dropdown__menu"><li><a href="https://www.rancher.com" target="_blank" rel="noopener noreferrer" class="dropdown__link navbar__icon navbar__rancher">Rancher<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><hr style="margin: 0.3rem 0;"></li><li><a href="https://elemental.docs.rancher.com/" target="_blank" rel="noopener noreferrer" class="dropdown__link navbar__icon navbar__elemental">Elemental<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://fleet.rancher.io/" target="_blank" rel="noopener noreferrer" class="dropdown__link navbar__icon navbar__fleet">Fleet<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://harvesterhci.io" target="_blank" rel="noopener noreferrer" class="dropdown__link navbar__icon navbar__harvester">Harvester<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://rancherdesktop.io/" target="_blank" rel="noopener noreferrer" class="dropdown__link navbar__icon navbar__rancher__desktop">Rancher Desktop<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><hr style="margin: 0.3rem 0;"></li><li><a href="https://opensource.suse.com" target="_blank" rel="noopener noreferrer" class="dropdown__link navbar__icon navbar__suse">More Projects...<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="回到顶部" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="文档侧边栏" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/zh/v2.7">什么是 Rancher?</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh/v2.7/getting-started/overview">开始使用</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh/v2.7/how-to-guides/new-user-guides/new-user-guides">操作指南</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/zh/v2.7/reference-guides/best-practices">参考指南</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/best-practices">最佳实践</a><button aria-label="打开/收起侧边栏菜单「最佳实践」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/rancher-manager-architecture">Rancher 架构</a><button aria-label="打开/收起侧边栏菜单「Rancher 架构」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/cluster-configuration">集群配置</a><button aria-label="打开/收起侧边栏菜单「集群配置」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/single-node-rancher-in-docker">Docker 中的单节点 Rancher</a><button aria-label="打开/收起侧边栏菜单「Docker 中的单节点 Rancher」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/backup-restore-configuration">备份和恢复配置</a><button aria-label="打开/收起侧边栏菜单「备份和恢复配置」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh/v2.7/reference-guides/kubernetes-concepts">Kubernetes 概念</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/monitoring-v2-configuration">Monitoring 配置</a><button aria-label="打开/收起侧边栏菜单「Monitoring 配置」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" tabindex="0" href="/zh/v2.7/reference-guides/prometheus-federator">Prometheus Federator</a><button aria-label="打开/收起侧边栏菜单「Prometheus Federator」" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/zh/v2.7/reference-guides/prometheus-federator/rbac">RBAC</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/user-settings">用户设置</a><button aria-label="打开/收起侧边栏菜单「用户设置」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/cli-with-rancher">Rancher CLI</a><button aria-label="打开/收起侧边栏菜单「Rancher CLI」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/about-the-api">关于 API</a><button aria-label="打开/收起侧边栏菜单「关于 API」" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh/v2.7/reference-guides/rancher-cluster-tools">集群工具:Logging,Monitoring 和可视化</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh/v2.7/reference-guides/rancher-project-tools">项目工具:Logging,Monitoring 和可视化</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh/v2.7/reference-guides/system-tools">系统工具</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh/v2.7/reference-guides/rke1-template-example-yaml">RKE1 示例 YAML</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh/v2.7/reference-guides/rancher-webhook">Rancher Webhook</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/zh/v2.7/reference-guides/rancher-security">Rancher 安全指南</a><button aria-label="打开/收起侧边栏菜单「Rancher 安全指南」" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh/v2.7/integrations-in-rancher/cloud-marketplace">Rancher 中的集成</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh/v2.7/faq/general-faq">常见问题</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh/v2.7/troubleshooting/general-troubleshooting">故障排除</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/zh/v2.7/contribute-to-rancher">参与 Rancher 社区贡献</a></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="页面路径"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="主页面" class="breadcrumbs__link" href="/zh/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">参考指南</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Prometheus Federator</span><meta itemprop="position" content="2"></li></ul></nav><span class="theme-doc-version-badge badge badge--secondary">版本:v2.7</span><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">本页总览</button></div><div class="theme-doc-markdown markdown"><header><h1>Prometheus Federator</h1></header><p>Prometheus Federator(也称为 Project Monitoring V2)基于 <a href="https://github.com/rancher/helm-project-operator" target="_blank" rel="noopener noreferrer">rancher/helm-project-operator</a> 部署一个 Helm Project Operator。该 Operator 管理 Helm Chart 的部署,每个 Operator 都包含一个 Project Monitoring Stack,而每个堆栈都包含:</p><ul><li><a href="https://prometheus.io/" target="_blank" rel="noopener noreferrer">Prometheus</a>(由 <a href="https://github.com/prometheus-operator/prometheus-operator" target="_blank" rel="noopener noreferrer">Prometheus Operator</a> 在外部管理)</li><li><a href="https://prometheus.io/docs/alerting/latest/alertmanager/" target="_blank" rel="noopener noreferrer">Alertmanager</a>(由 <a href="https://github.com/prometheus-operator/prometheus-operator" target="_blank" rel="noopener noreferrer">Prometheus Operator</a> 在外部管理)</li><li><a href="https://github.com/helm/charts/tree/master/stable/grafana" target="_blank" rel="noopener noreferrer">Grafana</a>(通过嵌入式 Helm Chart 部署)</li><li>基于 <a href="https://github.com/prometheus-operator/kube-prometheus/" target="_blank" rel="noopener noreferrer">kube-prometheus</a> 社区策划资源集合的默认 PrometheusRules 和 Grafana 仪表板</li><li>监视已部署资源的默认 ServiceMonitor</li></ul><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>重要提示:</div><div class="admonitionContent_S0QG"><p>Prometheus Federator 适合在已安装 Prometheus Operator CRD 的集群中与现有的 Prometheus Operator Deployment 一起部署。</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="operator-工作原理">Operator 工作原理<a href="#operator-工作原理" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接">​</a></h2><ol><li>在部署此 Chart 时,用户可以创建 ProjectHelmCharts CR,并在<strong>项目 Registration 命名空间 (<code>cattle-project-&lt;id&gt;</code>)</strong> 中将 <code>spec.helmApiVersion</code> 设置为 <code>monitoring.cattle.io/v1alpha1</code>(在 Rancher UI 中也称为“项目监控”)。</li><li>在看到每个 ProjectHelmChartCR 时,Operator 会代表项目所有者在<strong>项目 Release 命名空间 (<code>cattle-project-&lt;id&gt;-monitoring</code>)</strong> 中自动部署一个 Project Prometheus 堆栈(基于 ProjectHelmChart 控制器在 <strong>Operator / System Namespace</strong> 中创建的 HelmChart CR 和 HelmRelease CR)。</li><li>RBAC 将自动分配到项目 Release 命名空间中,从而允许用户查看 Prometheus、Alertmanager 以及已部署的 Project Monitoring Stack 的 Grafana UI(基于在项目 Registration 命名空间上针对<a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles" target="_blank" rel="noopener noreferrer">面向用户的默认 Kubernetes 角色</a>定义的 RBAC)。有关详细信息,请参阅<a href="/zh/v2.7/reference-guides/prometheus-federator/rbac">配置 RBAC</a>。</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="什么是项目">什么是项目?<a href="#什么是项目" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接">​</a></h3><p>在 Prometheus Federator 中,项目是一组可以由 <code>metav1.LabelSelector</code> 标识的命名空间。默认情况下,用于标识项目的标签是 <code>field.cattle.io/projectId</code>,该标签用于标识给定 Rancher 项目中包含的命名空间。</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="配置由-projecthelmchart-创建的-helm-版本">配置由 ProjectHelmChart 创建的 Helm 版本<a href="#配置由-projecthelmchart-创建的-helm-版本" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接">​</a></h3><p>此 ProjectHelmChart 资源的 <code>spec.values</code> 对应于为底层 Helm Chart 配置的 <code>values.yaml</code> 覆盖,该 Helm Chart 是 Operator 代表用户部署的。要查看底层 Chart 的 <code>values.yaml</code> 规范,你可以选择以下其中一种方式:</p><ul><li>查看位于 <a href="https://github.com/rancher/prometheus-federator/blob/main/charts/rancher-project-monitoring" target="_blank" rel="noopener noreferrer"><code>charts/rancher-project-monitoring</code> 中的 <code>rancher/prometheus-federator</code></a> 的 Chart 定义(Chart 版本会绑定到 Operator 版本)。</li><li>查找在每个项目 Registration 命名空间中自动创建的名为 <code>monitoring.cattle.io.v1alpha1</code> 的 ConfigMap,其中包含用于配置 Chart(直接嵌入到 <code>prometheus-federator</code> 二进制文件中)的<code>values.yaml</code> 和 <code>questions.yaml</code>。</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="命名空间">命名空间<a href="#命名空间" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接">​</a></h3><p>Prometheus Federator 是基于 <a href="https://github.com/rancher/helm-project-operator" target="_blank" rel="noopener noreferrer">rancher/helm-project-operator</a> 的 Project Operator,Prometheus Federator 提供了三类命名空间供 Operator 查找:</p><ol><li><p><strong>Operator / System 命名空间</strong>:部署 Operator 的命名空间(例如 <code>cattle-monitoring-system</code>)。此命名空间将包含该 Operator 监视的所有 ProjectHelmChart 的所有 HelmChart 和 HelmRelease。<strong>只有集群管理员才能访问此命名空间</strong>。</p></li><li><p><strong>项目 Registration 命名空间 (<code>cattle-project-&lt;id&gt;</code>)</strong>:Operator 在这些命名空间中监视 ProjectHelmChart。对于在项目发布命名空​​间中创建的自动分配的 RBAC,应用于此命名空间的 RoleBinding 和 ClusterRoleBinding 也会作为 RBAC 的真实来源。有关详细信息,请参阅 <a href="/zh/v2.7/reference-guides/prometheus-federator/rbac">RBAC 页面</a>。<strong>项目所有者(admin)、项目成员(edit)和只读成员(view)应该有权访问此命名空间。</strong></p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>注意事项:</div><div class="admonitionContent_S0QG"><ul><li><p>如果提供了 <code>.Values.global.cattle.projectLabel</code>(默认设置为 <code>field.cattle.io/projectId</code>),则 Operator 会自动生成项目注册命名空间,并将它导入到命名空间绑定的项目中。换言之,如果观察到至少一个带有该标签的命名空间,则 Operator 会创建一个项目 Registration 命名空间。除非出现以下两种情况,否则 Operator 不会让这些命名空间被删除。第一种情况是带有该标签的所有命名空间都消失了(例如,这是该项目中的最后一个命名空间,在这种情况下,命名空间将标有标签 <code>&quot;helm.cattle.io/helm-project-operator-orphaned&quot;: &quot;true&quot;</code>,表示可以删除)。第二种情况是由于项目 ID 是在 <code>.Values.helmProjectOperator.otherSystemProjectLabelValues</code> 下提供的(用作项目的拒绝名单),导致 Operator 不再监视该项目。这些命名空间不会被自动删除,这样能避免破坏用户数据。如果需要,建议用户在创建或删除项目时手动清理这些命名空间。</p></li><li><p>如果未提供 <code>.Values.global.cattle.projectLabel</code>,则 Operator / System 命名空间也是项目注册命名空间。</p></li></ul></div></div></li><li><p><strong>项目发布命名空​​间(<code>cattle-project-&lt;id&gt;-monitoring</code>)</strong>:Operator 代表 ProjectHelmChart 在其中部署项目监控堆栈的命名空间集。Operator 还将根据在项目 Registration 命名空间中找到的绑定,自动为项目监控堆栈在此命名空间中创建的角色分配 RBAC。<strong>只有集群管理员才能访问这个命名空间。部署的 Helm Chart 和 Prometheus Federator 将为项目所有者(admin)、项目成员(edit)和只读成员(view)分配该命名空间的有限访问权限。</strong></p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>注意事项:</div><div class="admonitionContent_S0QG"><ul><li><p>项目发布命名空间会自动部署并导入到 ID 在 <code>.Values.helmProjectOperator.projectReleaseNamespaces.labelValue</code> 下指定的项目中,如果未指定,且项目注册命名空间中指定了 ProjectHelmChart,则默认为 <code>.Values.global.cattle.systemProjectId</code> 的值。</p></li><li><p>项目发布命名空​​间的孤立约定与项目注册命名空间的相同(参见上面的注释)。</p></li><li><p>如果 <code>.Values.projectReleaseNamespaces.enabled</code> 为 false,则项目发布命名空​​间与项目注册命名空间是相同的。</p></li></ul></div></div></li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="helm-资源helmcharthelmrelease">Helm 资源(HelmChart、HelmRelease)<a href="#helm-资源helmcharthelmrelease" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接">​</a></h3><p>在部署 ProjectHelmChart 时,Prometheus Federator 将自动创建和管理两个子自定义资源,它们依次管理以下底层 Helm 资源:</p><ul><li>HelmChart CR(通过 Operator 中的嵌入式 <a href="https://github.com/k3s-io/helm-controller" target="_blank" rel="noopener noreferrer">k3s-io​​/helm-contoller</a> 管理):此自定义资源会根据应用到 HelmChart CR 的变更,在触发 <code>helm install</code>、<code>helm upgrade</code> 或 <code>helm uninstall</code> 的同一命名空间中自动创建一个 Job。此 CR 会根据 ProjectHelmChart 的更改(例如,修改 <code>values.yaml</code>)或底层项目定义的更改(例如,从项目中添加或删除命名空间)自动更新。</li></ul><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>重要提示:</div><div class="admonitionContent_S0QG"><p>如果 ProjectHelmChart 没有部署或更新底层项目监控堆栈,你可以先使用此资源在 Operator / System 命名空间中创建的 Job 来检查 Helm 操作是否有问题。通常只能由<strong>集群管理员访问</strong>。</p></div></div><ul><li>HelmRelease CR(通过 Operator 中的嵌入式 <a href="https://github.com/rancher/helm-locker" target="_blank" rel="noopener noreferrer">rancher/helm-locker</a> 管理):此自定义资源会自动锁定已部署的 Helm 版本并自动覆盖对底层资源的更新,除非更改是 Helm 操作导致的(<code>helm install</code>、<code>helm upgrade</code> 或 <code>helm uninstall</code> 由 HelmChart CR 执行)。</li></ul><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>备注</div><div class="admonitionContent_S0QG"><p>HelmRelease CR 会发出 Kubernetes 事件,用于检测底层 Helm 版本修改并将其锁定回原位。要查看这些事件,你可以使用 <code>kubectl describe helmrelease &lt;helm-release-name&gt; -n &lt;operator/system-namespace&gt;</code>。你还可以查看此 Operator 的日志,了解检测到更改的时间以及哪些资源被尝试更改。</p></div></div><p>这两种资源都是为 Operator / System 命名空间中的所有 Helm Chart 创建的,用于避免低权限用户的权限升级。</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="高级-helm-project-operator-配置">高级 Helm Project Operator 配置<a href="#高级-helm-project-operator-配置" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接">​</a></h3><p>有关高级配置的更多信息,请参阅<a href="https://github.com/rancher/prometheus-federator/blob/main/charts/prometheus-federator/0.0.1/README.md#advanced-helm-project-operator-configuration" target="_blank" rel="noopener noreferrer">此页面</a>。</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="local-集群上的-prometheus-federator">Local 集群上的 Prometheus Federator<a href="#local-集群上的-prometheus-federator" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接">​</a></h3><p>Prometheus Federator 是一个资源密集型应用程序。你可以将其安装到 Local 集群(<strong>不推荐</strong>)。</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/rancher/rancher-docs/edit/main/versioned_docs/version-2.7/reference-guides/prometheus-federator/prometheus-federator.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>编辑此页</a></div><div class="col lastUpdated_vwxv"><span class="theme-last-updated">最后<!-- -->于 <b><time datetime="2024-04-24T03:44:32.000Z">2024年4月24日</time></b> <!-- -->更新</span></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="文档分页导航"><a class="pagination-nav__link pagination-nav__link--prev" href="/zh/v2.7/reference-guides/monitoring-v2-configuration/examples"><div class="pagination-nav__sublabel">上一页</div><div class="pagination-nav__label">示例</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/zh/v2.7/reference-guides/prometheus-federator/rbac"><div class="pagination-nav__sublabel">下一页</div><div class="pagination-nav__label">RBAC</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#operator-工作原理" class="table-of-contents__link toc-highlight">Operator 工作原理</a><ul><li><a href="#什么是项目" class="table-of-contents__link toc-highlight">什么是项目?</a></li><li><a href="#配置由-projecthelmchart-创建的-helm-版本" class="table-of-contents__link toc-highlight">配置由 ProjectHelmChart 创建的 Helm 版本</a></li><li><a href="#命名空间" class="table-of-contents__link toc-highlight">命名空间</a></li><li><a href="#helm-资源helmcharthelmrelease" class="table-of-contents__link toc-highlight">Helm 资源(HelmChart、HelmRelease)</a></li><li><a href="#高级-helm-project-operator-配置" class="table-of-contents__link toc-highlight">高级 Helm Project Operator 配置</a></li><li><a href="#local-集群上的-prometheus-federator" class="table-of-contents__link toc-highlight">Local 集群上的 Prometheus Federator</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 SUSE Rancher. All Rights Reserved.</div></div></div></footer></div>
<script src="/zh/assets/js/runtime~main.7955d3d3.js"></script>
<script src="/zh/assets/js/main.129d8862.js"></script>
</body>
</html>