Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[type:feat]namespace doc #1035

Merged
merged 5 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/user-guide/admin-usage/namepsace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Namespace Management

## 1. Background and Explanation

Currently, when managing gateways for different business line needs, multiple sets of ShenYu Admin and ShenYu Gateway are often deployed simultaneously. To ensure data independence, each gateway usually connects to only one ShenYu Admin. However, this architecture increases user and operational costs. To provide a more convenient user experience, ShenYu Admin introduces namespaces for data isolation, allowing management of gateway data across different business lines with just one set of ShenYu Admin and ShenYu Bootstrap services.

Note: To facilitate usage, a default namespace already exists in the system; please do not manually delete the default namespace records in the database.

## 2.Usage Process

### 1.Create a New Namespace

Users log into the ShenYu Admin backend and select 【Basic Config - Namespace】.

<img src="/img/shenyu/basicConfig/namepsace/namespace-manager-en.png" width="80%" height="50%" />

In the namespace management module, click Add Data to create a new namespace. Simply fill in the 【Name】 and 【Description】 fields; the system will automatically generate a namespaceId.

<img src="/img/shenyu/basicConfig/namepsace/namespace-add-en.png" width="80%" height="50%" />

After successful creation, a unique namespaceId will be automatically generated.

<img src="/img/shenyu/basicConfig/namepsace/namespace-Id-en.png" width="80%" height="50%" />

### 2.Configure Namespace for Downstream Services (shenyu-client)

Once you have the namespaceId, you can configure it in the downstream services (already integrated with shenyu-client) in the configuration file to use one or more namespaceIds.

<img src="/img/shenyu/basicConfig/namepsace/namespace-shenyu-client.png" width="80%" height="50%" />

### 3.Manage Data the Namespace

Once data from Shenyu-client is registered under the specified namespace in Shenyu-admin, the backend management supports isolated gateway data. Users can switch between different namespaces for operations via the button in the upper right corner.

<img src="/img/shenyu/basicConfig/namepsace/namespace-divide-en.png" width="80%" height="50%" />

### 4.Configure Namespace for Gateway (bootstrap)

Note: A gateway can only bind to a single unique namespaceId

<img src="/img/shenyu/basicConfig/namepsace/namespace-bootstrap.png" width="80%" height="50%" />

## 3.Important Changes

#### 1. The concept of Plugins in the old version has changed to Plugin Templates. The current Plugin model is now under the namespace, while in the database, Plugin Templates correspond to the plugin table, and Plugins correspond to the namespace_plugin_rel table.

#### 2. The Apidoc module has been decoupled from selectors, Rules, etc.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 命名空间(namespace)管理

## 1. 背景与说明

目前在管理不同业务线需求的网关时,常常需要同时部署多套 ShenYu Admin 和 ShenYu Gateway。为了确保数据独立性,通常每个网关只能连接一 个 ShenYu Admin。但是,这样的架构会增加用户使用成本和运维成本。 为了提供更便捷的使用体验,ShenYu Admin 引入了命名空间来实现数据隔离,用 于管理不同业务线的网关数据。企业或个人用户只需配置一套ShenYu Admin 和 ShenYu Bootstrap 服务,然后通过命名空间来管理不同业务线的网关数据。

特别说明:为了方便大家的使用,系统中已经存在默认的命名空间,请不要在数据库中手动删除默认命名空间的记录;

## 2.使用流程

### 1.创建新命名空间

用户登录shenyu-admin后台,选择【基础配置-命名空间管理】

<img src="/img/shenyu/basicConfig/namepsace/namespace-manager.png" width="80%" height="50%" />

命名空间管理模块下点击添加数据即可新增命名空间,只需填写【名字】和【描述】系统会自动生成namespaceId

<img src="/img/shenyu/basicConfig/namepsace/namespace-add.png" width="80%" height="50%" />

创建成功后会自动生成唯一namespaceId

<img src="/img/shenyu/basicConfig/namepsace/namespace-Id.png" width="80%" height="50%" />

### 2.下游服务配置命名空间(shenyu-client)

得到namespaceId以后,我们可以在下游服务(已经引入shenyu-client),配置文件中配置单个或多个namespaceId

<img src="/img/shenyu/basicConfig/namepsace/namespace-shenyu-client.png" width="80%" height="50%" />

### 3.管理命名空间下的数据

在Shenyu-client的数据注册到Shenyu-admin指定的命名空间下后。在后台管理端中,支持命名空间隔离的网关数据,用户可以通过右上角按钮切换到不同命名空间下进行操作

<img src="/img/shenyu/basicConfig/namepsace/namespace-divide.png" width="80%" height="50%" />

### 4.网关配置命名空间(bootstrap)

注意:一个网关只能绑定唯一namespaceId

<img src="/img/shenyu/basicConfig/namepsace/namespace-bootstrap.png" width="80%" height="50%" />

## 3.重要改动说明

#### 1.旧版本的【插件】的概念已经变成【插件模板】概念,现在的【插件】模型已经是命名空间下的插件,而在数据库中【插件模板】对应plugin表,【插件】对应namespace_plugin_rel 表

#### 2.Apidoc模块已经与selector、Rule等解绑

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading