Managing Resources
As your adoption of Ctrlplane grows, you may find yourself managing hundreds or even thousands of resources. This scale of operation requires efficient tools and strategies to maintain visibility, control, and agility. Ctrlplane offers several features to help you manage large numbers of resources effectively.
Resource Groups
Resource Groups are a powerful feature that allow you to organize and manage your resources based on their metadata. This grouping mechanism makes it easy to categorize and find similar resources, providing a more efficient way to manage your infrastructure at scale.
How Resource Groups Work
Resource Groups use the metadata assigned to your resources to automatically group them together. Each unique combination of metadata can form a distinct group, allowing for flexible and dynamic categorization.
Creating Resource Groups
Resource Groups are created automatically based on the metadata you assign to your resources. To effectively use Resource Groups:
- Plan your metadata strategy to reflect meaningful categories for your infrastructure.
- Consistently apply metadata to your resources as you add them to your system.
- Use the Resource Groups view in the dashboard to see how your resources are organized.
Use Cases for Resource Groups
Resource Groups can be incredibly versatile. Here are some common use cases:
-
Region-based Grouping: Group resources by geographical region or data center location.
- Example metadata:
region: us-west
,region: eu-central
- Example metadata:
-
Infrastructure Size: Categorize resources by their resource allocation or capacity.
- Example metadata:
size: small
,size: medium
,size: large
- Example metadata:
-
Kubernetes Version: Group resources running different versions of Kubernetes.
- Example metadata:
kubernetes/version: 1.22
,kubernetes/version: 1.23
- Example metadata:
-
Customer Segmentation: For multi-tenant systems, group resources by customer or business size.
- Example metadata:
customer: acme-corp
,business-size: enterprise
- Example metadata:
-
Service Type: Group resources by the primary service they run.
- Example metadata:
service: web-server
,service: database
,service: cache
- Example metadata:
Benefits of Using Resource Groups
- Improved Organization: Easily manage large numbers of resources by grouping them logically.
- Efficient Operations: Quickly identify and work with specific subsets of your infrastructure.
- Consistent Management: Apply policies, updates, or actions to entire groups of similar resources.
- Enhanced Visibility: Gain better insights into your infrastructure composition and distribution.
Best Practices for Resource Groups
- Consistent Metadata: Develop and adhere to a consistent metadata strategy across your organization.
- Meaningful Metadata: Choose metadata keys that provide valuable information and aid in practical grouping.
- Avoid Over-Complexity: While metadata is powerful, too many keys can lead to overly complex groupings. Aim for a balance.
- Regular Review: Periodically review and update your metadata strategy as your infrastructure evolves.
By effectively using Resource Groups, you can significantly improve your ability to manage, monitor, and maintain your infrastructure, especially as it grows in size and complexity.
Resource Views
Resource Views are a powerful feature that allow you to create, save, and reuse filters for your resources. These views provide a convenient way to organize and manage large sets of resources, making it easier to focus on specific subsets of your infrastructure.
Creating a Resource View
To create a Resource View:
- Navigate to the Resources section in your dashboard.
- Apply the desired filters to your resources.
- Click on the “Save View” button.
- Give your view a name and description.
Using Resource Views
Once created, Resource Views can be accessed from the Resources page. You can:
- Quickly switch between different views to focus on specific resource subsets.
- Use views as a starting point for further filtering or actions.
- Share views with team members to ensure consistent resource selection across your organization.
Example Use Cases
- Environment-based Views: Create views for different environments (e.g., Production, Staging, Development).
- Region-based Views: Organize resources by geographical regions or data centers.
- Service-based Views: Group resources by the services they run.
- Status-based Views: Filter resources based on their current status or health.
Updating and Managing Views
You can edit or delete existing views as your infrastructure evolves:
- To update a view, apply new filters and save over the existing view.
- To delete a view, select it and use the delete option in the view management interface.
Resource Views are a valuable tool for maintaining organization and efficiency in your resource management workflow, especially as your infrastructure grows in size and complexity.
Locking Resources
Resource locking is a crucial feature that allows you to temporarily prevent any pipelines from running against specific resources. This is particularly useful for maintenance, troubleshooting, or when you need to ensure that a resource remains in a stable state.
How Resource Locking Works
When you lock a resource:
- All scheduled and ongoing pipeline runs against that resource are immediately halted.
- New pipeline runs cannot be initiated for the locked resource.
- The resource remains locked until it is manually unlocked.
When to Use Resource Locking
Consider locking a resource in the following scenarios:
- During critical maintenance periods
- When investigating issues that require a stable environment
- To prevent accidental deployments or changes
- When preparing for major updates or migrations
Locking a Resource
To lock a resource:
- Navigate to the Resources section in your dashboard.
- Find the resource you want to lock.
- Click on the “Lock” button.
- Optionally, provide a reason for locking the resource.
Unlocking a Resource
To unlock a resource:
- Go to the Resources section and find the locked resource.
- Click on the “Unlock” button or toggle.
- Confirm the action to unlock the resource.
Best Practices
- Always provide a reason when locking a resource to inform team members.
- Regularly review locked resources to ensure they are unlocked when no longer needed.
- Use resource locking in conjunction with your change management processes.
Permissions and Auditing
- Typically, locking and unlocking resources requires elevated permissions.
- All lock and unlock actions are logged for auditing purposes.
By using resource locking judiciously, you can maintain better control over your infrastructure and prevent unintended changes during critical periods.