-
Notifications
You must be signed in to change notification settings - Fork 533
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
[Feature][Manager] Support multi-tenancy #7914
Comments
@vernedeng please add a design document to show the detail. |
done |
This was referenced May 22, 2023
This was referenced May 25, 2023
This was referenced Jun 5, 2023
Closed
[INLONG-8163][Manager][DataProxy] Make DataProxy config interface compatible with old versions
#8164
Merged
Closed
This was referenced Jun 13, 2023
This was referenced Jun 20, 2023
This was referenced Jun 27, 2023
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Background
The current Inlong does not support multi-tenancy, and only has a simple permission model to implement data and resource isolation at the manager level. This means that for a single ordinary user, they can only see the resources they created or those where others have added them as the manager. This mode leads to the following problems:
find_in_set(#{currentUser, jdbcType=VARCHAR}, in_charges)
Solutions
In the industry, multi-tenant solutions are typically formulated from two perspectives: isolation levels and tenant hierarchy.
2. Tenant hierarchy:
Different organizations have different requirements for data isolation, making it difficult to find a universally applicable multi-user model to fit all organizations.
Tenants in Kubernetes (k8s):
However, the single-level tenant concept also brings some problems:
Tenant based on Hierarchical Namespaces: To address the problems brought by a single-level Namespace, Kubernetes has introduced the concept of hierarchical namespaces (HN). A HN is a regular Namespace indicating a single, optional parent Namespace.
Hierarchical Namespace ownership can achieve two additional key capabilities based on Namespace ownership:
With these two capabilities, super administrators can create a Root Namespace for a team and the necessary permission policies, then grant the team's members the right to create child Namespaces. This allows team members to create their child Namespaces without violating cluster policies.
Tenants in Pulsar:
Pulsar has considered multi-tenant features since its inception and has continuously improved its implementation in the subsequent process. Multi-tenant features allow different departments to share the same set of data without having to deploy individual systems to operate the data, ensuring data consistency across departments and simplifying maintenance costs.
Pulsar uses a hierarchy of tenant, namespace, and topic to support multi-tenancy:
Tenants in HBase:
How should Inlong be implemented?
From the perspective of isolation levels, Inlong undoubtedly needs to be able to support a fully shared resource mode.
As for tenant hierarchy, it can be seen from the multi-tenant solutions of Kubernetes (k8s) and Pulsar that the introduction of multi-tier multi-tenant solutions is mainly to solve issues like multiple team authorization sets and partial configuration sharing among tenants.
For Inlong:
InlongGroup + InlongStream can already achieve partial resource isolation capability. StreamSource, StreamSink separate through the combination of InlongGroup + InlongStream, whereas, datanode and cluster can only act as shared resources. InlongGroup + InlongStream is equivalent to the sub-space in k8s or the namespace in Pulsar. Therefore, by encapsulating the concept of tenants in the current architecture, the isolation of shared resources between tenants can be achieved, reaching a two-tier tenant effect.
Furthermore, more hierarchical namespace options don't seem to be necessary. Firstly, the single-level multi-tenant model can solve most of the problems; secondly, a multi-level tenant solution would bring significant changes to the current architecture, and potentially make it challenging to smoothly upgrade existing businesses.
User Permissions
Inlong should consider two levels of user permissions.
Inlong developer/operator permissions. This type of permission has the ability to query all resources under all tenants, making it easier for Inlong to operate and troubleshoot issues as a whole.
User permissions under a tenant. For a single tenant, members under the tenant should be given simple permissions such as responsible person and follower, which are used to distinguish between resource creation/deletion and resource viewing.
The original incharges and follower fields are retained, but are no longer the smallest unit for resource operations. Instead, they indicate all owners and responsible persons for the resource under the tenant.
How to adapt to more complex multi-tenant requirements For more complex scenarios with more product hierarchy requirements, multiple levels of tenant products can be flattened into one level and mapped to Inlong. For example, tenant A , first-level product B, second-level product C, mapped to Inlong is a tenant named "A-B-C". Searches for resources under tenant A, Inlong matches the prefix "A" in the tenant field. If searching for resources under tenant A and first-level product B, the prefix matches "A-B". This way, no matter how the upper-level system plans the tenant model, it is reflected as a first-level tenant at the Inlong level.

Advantages:
Inlong's multi-tenant model is not limited by more complex upper-level systems.
The implementation is relatively simple and requires minimal changes to the current architecture.
Disadvantages:
Lack of the ability to share resources between tenants, such as the possibility of a public Hive cluster and a tenant's private Hive cluster, which is difficult to distinguish.
Prefix matching also affects search performance.
3. How to modify?
1. Modifying the tables
2. Frontend modifications
3. OpenApi/Managerclient modifications
4. Manager server-side modification
Task List
Use case
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: