Establish Relationships
This behavior was introduced in Hydrolix version 6.2.
A cluster running Hydrolix v6.2 and v6.3 builds new relationships in the parallel Customer hierarchy created in an earlier transition stage.
In a future release, all services in the cluster begin to depend on the parallel hierarchy and the relationships built by these background jobs.
This page describes the automation, audit, and manual assignment tooling.
- Use Audit recommendations and Audit endpoints to examine customer assignments.
- Use instructions in Manually assign to adjust assignments between projects, users, storages, or credentials and customers.
- Reset the shared/dedicated tunable, if necessary for a multi-tenant cluster while running v6.2 or v6.3.
- Understand Rules for linking of objects used by the background jobs.
Relationship audit⚓︎
Every cluster is configured differently and contains different tenants. While the background jobs construct the necessary relationships, each cluster may have special cases, such as a tenant with multiple projects or an account with access to multiple customer's projects.
An audit identifies where the linking rules and background jobs haven't constructed all of the desired relationships from customers to users, credentials, and storage locations.
Only an administrator with familiarity with the tenants and configuration can determine if the future Orgs for the cluster are correctly modeled. The Customer objects are the future Orgs for this cluster. See also Organizations.
Audit recommendations⚓︎
Hydrolix recommends administrators perform the following audit while a cluster is running v6.3 and before upgrading to v6.4:
- Audit user and service account permissions and scopes for accuracy and intent. Do users have correct permissions? The background jobs update customer assignments based on account permissions.
- Ensure every project has an assigned customer. See Find orphaned projects. Orphaned projects are ignored in a future release, meaning that services won't work.
- Ensure projects are assigned correctly if a customer holds multiple projects. See Assign project to customer.
- Review user and service accounts. Are all accounts assigned to the correct customer? Are there old accounts which should be deleted? See Find unassigned objects.
- Review storage and credentials. Are the assignments correct? Are there vestigial objects that should be deleted? See Find unassigned objects.
- If certain accounts should have access to multiple tenants (customers), are they also assigned to those customers? See Find objects assigned to multiple customers.
- Are there storage or credential objects used across multiple customers? Is that expected? See Find objects assigned to multiple customers.
Audit endpoints⚓︎
Use auditing filters on endpoints to examine the relationships of objects with the new Customer hierarchy.
One filter is available for projects
customer_id_is_none=Truereturns projects lacking a customer; correct before upgrading beyond v6.3
Two filters are available on users and service accounts, credentials, storages:
unassigned=Truereturns objects lacking a customer; correct missing assignments before upgrading beyond v6.3assigned_multiple=Truereturns objects assigned to more than one customer
Find orphaned projects⚓︎
Use v1 /config/v1/orgs/:org_id/projects/?customer_id_is_none=True.
- Replace the example with the original cluster Org UUID.
Unassigned users won't work in a future release. Delete the user account or assign it to the correct customer.
Find unassigned objects⚓︎
Use v1 /config/v1/users/?unassigned=True.
Unassigned users won't work in a future release. Delete the user account or assign it to the correct customer.
Use v1 /config/v1/service_accounts/?unassigned=True.
Unassigned service accounts won't work in a future release. Delete the user account or assign it to the correct customer.
Use v2 /config/v2/credentials/?unassigned=True.
Unassigned credentials won't work in a future release. Delete the credential or assign it to the correct customer.
Use v2 /config/v2/storages/?unassigned=True.
Unassigned storages won't work in a future release. Delete the storages or assign it to the correct customer.
Find objects assigned to multiple customers⚓︎
Use v1 /config/v1/users/?assigned_multiple=True.
User accounts with more than one Customer assignment might have super_admin role or have a reason to see or manage resources for all mentioned customers.
Use v1 /config/v1/service_accounts/?assigned_multiple=True.
Service accounts with more than one Customer assignment can see or manage resources for all mentioned customers.
Use v2 /config/v2/credentials/?assigned_multiple=True.
Credentials with more than one Customer assignment are used in a storage, table source, or job for different customers.
Use v2 /config/v2/storage/?assigned_multiple=True.
Storages with more than one Customer assignment are available to different customers.
Primary storage will be assigned to multiple if used outside the hydro project
The required hdx_primary storage is always assigned to the system Customer containing the hydro project.
It may be present in the output, if tables in other projects use the primary storage. This is not a problem.
Manual assignment⚓︎
Administrators can use Config API endpoints to specify manual assignment. These are explicit and take precedence over derived assignments.
Assign projects⚓︎
With the Customer UUID, use the v1 Patch project endpoint to change the Customer associated with a project.
A project must be assigned to a customer to remain active in a future release. There's no way to remove a project's customer assignment. Instead, remove the project.
- Replace the original Org UUID and desired Project UUID.
- Replace the example with the correct Customer UUID in your cluster.
In a future release
- Customer reassignment capability will be removed, preventing changes to a project's customer.
- Projects lacking a customer are ignored. No services in the cluster will consider the project.
Correct assignment is important preparation for a future release, when the customer hierarchy is adopted for running services.
Assign users⚓︎
With the Customer and User UUIDs, use the v1 endpoints to change assignments
Add a user or service account to a customer endpoint to create a new association.
- Replace the example with the Customer UUID.
- Replace the example with the User UUID. Assigning multiple Users to the same Customer is valid in a single call.
| Expected Output | |
|---|---|
Remove user or service account from Customer endpoint to remove an existing association.
- Replace the example with the Customer UUID.
- Replace the example with the User UUID. Removing multiple Users from the same Customer is valid in a single call.
| Expected Output | |
|---|---|
Assign storages⚓︎
With the Customer and Storage UUIDs, use the v1 endpoints to change assignments
Add storages to Customer endpoint to create a new association.
- Replace the example with the Customer UUID.
- Replace the example with the Storage UUID. Assigning multiple Storages to the same Customer is valid in a single call.
| Expected Output | |
|---|---|
Remove storages from Customer endpoint to remove an existing association.
- Replace the example with the Customer UUID.
- Replace the example with the Storage UUID. Removing multiple Storages from the same Customer is valid in a single call.
| Expected Output | |
|---|---|
Assign credentials⚓︎
With the Customer and Credential UUIDs, use the v1 endpoints to change assignments
Add credentials to Customer endpoint to create a new association.
- Replace the example with the Customer UUID.
- Replace the example with the Credential UUID. Assigning multiple Credentials to the same Customer is valid in a single call.
| Expected Output | |
|---|---|
Remove credentials from Customer endpoint to remove an existing association.
- Replace the example with the Customer UUID.
- Replace the example with the Credential UUID. Removing multiple Credentials from the same Customer is valid in a single call.
| Expected Output | |
|---|---|
Upgrade and downgrade notes⚓︎
Downgrading from v6.2 to an earlier release removes relationships. Earlier releases don't support relationships to customer objects.
Reset with different tunable⚓︎
Reconfigure while the cluster runs, without a downgrade.
Manual tunable reset instructions⚓︎
Use these instructions to change the turbine_api_feature_migrate_projects_to_orgs tunable while v6.2 or v6.3 is running without downgrading.
Switch tunable to create multiple customers⚓︎
Use these instructions if you want many Customer objects and you forgot to set tunable turbine_api_feature_migrate_projects_to_orgs to true.
- Confirm that you are running v6.2 or v6.3.
- Find the default customer ID.
- Delete the customer object using DELETE
/config/v1/customers/{id}. - Set tunable
turbine_api_feature_migrate_projects_to_orgstotrue. - Wait for
init-turbine-apijob to finish. - Connect to the Kubernetes cluster using
k9sand select the namespace holding the Hydrolix cluster. - Select the
turbine-apipod andturbine-apicontainer. - Invoke a shell by pressing s.
-
Execute this command, which will produce STDERR to terminal. It must exit cleanly.
Create Customers From Projects -
Wait for customers to be created. This may take minutes on a large cluster.
-
Execute this command, which will produce STDERR to terminal. It must exit cleanly.
Re-run the v6.2 Release Task -
Exit the
k9sutility by pressing Ctrl+c.
Object ownership and usage⚓︎
Storage and credential objects can be used by multiple customers. These objects are assigned to multiple customers.
Only one Customer can own a storage or credential object.
This configuration is common, for single- and multi-tenant clusters.
Projects assigned to two different customers could use the same object storage and credentials, particularly in multi-tenant clusters. See also Find objects assigned to multiple customers
Rules for linking⚓︎
These rules describe how the background jobs determine assignment.
Use explicit manual assignment to assign additional relationships.
Users and service accounts⚓︎
The background job
- links user and service accounts to the Customers holding projects and tables to which the account has permissions.
- sets the
default_customerif the account has only a single Customer relationship. - links every account to the Customer which owns the project named
sample_project. - skips human-initiated invitations and manual customer assignments. These contain explicit intent and are never modified.
- prevents any account from assignment to the system Customer, which owns the
hydroproject.
The background job re-evaluates these rules on every permissions or role change and modifies relationships accordingly.
This allows administrators to make role and scope changes and review the changes using the audit endpoints in an iterative loop.
Storage and credentials⚓︎
The background job
- links the
hdx_primarystorage and its corresponding global credential to the Customer which owns thehydroproject - links each storage object to each Customer whose tables depend on the storage location
- links each credential object to each Customer whose storage, table, or table source requires the credential
- sets
owned_by_customerfor each storage and credential, if there's only a single Customer relationship.
Background job behavior⚓︎
While Hydrolix v6.2 and v6.3 run, background jobs continuously construct relationships between invite, storage, and credential objects and the Customer containing each project. They also set defaults to prepare each Customer for future promotion to an Org object.
These continuously-running API worker jobs perform the work:
create_storage_relation_to_customers- link Customers to storage objects for their projectscreate_credential_relation_to_customers- link Customers to credentials for their projectscreate_invite_relation_to_customers- link Customers to their invited userssync_user_relation_to_customers- link Customers to users with permissions to their projectsassign_storage_owners- for storage objects with only one Customer, mark it as owned by that Customerassign_credential_owners- for credential objects with only one Customer, mark it as owned by that Customersync_user_default_customers- select a default customer for each Usercreate_default_customer_projects- Customer management job started in v6.1 continues to run on single-tenant clusters (tunablefalse)create_customers_from_projects- Customer management job started in v6.1 continues to run on multi-tenant clusters (tunabletrue)