How to structure Spaces
Last updated: June 29, 2024
Spaces in Spacelift provide a powerful way to manage and segregate resources, ensuring efficient organization and access control across your infrastructure. This guide will walk you through the concepts and best practices for structuring your spaces tree.
For the full detailed guide, visit the Structuring Your Spaces Tree Documentation and Spacelift Spaces in Action.
Benefits of Structuring Spaces
Access Control: Spaces enable fine-grained access control, allowing you to delegate admin rights to specific teams without exposing the entire account.
Resource Sharing: You can share resources like worker pools and policies across multiple environments or teams.
Scalability: Structuring spaces helps in managing large-scale environments by logically grouping related resources.
Steps to Structure Your Spaces Tree
Start with the Root Space:
Every Spacelift account starts with a root space, which is the top-level space.
All other spaces are created as children of the root space.
Create Spaces Based on Environments or Teams:
Environment-Based Structure: Create spaces for different environments such as development, staging, and production.
Example:
root ├── dev ├── preprod └── prod
Team-Based Structure: Create spaces for different teams or services.
Example:
root └──shared-resources ├── team-a └── team-b
Enable Inheritance:
Inheritance allows a space to use resources from its parent space.
Enable inheritance for spaces that should share resources with their parent space.
Example: team-a and team-b space can inherit worker pools and policies from the shared-resources space but since they are sibling spaces, they can not use each others resources.
Creating a Space:
Navigate to the Spaces section in Spacelift.
Click on Create space.
Provide a name, select a parent space, and optionally add a description and labels.
Click Create.
For detailed steps, visit the Creating a Space Documentation.
Moving Entities Between Spaces:
You can move stacks, policies, contexts, and other entities between spaces.
Ensure that the entities maintain access to required resources after the move.
Use the entity’s settings to change its space.
For more details, refer to the Moving a Space or Any Entity Documentation.
Managing Access Control:
Define roles (read, write, admin) for users within each space.
Use login policies to assign roles and control access.
For more information, visit the Access Control Documentation.
For more detailed instructions and examples, refer to the Structuring Your Spaces Tree Documentation and Spacelift Spaces in Action.