mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-11-11 03:01:20 +00:00
75 files changed
+641
-519
No files matched your search
-4
@@ -188,7 +188,3 @@ openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout myservice.ke
|
||||
|
||||
* 检查你的 Keycloak 日志。
|
||||
* 如果日志显示 `request validation failed: org.keycloak.common.VerificationException: SigAlg was null`,请在 Keycloak 客户端中将 `Client Signature Required` 设为 `OFF`。
|
||||
|
||||
## Configuring SAML Single Logout (SLO)
|
||||
|
||||
<ConfigureSLO />
|
||||
-4
@@ -105,7 +105,3 @@ OpenLDAP ServiceAccount 用于所有搜索。无论用户个人的 SAML 权限
|
||||
1. 在**用户和组搜索**下,选中**配置 OpenLDAP Server**。
|
||||
|
||||
如果你在测试与 OpenLDAP Server 的连接时遇到问题,请确保你输入了ServiceAccount 的凭证并正确配置了搜索库。你可以检查 Rancher 日志来查明根本原因。调试日志可能包含有关错误的更详细信息。请参阅[如何启用调试日志](../../../../faq/technical-items.md#如何启用调试日志记录)了解更多信息。
|
||||
|
||||
## Configuring SAML Single Logout (SLO)
|
||||
|
||||
<ConfigureSLO />
|
||||
-4
@@ -60,7 +60,3 @@ title: 配置 PingIdentity (SAML)
|
||||
- 用户组下拉列表仅显示你所属的用户组。如果你不是某个组的成员,你将无法添加该组。
|
||||
|
||||
:::
|
||||
|
||||
## Configuring SAML Single Logout (SLO)
|
||||
|
||||
<ConfigureSLO />
|
||||
-4
@@ -51,7 +51,3 @@ title: 2. 在 Rancher 中配置 Microsoft AD FS
|
||||
```
|
||||
openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com"
|
||||
```
|
||||
|
||||
## Configuring SAML Single Logout (SLO)
|
||||
|
||||
<ConfigureSLO />
|
||||
-4
@@ -76,10 +76,6 @@ SAML 协议不支持用户或用户组的搜索或查找。因此,如果你没
|
||||
|
||||
要在 Rancher 中分配权限时启用搜索组,你需要为 SAML 身份认证服务配置支持组的后端(例如 OpenLDAP)。
|
||||
|
||||
### Configuring SAML Single Logout (SLO)
|
||||
|
||||
<ConfigureSLO />
|
||||
|
||||
# 在 Rancher 中设置 OpenLDAP
|
||||
|
||||
如果你将 OpenLDAP 配置为 Shibboleth 的后端,SAML 断言会返回到 Rancher,其中包括用于引用组的用户属性。然后,通过认证的用户将能够访问其所在的组有权访问的 Rancher 资源。
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ PSS 定义了工作负载的安全级别。PSA 描述了 Pod 安全上下文和
|
||||
|
||||
## 升级到 Pod 安全标准 (PSS)
|
||||
|
||||
确保将所有 PSP 都迁移到了另一个工作负载安全机制,包括将你当前的 PSP 映射到 Pod 安全标准,以便使用 [PSA 控制器](https://kubernetes.io/docs/concepts/security/pod-security-admission/)执行。如果 PSA 控制器不能满足企业的所有需求,建议你使用策略引擎,例如 [Kubewarden](https://www.kubewarden.io/)、[Kyverno](https://kyverno.io/) 或 [NeuVector](https://neuvector.com/)。有关如何迁移 PSP 的更多信息,请参阅你选择的策略引擎的文档。
|
||||
确保将所有 PSP 都迁移到了另一个工作负载安全机制,包括将你当前的 PSP 映射到 Pod 安全标准,以便使用 [PSA 控制器](https://kubernetes.io/docs/concepts/security/pod-security-admission/)执行。如果 PSA 控制器不能满足企业的所有需求,建议你使用策略引擎,例如 [OPA Gatekeeper](https://github.com/open-policy-agent/gatekeeper)、[Kubewarden](https://www.kubewarden.io/)、[Kyverno](https://kyverno.io/) 或 [NeuVector](https://neuvector.com/)。有关如何迁移 PSP 的更多信息,请参阅你选择的策略引擎的文档。
|
||||
|
||||
:::caution
|
||||
必须在删除 PodSecurityPolicy 对象_之前_添加新的策略执行机制。否则,你可能会为集群内的特权升级攻击创造机会。
|
||||
|
||||
-46
@@ -161,56 +161,10 @@ spec:
|
||||
|
||||
:::
|
||||
|
||||
### Add Custom OCI Chart Repositories
|
||||
|
||||
:::caution
|
||||
|
||||
This feature is currently experimental and is not officially supported in Rancher.
|
||||
|
||||
:::
|
||||
|
||||
Helm v3 introduced storing Helm charts as [Open Container Initiative (OCI)](https://opencontainers.org/about/overview/) artifacts in container registries. With Rancher v2.9.0, you can add [OCI-based Helm chart repositories](https://helm.sh/docs/topics/registries/) alongside HTTP-based and Git-based repositories. This means you can deploy apps that are stored as OCI artifacts. For more information, see [Using OCI Helm Chart Repositories](./oci-repositories.md).
|
||||
|
||||
### Helm 兼容性
|
||||
|
||||
仅支持 Helm 3 兼容 Chart 。
|
||||
|
||||
#### Refresh Interval
|
||||
|
||||
Rancher v2.10.0 adds the `refreshInterval` field to the `ClusterRepo` CRD. The default value is 3600 seconds, meaning that Rancher syncs each Helm repository every 3600 seconds.
|
||||
|
||||
To modify the refresh interval of a chart repository:
|
||||
|
||||
1. Click **☰ > Cluster Management**.
|
||||
1. Find the name of the cluster whose repositories you want to access. Click **Explore** at the end of the cluster's row.
|
||||
1. In the left navigation menu on the **Cluster Dashboard**, click **Apps > Repositories**.
|
||||
1. Find the repository you want to modify, and click **⋮ > Edit YAML**.
|
||||
1. Set the **refreshInterval** field under **Spec** to the desired value in seconds.
|
||||
1. Click **Save**.
|
||||
|
||||
### Enable/Disable Helm Chart Repositories
|
||||
|
||||
Rancher v2.10.0 adds the ability to enable and disable Helm repositories. Helm repositories are enabled by default.
|
||||
|
||||
To disable a chart repository:
|
||||
|
||||
1. Click **☰ > Cluster Management**.
|
||||
1. Find the name of the cluster whose repositories you want to access. Click **Explore** at the end of the cluster's row.
|
||||
1. In the left navigation menu on the **Cluster Dashboard**, click **Apps > Repositories**.
|
||||
1. Find the repository you want to disable, and click **⋮ > Edit YAML**.
|
||||
1. Set the **Enabled** field under **Spec** to **false**.
|
||||
1. Click **Save**.
|
||||
1. When you disable a repository, updates are disabled and new changes to the clusterRepo are not applied.
|
||||
|
||||
To enable a chart repository:
|
||||
|
||||
1. Click **☰ > Cluster Management**.
|
||||
1. Find the name of the cluster whose repositories you want to access. Click **Explore** at the end of the cluster's row.
|
||||
1. In the left navigation menu on the **Cluster Dashboard**, click **Apps > Repositories**.
|
||||
1. Find the repository you want to disable, and click **⋮ > Edit YAML**.
|
||||
1. Set the **Enabled** field under **Spec** to **true**.
|
||||
1. Click **Save**.
|
||||
|
||||
### 部署和升级 Chart
|
||||
|
||||
安装和部署 chart:
|
||||
|
||||
+1
@@ -31,5 +31,6 @@ Rancher 包含 Kubernetes 中未包含的各种工具来协助你进行 DevOps
|
||||
- Logging
|
||||
- Monitoring
|
||||
- Istio 服务网格
|
||||
- OPA Gatekeeper
|
||||
|
||||
你可以通过 **Apps** 来安装工具。
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
---
|
||||
title: OPA Gatekeeper
|
||||
---
|
||||
|
||||
为了确保一致性和合规性,每个组织都需要能够以自动化的方式在环境中定义和执行策略。[OPA(Open Policy Agent)](https://www.openpolicyagent.org/) 是一个策略引擎,用于基于策略控制云原生环境。Rancher 支持在 Kubernetes 集群中启用 OPA Gatekeeper,并且还安装了一些内置的策略定义(也称为约束模板)。
|
||||
|
||||
OPA 提供了一种高级声明性语言,可以让你将策略指定为代码,还能扩展简单的 API,从而减轻策略决策的负担。
|
||||
|
||||
[OPA Gatekeeper](https://github.com/open-policy-agent/gatekeeper) 是一个提供 OPA 和 Kubernetes 集成的项目。OPA Gatekeeper 提供:
|
||||
|
||||
- 一个可扩展的参数化策略库。
|
||||
- 用于实例化策略库的原生 Kubernetes CRD,也称为“约束”。
|
||||
- 用于扩展策略库的原生 Kubernetes CRD,也称为“约束模板”。
|
||||
- 审计功能。
|
||||
|
||||
要了解更多关于 OPA 的信息,请参阅[官方文档](https://www.openpolicyagent.org/docs/latest/)。
|
||||
|
||||
## OPA Gatekeeper 集成的工作原理
|
||||
|
||||
Kubernetes 支持通过准入控制器(准入控制器)webhook 来扩展 API Server 的功能,创建、更新或删除资源时都会调用这些 webhook。Gatekeeper 作为验证 webhook 安装,并执行由 Kubernetes CRD(Custom Resource Definition)定义的策略。除了使用准入控制之外,Gatekeeper 还能审计 Kubernetes 集群中的现有资源,并对违反当前策略的情况进行标记。
|
||||
|
||||
OPA Gatekeeper 由 Rancher 的 Helm system Chart 提供,它安装在名为 `gatekeeper-system` 的命名空间中。
|
||||
|
||||
## 在集群中启用 OPA Gatekeeper
|
||||
|
||||
:::note
|
||||
|
||||
Rancher 2.5 改进了 OPA Gatekeeper 应用。无法从 Rancher 2.4 升级到 Rancher 2.5 中的新版本。如果你在 Rancher 2.4 中安装了 OPA Gatekeeper,则需要在旧 UI 中卸载 OPA Gatekeeper 及其 CRD,然后在 Rancher 2.5 中重新安装它。如需卸载 CRD,请在 kubectl 控制台中运行 `kubectl delete crd configs.config.gatekeeper.sh constrainttemplates.templates.gatekeeper.sh` 命令。
|
||||
|
||||
:::
|
||||
|
||||
:::note 先决条件:
|
||||
|
||||
只有管理员和集群所有者才能启用 OPA Gatekeeper。
|
||||
|
||||
:::
|
||||
|
||||
你可以在 **Apps** 页面安装 OPA Gatekeeper Helm Chart。
|
||||
|
||||
### 启用 OPA Gatekeeper
|
||||
|
||||
1. 在左上角,单击 **☰ > 集群管理**。
|
||||
1. 在**集群**页面中,转到要启用 OPA Gatekeeper 的集群,然后单击 **Explore**。
|
||||
1. 在左侧导航栏中,点击 **Apps**。
|
||||
1. 点击 **Charts** 并点击 **OPA Gatekeeper**。
|
||||
1. 单击**安装**。
|
||||
|
||||
**结果**:已将 OPA Gatekeeper 部署到你的 Kubernetes 集群。
|
||||
|
||||
## 约束模板
|
||||
|
||||
[约束模板](https://github.com/open-policy-agent/gatekeeper#constraint-templates)是 Kubernetes 自定义资源,用于定义要由 Gatekeeper 应用的 OPA 策略的架构和 Rego 逻辑。有关 Rego 策略语言的更多信息,请参阅[官方文档](https://www.openpolicyagent.org/docs/latest/policy-language/)。
|
||||
|
||||
启用 OPA Gatekeeper 后,Rancher 默认会安装一些模板。
|
||||
|
||||
要列出集群中安装的约束模板,请转到 OPA Gatekeeper 下的左侧菜单,然后单击**模板**。
|
||||
|
||||
Rancher 还支持通过导入 YAML 定义来创建你自己的约束模板。
|
||||
|
||||
## 创建和配置约束
|
||||
|
||||
[约束](https://github.com/open-policy-agent/gatekeeper#constraints)是 Kubernetes 自定义资源,用于定义要应用约束模板的对象范围。约束模板和约束共同定义一个完整的策略。
|
||||
|
||||
:::note 先决条件:
|
||||
|
||||
集群中已启用 OPA Gatekeeper。
|
||||
|
||||
:::
|
||||
|
||||
要列出已安装的约束,请转到 OPA Gatekeeper 下的左侧菜单,然后单击**约束**。
|
||||
|
||||
可以从约束模板创建新的约束。
|
||||
|
||||
Rancher 支持通过使用方便的表单来创建约束,你可以在该表单中输入各种约束字段。
|
||||
|
||||
**以 YAML 文件编辑**选项也可以用于配置约束的 YAML 定义。
|
||||
|
||||
### 使 Rancher 的 System 命名空间不受约束
|
||||
|
||||
创建约束时,请确保该约束不应用于任何 Rancher 或 Kubernetes System 命名空间。如果不排除 System 命名空间,则可能会出现 system 命名空间下的许多资源被标记为违反约束。
|
||||
|
||||
要让约束仅限制用户命名空间,请在约束的**匹配**字段下指定这些命名空间。
|
||||
|
||||
此外,该约束可能会干扰其他 Rancher 功能并拒绝部署系统工作负载。为避免这种情况,请从你的约束中排除所有 Rancher 特定的命名空间。
|
||||
|
||||
## 在集群中实施约束
|
||||
|
||||
如果**执行动作**为 **Deny**,约束会立即启用,并拒绝任何违反策略的请求。默认情况下,执行的值为 **Deny**。
|
||||
|
||||
如果**执行动作** 为 **Dryrun**,违反策略的资源仅会记录在约束的状态字段中。
|
||||
|
||||
要强制执行约束,请使用表单创建约束。在**执行动作**字段中,选择 **Deny**。
|
||||
|
||||
## 集群中的审计和违规
|
||||
|
||||
OPA Gatekeeper 运行定期审计,以检查现有资源是否违反强制执行的约束。你可以在安装 Gatekeeper 时配置审计间隔(默认 300 秒)。
|
||||
|
||||
Gatekeeper 页面上列出了违反已定义的约束的情况。
|
||||
|
||||
此外,你也可以在**约束**页面中找到违反约束的数量。
|
||||
|
||||
每个约束的详细信息视图列出了违反约束的资源的信息。
|
||||
|
||||
## 禁用 Gatekeeper
|
||||
|
||||
1. 导航到集群的仪表板视图。
|
||||
1. 在左侧菜单中,展开集群菜单并单击 **OPA Gatekeeper**。
|
||||
1. 单击 **⋮ > 禁用**。
|
||||
|
||||
**结果**:禁用 OPA Gatekeeper 后,所有约束模板和约束也将被删除。
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: Best Practices for Disconnected Clusters
|
||||
---
|
||||
|
||||
<head>
|
||||
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/reference-guides/best-practices/disconnected-clusters"/>
|
||||
</head>
|
||||
|
||||
Rancher supports managing clusters that may not always be online due to network disruptions, control plane availability, or because all cluster nodes are down. At the moment there are no known issues with disconnected clusters in the latest released Rancher version.
|
||||
|
||||
While a managed cluster is disconnected from Rancher, management operations will be unavailable, and the Rancher UI will not allow navigation to the cluster. However, once the connection is reestablished, functionality is fully restored.
|
||||
|
||||
### Best Practices for Managing Disconnected Clusters
|
||||
|
||||
- **Cluster Availability During Rancher Upgrades**: It is recommended to have all, or at least most, managed clusters online during a Rancher upgrade. The reason is that upgrading Rancher automatically upgrades the Rancher agent software running on managed clusters. Keeping the agent and Rancher versions aligned ensures consistent functionality. Any clusters that are disconnected during the upgrade will have their agents updated as soon as they reconnect.
|
||||
|
||||
- **Cleaning Up Disconnected Clusters**: Regularly remove clusters that will no longer reconnect to Rancher (e.g., clusters that have been decommissioned or destroyed). Keeping such clusters in the Rancher management system consumes unnecessary resources, which could impact Rancher's performance over time.
|
||||
|
||||
- **Certificate Rotation Considerations**: When designing processes that involve regularly shutting down clusters, whether connected to Rancher or not, take into account certificate rotation policies. For example, RKE/RKE2/K3s clusters may rotate certificates on startup if they exceeded their lifetime.
|
||||
+4
@@ -14,6 +14,10 @@ title: Rancher 管理集群的最佳实践
|
||||
|
||||
配置合理的监控和告警规则对于安全、可靠地运行生产环境中的工作负载至关重要。有关更多建议,请参阅[最佳实践](monitoring-best-practices.md)。
|
||||
|
||||
### Disconnected clusters
|
||||
|
||||
Rancher supports managing clusters that may not always be online due to network disruptions, control plane availability, or because all cluster nodes are down. Refer to this [guide](disconnected-clusters.md) for our recommendations.
|
||||
|
||||
## 设置容器的技巧
|
||||
|
||||
配置良好的容器可以极大地提高环境的整体性能和安全性。有关容器设置的建议,请参见[设置容器的技巧](tips-to-set-up-containers.md)。
|
||||
|
||||
+4
-1
@@ -4,6 +4,7 @@ title: 集群工具:Logging,Monitoring 和可视化
|
||||
|
||||
Rancher 包含 Kubernetes 中未包含的各种工具来协助你进行 DevOps 操作。Rancher 可以与外部服务集成,让你的集群更高效地运行。工具分为以下几类:
|
||||
|
||||
|
||||
## Logging
|
||||
|
||||
Logging 支持:
|
||||
@@ -17,7 +18,6 @@ Logging 支持:
|
||||
Rancher 可以与 Elasticsearch、splunk、kafka、syslog 和 fluentd 集成。
|
||||
|
||||
有关详细信息,请参阅 [Logging 文档](../integrations-in-rancher/logging/logging.md)。
|
||||
|
||||
## 监控和告警
|
||||
|
||||
你可以使用 Rancher,通过业界领先并开源的 [Prometheus](https://prometheus.io/) 来监控集群节点、Kubernetes 组件和软件部署的状态和进程。
|
||||
@@ -37,6 +37,9 @@ Rancher 可以与 Elasticsearch、splunk、kafka、syslog 和 fluentd 集成。
|
||||
Rancher v2.5 改进了与 Istio 的集成。
|
||||
|
||||
如需更多信息,请参阅 [Istio 文档](..//integrations-in-rancher/istio/istio.md)。
|
||||
## OPA Gatekeeper
|
||||
|
||||
[OPA Gatekeeper](https://github.com/open-policy-agent/gatekeeper) 是一个开源项目,它对 OPA 和 Kubernetes 进行了集成,以通过许可控制器 Webhook 提供策略控制。有关如何在 Rancher 中启用 Gatekeeper 的详细信息,请参阅 [OPA Gatekeeper](../integrations-in-rancher/opa-gatekeeper.md)。
|
||||
|
||||
## CIS 扫描
|
||||
|
||||
|
||||
Reference in new issue
Block a user