-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENG-2969] Turbonomic Integration & Savings APIs (#1157)
- Loading branch information
1 parent
8331ab7
commit 36ff6bd
Showing
10 changed files
with
280 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
# Turbonomic Actions | ||
|
||
{% swagger method="get" path="turbonomic/resizeWorkloadControllers" baseUrl="http://<kubecost-address>/model/savings/" summary="Turbonomic Actions: Resize Workload Controllers" %} | ||
{% swagger-description %} | ||
The Resize Workload Controllers API returns workloads for which request resizing has been recommended by Turbonomic. The list of results returned should align with those in the Turbonomic Actions Center. | ||
{% endswagger-description %} | ||
|
||
{% swagger-parameter in="path" name="filter" type="string" required="false" %} | ||
Filter your results by cluster, namespace and/or controller. | ||
{% endswagger-parameter %} | ||
|
||
{% swagger-response status="200: OK" description="" %} | ||
```json | ||
{ | ||
"code": 200, | ||
"data": { | ||
"numResults": 1, | ||
"totalSavings": 2.00, | ||
"actions": [ | ||
{ | ||
"action": { | ||
"cluster": "standard-cluster-1", | ||
"namespace": "kubecost", | ||
"controller": "kubecost-cost-analyzer", | ||
"replicaCount": 1, | ||
"compoundActions": { | ||
"cost-model": [ | ||
{ | ||
"target": "VCPURequest", | ||
"unit": "mCores", | ||
"oldValue": 200, | ||
"newValue": 100 | ||
} | ||
] | ||
}, | ||
"available": true, | ||
"targetId": "11111111111111" | ||
}, | ||
"currentMonthlyRate": 4.00, | ||
"predictedMonthlyRate": 2.00, | ||
"predictedSavings": 2.00 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
{% endswagger-response %} | ||
{% endswagger %} | ||
|
||
{% swagger method="get" path="turbonomic/suspendContainerPods" baseUrl="http://<kubecost-address>/model/savings/" summary="Turbonomic Actions: Suspend Container Pods" %} | ||
{% swagger-description %} | ||
The Suspend Container Pods API returns pods that Turbonomic recommends for suspension. The list of results returned should align with those in the Turbonomic Actions Center. | ||
{% endswagger-description %} | ||
|
||
{% swagger-parameter in="path" name="filter" type="string" required="false" %} | ||
Filter your results by cluster, namespace, controller and/or pod. | ||
{% endswagger-parameter %} | ||
|
||
{% swagger-response status="200: OK" description="" %} | ||
```json | ||
{ | ||
"code": 200, | ||
"data": { | ||
"numResults": 1, | ||
"totalSavings": 12.37, | ||
"actions": [ | ||
{ | ||
"action": { | ||
"cluster": "standard-cluster-1", | ||
"namespace": "infra-cost", | ||
"controller": "infra-cost-agent", | ||
"pod": "infra-cost-agent-xdj34", | ||
"available": true, | ||
"targetId": "11111111111111" | ||
}, | ||
"currentMonthlyRate": 12.37, | ||
"predictedMonthlyRate": 0, | ||
"predictedSavings": 12.37 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
{% endswagger-response %} | ||
{% endswagger %} | ||
|
||
{% swagger method="get" path="turbonomic/suspendVirtualMachines" baseUrl="http://<kubecost-address>/model/savings/" summary="Turbonomic Actions: Suspend Virtual Machines" %} | ||
{% swagger-description %} | ||
The Suspend Container Pods API returns virtual machines that Turbonomic recommends for suspension. The list of results returned should align with those in the Turbonomic Actions Center. | ||
{% endswagger-description %} | ||
|
||
{% swagger-parameter in="path" name="filter" type="string" required="false" %} | ||
Filter your results by cluster. | ||
{% endswagger-parameter %} | ||
|
||
{% swagger-response status="200: OK" description="" %} | ||
```json | ||
{ | ||
"code": 200, | ||
"data": { | ||
"numResults": 1, | ||
"totalSavings": 9.03, | ||
"actions": [ | ||
{ | ||
"action": { | ||
"cluster": "standard-cluster-1", | ||
"node": "gke-standard-cluster-1-spotpool-b4a02c44-1001", | ||
"available": true, | ||
"targetId": "11111111111111" | ||
}, | ||
"currentMonthlyRate": 9.03, | ||
"predictedMonthlyRate": 0, | ||
"predictedSavings": 9.03 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
{% endswagger-response %} | ||
{% endswagger %} | ||
|
||
{% swagger method="get" path="turbonomic/moveContainerPods" baseUrl="http://<kubecost-address>/model/savings/" summary="Turbonomic Actions: Move Container Pods" %} | ||
{% swagger-description %} | ||
The Move Container Pods API returns pods that Turbonomic recommends to be moved from one node to another. The list of results returned should align with those in the Turbonomic Actions Center. | ||
{% endswagger-description %} | ||
|
||
{% swagger-parameter in="path" name="filter" type="string" required="false" %} | ||
Filter your results by cluster, namespace, controller and/or pod. | ||
{% endswagger-parameter %} | ||
|
||
{% swagger-response status="200: OK" description="" %} | ||
```json | ||
{ | ||
"code": 200, | ||
"data": { | ||
"numResults": 2, | ||
"totalSavings": 30.0, | ||
"actions": [ | ||
{ | ||
"action": { | ||
"cluster": "standard-cluster-1", | ||
"namespace": "turbo-server", | ||
"controller": "db", | ||
"pod": "db-ffbdfb97b-aroxf", | ||
"originNode": "gke-standard-cluster-1-pool-1-b4a02c44-1001", | ||
"destinationNode": "gke-standard-cluster-1-pool-2-91dc432d-1002", | ||
"available": true, | ||
"targetId": "11111111111111" | ||
}, | ||
"currentMonthlyRate": 27.90, | ||
"predictedMonthlyRate": 0, | ||
"predictedSavings": 27.90 | ||
}, | ||
{ | ||
"action": { | ||
"cluster": "standard-cluster-1", | ||
"namespace": "infra-kubecost", | ||
"controller": "infra-kubecost-cost-analyzer", | ||
"pod": "infra-kubecost-cost-analyzer-566b488b69-1001a", | ||
"originNode": "gke-standard-cluster-1-pool-2-91dc432d-1002", | ||
"destinationNode": "gke-standard-cluster-1-pool-3-57364626-1003", | ||
"available": true, | ||
"targetId": "11111111111112" | ||
}, | ||
"currentMonthlyRate": 2.10, | ||
"predictedMonthlyRate": 0, | ||
"predictedSavings": 2.10 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
{% endswagger-response %} | ||
{% endswagger %} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Kubecost Turbonomic Integration | ||
|
||
{% hint style="info" %} | ||
This integration is currently in beta. Please read the documentation carefully. | ||
{% endhint %} | ||
|
||
The Turbonomic Integration feature enables users to obtain supplemental cost information on actions recommended by Turbonomic. This integration is required to display the [Turbonomic Actions Savings Cards](../using-kubecost/navigating-the-kubecost-ui/savings/turbonomic-actions.md). | ||
|
||
## Usage | ||
|
||
Prerequisites: | ||
|
||
- A running Turbonomic client | ||
|
||
Kubecost will require network access to your Turbonomic installation via an OAuth 2.0 Client. We require the following settings on the OAuth client: | ||
- Role: `ADVISOR` | ||
- ClientAuthenticationMethods: `client_secret_post` | ||
|
||
Please see the [IBM Turbonomic documentation](https://www.ibm.com/docs/en/tarm/8.14.3?topic=cookbook-authenticating-oauth-20-clients-api#cookbook_administration_oauth_authentication__title__4) on more instructions on how to create an OAuth 2.0 client. | ||
|
||
### Step 1: Configure Helm values | ||
|
||
The below YAML is an example of how to configure the Turbonomic integration in your Helm values file. | ||
|
||
```yaml | ||
global: | ||
integrations: | ||
turbonomic: | ||
enabled: true | ||
clientId: "" # REQUIRED. OAuth 2.0 client ID | ||
clientSecret: "" # REQUIRED. OAuth 2.0 client secret | ||
role: "ADVISOR" # REQUIRED. OAuth 2.0 client role | ||
host: "" # REQUIRED. URL to the Turbonomic API (e.g. "https://turbonomic.example.com") | ||
insecureClient: false # Whether to verify certificate or not. Default false. | ||
``` | ||
### Step 2: Apply and validate your changes | ||
If deploying changes via Helm, you will be able to run a command similar to: | ||
```sh | ||
helm upgrade -i kubecost cost-analyzer \ | ||
--repo https://kubecost.github.io/cost-analyzer/ \ | ||
--namespace kubecost \ | ||
-f values.yaml | ||
``` | ||
|
||
Once you've applied your changes, validate that the integration is successful by checking the Aggregator pod logs. You should see logs similar to the following: | ||
|
||
```sh | ||
kubectl logs statefulset/kubecost-aggregator -n kubecost | grep -i "Turbonomic" | ||
``` | ||
|
||
```txt | ||
DBG Turbonomic: Ingestor: completed run with 32 turbonomic actions ingested | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
using-kubecost/navigating-the-kubecost-ui/savings/turbonomic-actions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Turbonomic Actions | ||
|
||
{% hint style="warning" %} | ||
This feature is in beta. Please read the documentation carefully. | ||
{% endhint %} | ||
|
||
The [IBM Turbonomic Action Center](https://www.ibm.com/docs/en/tarm/8.14.3?topic=reference-turbonomic-actions) offers multiple types of actions destined to improve the overall performance of your cluster(s). The integration between Kubecost and Turbonomic allows you to view the estimated savings incurred by executing these actions. | ||
|
||
## Prerequisites | ||
To be able to see the savings cards, you must first enable the [Turbonomic Integration](../../../integrations/turbonomic-integration.md). This is required for Kubecost to be able to pull action data from your Turbonomic client. | ||
|
||
## Actions | ||
![Savings cards: Turbonomic Actions](../../../images/savings-turbo-actions.png) | ||
|
||
### Resize Workload Controllers | ||
![Resize Workload Controllers](../../../images/savings-turbo-actions-rwc.png) | ||
|
||
The Resize Workload Controllers page shows workloads which would benefit from changes to their resource requests, as recommended by Turbonomic. | ||
The Current and Predicted cost columns are calculated using the [Spec Cost Prediction API](../../../apis/governance-apis/spec-cost-prediction-api.md): the Current column is calculated by inferring the CPU and/or memory requests on all Containers in the workload, while the Predicted column is calculated by using the new request values recommended by Turbonomic for each container. Please note that at the moment, this functionality is only available for Deployments and StatefulSets. | ||
|
||
### Suspend Container Pods | ||
![Suspend Container Pods](../../../images/savings-turbo-actions-scp.png) | ||
|
||
The Suspend Container Pods page shows pods that Turbonomic recommends to be suspended. | ||
The Current cost column represents the monthly rate for the Pod in question, queried over a period of `7d offset 48h` to account for reconciliation. | ||
The Predicted cost column is zero for suspension actions. | ||
|
||
### Suspend Virtual Machines | ||
![Suspend Virtual Machines](../../../images/savings-turbo-actions-svm.png) | ||
|
||
The Suspend Virtual Machines page shows virtual machines (nodes) that Turbonomic recommends to be suspended. | ||
The Current cost column represents the monthly rate for the node in question, queried over a period of `7d offset 48h` to account for reconciliation. | ||
The Predicted cost column is zero for suspension actions. | ||
|
||
### Move Container Pods | ||
![Move Container Pods](../../../images/savings-turbo-actions-mcp.png) | ||
|
||
The Move Container Pods page shows pods that Turbonomic recommends to be moved from one node to another. | ||
The Current cost column represents the monthly rate for the destination node, queried over a period of `7d offset 48h` to account for reconciliation. | ||
The Efficiency column contains a hyperlink to the Efficiency page for the destination node, highlighting the infrastructure idle corresponding to it. |