Skip to content

Commit 2c076de

Browse files
authored
RHINENG-23334 updated docs for Cost Management plugin (#2255)
* RHINENG-23334 updated docs for Cost Management plugin * chore: updated README.md
1 parent e2ae776 commit 2c076de

3 files changed

Lines changed: 162 additions & 45 deletions

File tree

workspaces/redhat-resource-optimization/README.md

Lines changed: 59 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
# Welcome to the Resource Optimization plugin workspace
1+
# Welcome to the Cost Management plugin workspace
22

3-
## Resource Optimization
3+
## Cost Management
44

5-
Welcome to the Resource Optimization plugin!
5+
Welcome to the Cost Management plugin!
66

7-
Resource Optimization plugin allows users to visualize usage trends and receive optimization recommendations for workloads running on OpenShift clusters.
8-
There is also an option to automatically apply recommendations. Refer to [Optimizer App](#optimizer-app) section
7+
The Cost Management plugin consists of two main parts:
8+
9+
### 1. OpenShift
10+
11+
The OpenShift section displays cost tracking for OpenShift clusters with flexible grouping options. Users can view costs grouped by cluster, project, node, or tag, monitor month-over-month cost changes, and filter data to analyze spending patterns and identify cost trends.
12+
13+
### 2. Optimizations
14+
15+
The Optimizations section allows users to visualize usage trends and receive optimization recommendations for workloads running on OpenShift clusters. There is also an option to automatically apply recommendations. Refer to [Optimizer App](#optimizer-app) section for more details.
916

1017
## Getting started
1118

1219
### Prerequisite
1320

14-
The plugin consumes services from [Red Hat Hybrid Cloud Console](https://console.redhat.com/openshift/cost-management/optimizations), therefore your clusters [must be configured to receive optimization recommendations](https://docs.redhat.com/en/documentation/cost_management_service/1-latest/html-single/getting_started_with_resource_optimization_for_openshift/index).
21+
The plugin consumes services from [Red Hat Hybrid Cloud Console](https://console.redhat.com/openshift/cost-management) for both OpenShift and Optimizations sections, therefore your clusters [must be configured to access cost management data and optimization recommendations](https://docs.redhat.com/en/documentation/cost_management_service/1-latest/html/integrating_openshift_container_platform_data_into_cost_management/index).
22+
23+
**Learn more:**
24+
25+
- [OpenShift cost tracking and analysis](https://docs.redhat.com/en/documentation/cost_management_service/1-latest/html/analyzing_your_cost_data/index)
26+
- [Resource optimization for OpenShift](https://docs.redhat.com/en/documentation/cost_management_service/1-latest/html-single/getting_started_with_resource_optimization_for_openshift/index)
1527

1628
#### Service Account Details
1729

@@ -22,22 +34,22 @@ You will need to two service accounts from Red Hat Hybrid Cloud Console.
2234
- [please go through this guide](https://docs.redhat.com/en/documentation/cost_management_service/1-latest/html/limiting_access_to_cost_management_resources/assembly-limiting-access-cost-resources-rbac) and assign below roles to your `service accounts`
2335

2436
1. Service account with `Cloud Administrator` role for configuring `Cost Management Metrics Operator`
25-
2. Service account with `Cost OpenShift Viewer` role for viewing the optimization data in the RHDH Resource Optimization plugin
37+
2. Service account with `Cost OpenShift Viewer` role for viewing both OpenShift cost data and optimization recommendations in the Cost Management plugin
2638

2739
## Setup
2840

29-
You can follow one of these options for installing `Resource Optimization` depending on your environment.
41+
You can follow one of these options for installing `Cost Management` plugin depending on your environment.
3042

3143
### Option 1: Dynamic plugin - on a Red Hat Developer Hub(RHDH) instance
3244

3345
[Follow this link](./docs/dynamic-plugin.md) for installing plugin as Dynamic Plugin
3446

3547
#### Dependency on Orchestrator plugin and Workflow details
3648

37-
The Resource Optimization plugin is dependent on [Orchestrator plugin](https://www.rhdhorchestrator.io/main/docs/) to run the workflow for applying the recommendation. Make sure you have installed the [Orchestrator plugin](https://www.rhdhorchestrator.io/main/docs/) by following one of these options depending on your environment:
49+
The Cost Management plugin's Optimizations section is dependent on [Orchestrator plugin](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/html/orchestrator_in_red_hat_developer_hub/index) to run the workflow for applying the recommendation. Make sure you have installed the [Orchestrator plugin](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/html/orchestrator_in_red_hat_developer_hub/index) by following one of these options depending on your environment:
3850

39-
- [Install Orchestrator plugin on an exisiting RHDH instance](https://www.rhdhorchestrator.io/main/docs/installation/installation-on-existing-rhdh/)
40-
- [Install Orchestrator plugin with an RHDH instance](https://www.rhdhorchestrator.io/main/docs/installation/orchestrator/)
51+
- [Installing Red Hat Developer Hub with Orchestrator by using the Red Hat Developer Hub Operator](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/html/orchestrator_in_red_hat_developer_hub/assembly-install-rhdh-orchestrator-operator)
52+
- [Installing Red Hat Developer Hub with Orchestrator by using the Red Hat Developer Hub Helm chart](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/html/orchestrator_in_red_hat_developer_hub/assembly-install-rhdh-orchestrator-helm)
4153

4254
This method requires vanilla backstage to be used:
4355

@@ -87,22 +99,36 @@ This method requires vanilla backstage to be used:
8799

88100
1. Add the `ResourceOptimizationPage` extension to your `App.tsx` routes
89101

90-
```ts
102+
Add the import and a single route. The plugin handles its own sub-routes:
103+
104+
- `/redhat-resource-optimization` — Optimizations list
105+
- `/redhat-resource-optimization/ocp` — OpenShift cost management
106+
- `/redhat-resource-optimization/:id` — Optimization breakdown
107+
108+
```tsx
91109
// packages/app/src/App.tsx
92110
93111
import { ResourceOptimizationPage } from '@red-hat-developer-hub/plugin-redhat-resource-optimization';
94112
95-
<FlatRoutes>
96-
...
97-
<Route
98-
path="/redhat-resource-optimization"
99-
element={<ResourceOptimizationPage />}
100-
/>
101-
...
102-
</FlatRoutes>;
113+
const routes = (
114+
<FlatRoutes>
115+
{/* ... other routes ... */}
116+
<Route
117+
path="/redhat-resource-optimization"
118+
element={<ResourceOptimizationPage />}
119+
/>
120+
{/* ... */}
121+
</FlatRoutes>
122+
);
123+
```
124+
103125
```
104126

105-
1. Add a link to the Resource Optimization page in the side bar
127+
```
128+
129+
1. Add a link to the Cost Management page in the side bar
130+
131+
The plugin provides a single sidebar item that gives access to the Cost Management plugin. The plugin internally handles navigation between the OpenShift and Optimizations sections through tabs within the plugin interface.
106132
107133
```diff
108134
// packages/app/src/components/Root/Root.tsx
@@ -131,7 +157,7 @@ This method requires vanilla backstage to be used:
131157
+ <SidebarItem
132158
+ icon={ResourceOptimizationIconOutlined}
133159
+ to="/redhat-resource-optimization"
134-
+ text="Optimizations"
160+
+ text="Cost Management"
135161
+ />
136162
</SidebarGroup>
137163
<SidebarSpace />
@@ -149,13 +175,23 @@ This method requires vanilla backstage to be used:
149175
);
150176
```
151177

178+
Once added to the sidebar, users can navigate between sections using the plugin's internal navigation tabs.
179+
152180
## RBAC Permissions
153181

154182
The HTTP endpoints exposed by the redhat-resource-optimization-backend can enforce authorization if the [RBAC plugin](https://github.com/backstage/community-plugins/tree/main/workspaces/rbac/plugins) is deployed. Please refer the RBAC plugin documentation for the setup steps (mind they rely on the [Backstage authentication and identity](https://backstage.io/docs/auth/)).
155183

156-
- More detailed info about Resource Optimization plugin RBAC permissions can be found in [docs/rbac.md](./docs/rbac.md)
184+
- More detailed info about Cost Management plugin RBAC permissions can be found in [docs/rbac.md](./docs/rbac.md)
157185
- More detailed info about Orcestrator plugin RBAC for setting up permission for workflow can be [found here](https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/orchestrator/docs/Permissions.md).
158186

159187
## Optimizer App
160188

161189
An application for applying the recommendations automatically. The application makes use of OSL (OpenShift Serverless Logic, a.k.a. SonataFlow) which is part of the Orchestrator installation. If you already have the [Orchestrator plugin and the workflow](#dependency-on-orchestrator-plugin-and-workflow-details) installed then you are ready for installing the Optimizer application. Follow the [application instructions](https://github.com/rhdhorchestrator/optimizer/tree/main) for installing and configuring it.
190+
191+
## References
192+
193+
- [Installing ROS-OCP RHDH plugin on Red Hat Developer Hub on a Openshift Cluster](https://docs.google.com/document/d/1tExe7cEBYMJplkk9ppSdBINwE-14KmxURczGjloHqZ4/edit?usp=sharing)
194+
195+
- [Documentation to understand how to export, package & publish plugin as a dynamic plugin](https://github.com/redhat-developer/rhdh/blob/main/docs/dynamic-plugins/packaging-dynamic-plugins.md#packaging-and-publishing-backstage-plugin-as-a-dynamic-plugin)
196+
197+
- For comprehensive RHDH documentation, visit: [Red Hat Developer Hub 1.8 Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/)

workspaces/redhat-resource-optimization/docs/dynamic-plugin.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ Red Hat Developer Hub (RHDH) leverages dynamic plugins to efficiently deploy plu
55

66
The procedure involves the following steps:
77

8-
1. Ensure you are familiar with the [RHDH configuration docs](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.6/html/configuring_red_hat_developer_hub/index) and [RHDH plugin installation guide](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.6/html/installing_and_viewing_plugins_in_red_hat_developer_hub/index)
8+
1. Ensure you are familiar with the [Red Hat Developer Hub 1.8 configuration docs](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/html/configuring_red_hat_developer_hub/index) and [Red Hat Developer Hub 1.8 plugin installation guide](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/html/installing_and_viewing_plugins_in_red_hat_developer_hub/index)
99

10-
2. The plugin consumes services from [Red Hat Hybrid Cloud Console](https://console.redhat.com/openshift/cost-management/optimizations), therefore your clusters [must be configured to receive optimization recommendations](https://docs.redhat.com/en/documentation/cost_management_service/1-latest/html-single/getting_started_with_resource_optimization_for_openshift/index).
10+
**Additional Resources:**
11+
12+
- For comprehensive RHDH documentation, visit: [Red Hat Developer Hub 1.8 Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.8/)
13+
14+
2. The plugin consumes services from [Red Hat Hybrid Cloud Console](https://console.redhat.com/openshift/cost-management) for both OpenShift and Optimizations sections, therefore your clusters [must be configured to access cost management data and optimization recommendations](https://docs.redhat.com/en/documentation/cost_management_service/1-latest/html/integrating_openshift_container_platform_data_into_cost_management/index).
1115
Copy and save the `CLIENT_ID` & `CLIENT_SECRET` from service account you created earlier with `Cost OpenShift Viewer` role. This will be needed during configuration step below.
1216

1317
3. Specially, make sure you have configured
@@ -58,9 +62,3 @@ The procedure involves the following steps:
5862
clientSecret: ${ROS_CLIENT_SECRET}
5963
optimizationWorkflowId: 'patch-k8s-resource'
6064
```
61-
62-
### References
63-
64-
- [Installing ROS-OCP RHDH plugin on Red Hat Developer Hub on a Openshift Cluster](https://docs.google.com/document/d/1tExe7cEBYMJplkk9ppSdBINwE-14KmxURczGjloHqZ4/edit?usp=sharing)
65-
66-
- [Documentation to understand how to export, package & publish plugin as a dynamic plugin](https://github.com/redhat-developer/rhdh/blob/main/docs/dynamic-plugins/packaging-dynamic-plugins.md#packaging-and-publishing-backstage-plugin-as-a-dynamic-plugin)

0 commit comments

Comments
 (0)