### Helm Install Command Example for Kubecost Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installupgrade-kubecost-upgrade Demonstrates how to initiate a Helm installation for Kubecost, specifying the release name and namespace. This is a foundational command for deploying or upgrading Kubecost using Helm. ```bash helm install kubecost --namespace kubecost ... ``` -------------------------------- ### Kubecost API Pagination Example (Allocation Query) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=kubecost-api-directory This example demonstrates how to use the 'offset' and 'limit' parameters in an Allocation API query to retrieve paginated results. It shows how to specify the starting point and the number of items per page, along with the 'accumulate' parameter for consolidated lists. ```http GET http:///model/allocation?window=3d&offset=20&limit=10&accumulate=true ``` -------------------------------- ### Helm Install Command for Parallel Kubecost Installation Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installupgrade-kubecost-upgrade Illustrates the Helm command to install a parallel instance of Kubecost, using distinct release names and namespaces to avoid conflicts. This is crucial for validating a new version before fully switching over. ```bash helm install kubecost2 --namespace kubecost2 ... ``` -------------------------------- ### Kubecost API Response Example Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-cluster-right-sizing-recommendation-api This JSON structure represents the successful response from the Kubecost Cluster Right-Sizing Recommendation API. It details the recommended node configurations for both multi-node and single-node setups, potential monthly savings, and a comparison with the current cluster's resource allocation and costs. ```json { "code": 200, "data": { "cluster-one": { "recommendations": { "multi": { "pools": [ { "type": { "provider": "GCP", "name": "f1-micro", "vCPUs": 0.2, "RAMGB": 0.6, "hourlyPrice": 0.0076, "spotHourlyPrice": 0.0035, "sharedCore": true, "architecture": "x86", "region": "us-west1", "pricePerRAMByteHr": 3.946013748645783e-12, "pricePerCPUCoreHr": 0.031611, "spotPricePerRAMByteHr": 8.307397365570068e-13, "spotPricePerCPUCoreHr": 0.006655 }, "count": 3, "totalMonthlyCost": 16.644, "totalRAMGB": 1.7999999999999998, "totalVCPUs": 0.6000000000000001 }, { "type": { "provider": "GCP", "name": "n1-highcpu-2", "vCPUs": 2, "RAMGB": 1.8, "hourlyPrice": 0.049594019999999996, "spotHourlyPrice": 0.014915600000000001, "sharedCore": false, "architecture": "x86", "region": "us-west1", "pricePerRAMByteHr": 2.7622096240520478e-12, "pricePerCPUCoreHr": 0.0221277, "spotPricePerRAMByteHr": 8.307397365570068e-13, "spotPricePerCPUCoreHr": 0.006655 }, "count": 1, "totalMonthlyCost": 36.203634599999994, "totalRAMGB": 1.8, "totalVCPUs": 2 } ], "nodeCount": 4, "monthlySavings": 20.5239354, "totalMonthlyCost": 52.84763459999999, "requiredRAMGB": 2.7075592279434204, "totalRAMGB": 3.5999999999999996, "utilizationRAMGB": 0.752099785539839, "requiredVCPUs": 1.9305600746179477, "totalVCPUs": 2.6, "utilizationVCPUs": 0.7425231056222875 }, "single": { "pools": [ { "type": { "provider": "GCP", "name": "n1-standard-1", "vCPUs": 1, "RAMGB": 3.75, "hourlyPrice": 0.033249825, "spotHourlyPrice": 0.01, "sharedCore": false, "architecture": "x86", "region": "us-west1", "pricePerRAMByteHr": 2.7622096240520478e-12, "pricePerCPUCoreHr": 0.0221277, "spotPricePerRAMByteHr": 8.307397365570068e-13, "spotPricePerCPUCoreHr": 0.006655 }, "count": 3, "totalMonthlyCost": 72.81711675, "totalRAMGB": 11.25, "totalVCPUs": 3 } ], "nodeCount": 3, "monthlySavings": 0.5544532499999946, "totalMonthlyCost": 72.81711675, "requiredRAMGB": 2.2937504053115845, "totalRAMGB": 11.25, "utilizationRAMGB": 0.20388892491658528, "requiredVCPUs": 1.800551426660732, "totalVCPUs": 3, "utilizationVCPUs": 0.6001838088869107 } }, "parameters": { "clusterId": "cluster-one", "clusterName": "", "staticVCPUs": 1.4105254827890852, "staticRAMGB": 1.0523239374160767, "nonDaemonSetPodCount": 20, "daemonSetVCPUs": 0.13000864795721567, "daemonSetRAMGB": 0.41380882263183594, "daemonSetCount": 5, "maxPodVCPUs": 0.26021418473138547, "maxPodRAMGB": 0.13831710815429688 }, "preferences": { "minNodeCount": 3, "strategies": null, "targetUtilization": 0.8, "allowSharedCore": true, "architecture": "" }, "currentClusterInfo": { "monthlyRate": 73.37156999999999, "nodes": [ { "name": "e2-medium", "provider": "GCP", "architecture": "x86", "count": 3, "RAMGB": 4, "vCPUs": 1 } ], "totalCounts": { "totalNodeCount": 3, "totalRAMGB": 12, "totalVCPUs": 3 } } } } } ``` -------------------------------- ### NGINX Ingress Controller Basic Auth Example Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installation-ingress-examples This code snippet provides an example configuration for the NGINX Ingress Controller, specifically demonstrating how to set up basic authentication for accessing Kubecost. ```yaml # Example for NGINX Ingress Controller with basic auth (details not provided in input) ``` -------------------------------- ### Install Plural Console on AWS Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installations-installing-kubecost-plural Installs the Plural Console bundle for AWS. This is done using the same process as installing Kubecost, by specifying the 'console' and 'console-aws' bundles. ```bash plural bundle install console console-aws plural build plural deploy --commit"deploying the console too" ``` -------------------------------- ### Helm Ingress Example with Cert-Manager Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installation-ingress-examples This example demonstrates how to configure Ingress using the Helm ingress template, with cert-manager for TLS certificate management. It automatically sets the correct service name based on the haMode flag. ```yaml ingress: annotations: cert-manager.io/cluster-issuer: letsencrypt-http className: nginx enabled: true hosts: - kubecost.your.com tls: - hosts: - kubecost.your.com # letsencrypt automatically creates the secret, just need to give it a name: secretName: kubecost-tls ``` -------------------------------- ### Kubecost API Response Example (JSON) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=node-group-sizing This is an example JSON response from the Kubecost API, illustrating the structure of data returned for cost allocation and resource utilization. ```json { "code": 200, "data": { "window": { "start": "2025-01-01T00:00:00Z", "end": "2025-01-08T00:00:00Z" }, "labelName": "eks_amazonaws_com_nodegroup", "account": "12345", "timeseries": [ { "window": { "start": "2025-01-01T00:00:00Z", "end": "2025-01-01T01:00:00Z" }, "items": [ { "name": "ng-1", "instanceType": "m5.xlarge", "region": "us-east-1", "start": "2025-01-01T00:00:00Z", "end": "2025-01-01T01:00:00Z", "count": { "avg": 9.97, "max": 10 }, "cpu": { "unit": "m", "capacity": { "avg": 12000 }, "allocation": { "avg": 8000 }, "request": { "avg": 8000 }, "usage": { "max": 10000, "avg": 8000 } }, "ram": { "unit": "Mi", "capacity": { "avg": 12000 }, "allocation": { "avg": 8000 }, "request": { "avg": 8000 }, "usage": { "max": 10000, "avg": 8000 } }, "gpu": { "unit": "gpu", "capacity": { "avg": 1 }, "allocation": { "avg": 0.4 }, "request": { "avg": 0.4 }, "usage": { "max": 1, "avg": 0.4 } } }, ... ] }, ... ] } } ``` -------------------------------- ### Build and Deploy Infrastructure Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installations-installing-kubecost-plural Generates configuration and deploys your infrastructure. This is a two-step process: first build, then deploy with a commit message. ```bash plural build plural deploy --commit"deploying kubecost" ``` -------------------------------- ### Upgrade Kubecost using Helm Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installupgrade-kubecost-upgrade This command upgrades an existing Kubecost installation to version 3.0.0 using Helm. It requires a values.yaml file to specify configuration overrides. Ensure you have Helm installed and configured correctly to interact with your Kubernetes cluster. ```bash helm upgrade kubecost kubecost/kubecost -f values.yaml --version 3.0.0 ``` -------------------------------- ### Example API Call for Request Sizing (V2) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-container-request-right-sizing-recommendation-api-v2 This `curl` command demonstrates how to call the Container Request Right Sizing Recommendation API (V2) with specific parameters. It includes settings for CPU and RAM algorithms, utilization targets, time window, and a filter to narrow down the scope of recommendations. The example assumes Kubecost is running locally. ```bash KUBECOST_ADDRESS='http://localhost:9090/model' curl -G \ -d 'algorithmCPU=quantile' \ -d 'qCPU=0.95' \ -d 'algorithmRAM=max' \ -d 'targetCPUUtilization=0.8' \ -d 'targetRAMUtilization=0.8' \ -d 'window=3d' \ --data-urlencode 'filter=namespace:"kubecost"+container:"cost-model"' \ ${KUBECOST_ADDRESS}/savings/requestSizingV2 ``` -------------------------------- ### List Kubecost Bundles Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installations-installing-kubecost-plural Lists available Kubecost bundles for your cloud provider. This command helps identify the correct bundle name required for installation. ```bash plural bundle list kubecost ``` -------------------------------- ### Install Kubecost Without Persistent Storage using Helm Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=troubleshoot-install This Helm command deploys Kubecost with persistent storage disabled for both the Kubecost application and its Prometheus instance. This is suitable for experimental setups where data persistence is not required, as metric data will be reset upon pod rescheduling. ```bash helm upgrade -install kubecost kubecost/cost-analyzer \ --namespace kubecost --create-namespace \ --set persistentVolume.enabled="false" \ --set prometheus.server.persistentVolume.enabled="false" ``` -------------------------------- ### Kubernetes Workload Cost Prediction (JSON) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-spec-cost-prediction-api This snippet demonstrates how to structure a JSON request body for the Kubecost Predict API to get cost impact predictions for Kubernetes workloads. It includes example data for a deployment. ```json [ { "apiVersion": "apps/v1", "kind": "Deployment", "metadata": { "name": "kubecost-cost-analyzer", "namespace": "kubecost" }, "spec": { "replicas": 1, "selector": { "matchLabels": { "app": "kubecost-cost-analyzer" } }, "template": { "metadata": { "labels": { "app": "kubecost-cost-analyzer" } }, "spec": { "containers": [ { "name": "cost-analyzer", "image": "kubecost/cost-analyzer:v1.106.0", "resources": { "limits": { "cpu": "500m", "memory": "1Gi" }, "requests": { "cpu": "200m", "memory": "512Mi" } } } ] } } } } ] ``` -------------------------------- ### Filter KubeCost Events by Kind Substring Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-events-api This example shows how to retrieve all KubeCost event kinds that begin with a specific substring, such as 'AssetSet'. It uses a GET request to the KubeCost API endpoint with the 'kind' parameter set to a wildcard pattern. ```HTTP http:///model/etl/log?kind=AssetSet ``` -------------------------------- ### Filter KubeCost Events by Specific Kind Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-events-api This example demonstrates how to filter KubeCost event logs to retrieve only events of a specific kind, such as 'AllocationSetSaved'. It uses a simple GET request to the KubeCost API endpoint with the 'kind' parameter set. ```HTTP http:///model/etl/log?kind=AllocationSetSaved ``` -------------------------------- ### Example Query Complement Costs of a Collection (API) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-query-collection-complement-costs An example demonstrating how to query the complement costs for a specific collection within a 30-day window. This illustrates the required parameters for the API request. ```bash GET /model/collections/query/complement?id=8a939ba1-ff15-4600-b711-2cb109114914&window=30d ``` -------------------------------- ### Kubernetes Events Filtering - Kubectl Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=troubleshoot-install This command filters Kubernetes events to show only those that are not of type 'Normal', sorted by their creation timestamp. It's useful for identifying issues when pods are not starting correctly. ```bash kubectl get events --sort-by=.metadata.creationTimestamp --field-selector type!=Normal ``` -------------------------------- ### Kubernetes Node Group Resources API Endpoint Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=node-group-sizing This is an example of the GET request to the Node Group Resources API endpoint in Kubecost. This API provides analytic data for each node group, including capacity, allocation, request, and usage for CPU, RAM, and GPU. ```http GET /model/kubernetes/nodeGroups/resources ``` -------------------------------- ### Kubernetes Node Group Resources Timeseries API Endpoint Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=node-group-sizing This is an example of the GET request to the Node Group Resources Timeseries API endpoint in Kubecost. This API provides timeseries analytic data for each node group, divided into time windows, for CPU, RAM, and GPU usage. ```http GET /model/kubernetes/nodeGroups/resources/timeseries ``` -------------------------------- ### Example Kubecost Integration Log Output Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=configuration-kubecost-postgres-integration These log messages indicate successful initialization and data querying by the Kubecost integration with its PostgreSQL backend. They show the queries being made and the successful insertion of data into the respective tables. ```text INF Integrations: Postgres: initializing cronjob INF Integrations: Postgres: Allocations: successfully queried http://localhost:9004/allocation?aggregate=namespace&idle=true&shareIdle=false&shareLabels=&shareNamespaces=&window=7d and inserted into REDACTED:kubecost_allocation_data INF Integrations: Postgres: Allocations: successfully queried http://localhost:9004/allocation?aggregate=cluster&idle=true&shareIdle=false&shareLabels=&shareNamespaces=&window=10d and inserted into REDACTED:kubecost_allocation_data2 INF Integrations: Postgres: Assets: successfully queried http://localhost:9004/assets?aggregate=cluster&window=7d and inserted into REDACTED:kubecost_assets_data INF Integrations: Postgres: CloudCosts: successfully queried http://localhost:9004/cloudCost?aggregate=service&window=7d and inserted into REDACTED:kubecost_cloud_costs ``` -------------------------------- ### Kubecost API Response Example Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-allocation-api An example of a successful API response (HTTP 200 OK) from Kubecost, detailing cost allocation for a specific pod. It includes various cost components like CPU, GPU, network, and storage, along with efficiency metrics. This response is useful for understanding detailed cost breakdowns. ```json { "code": 200, "data": [ { "aws-dev-1-niko/ip-192-168-12-152.us-east-2.compute.internal/kubecost/kubecost-cost-analyzer-5b84f94b7f-9lxx5/cost-model": { "name": "aws-dev-1-niko/ip-192-168-12-152.us-east-2.compute.internal/kubecost/kubecost-cost-analyzer-5b84f94b7f-9lxx5/cost-model", "properties": { "cluster": "aws-dev-1-niko", "node": "ip-192-168-12-152.us-east-2.compute.internal", "container": "cost-model", "controller": "kubecost-cost-analyzer", "controllerKind": "deployment", "namespace": "kubecost", "pod": "kubecost-cost-analyzer-5b84f94b7f-9lxx5", "services": ["kubecost-frontend", "kubecost-cost-analyzer"], "providerID": "i-0f227c52893c7957f", "labels": { "app": "cost-analyzer", "app_kubernetes_io_instance": "kubecost", "app_kubernetes_io_name": "cost-analyzer", "kubernetes_io_metadata_name": "kubecost", "node_kubernetes_io_instance_type": "m5.large", "pod_template_hash": "5b84f94b7f" } }, "window": { "start": "2023-01-27T23:00:00Z", "end": "2023-01-28T00:00:00Z" }, "start": "2023-01-27T23:00:00Z", "end": "2023-01-27T23:16:00Z", "minutes": 16.000000, "cpuCores": 0.050000, "cpuCoreRequestAverage": 0.050000, "cpuCoreUsageAverage": 0.000964, "cpuCoreHours": 0.013333, "cpuCost": 0.000426, "cpuCostAdjustment": 0.000000, "cpuEfficiency": 0.019287, "gpuCount": 0.000000, "gpuHours": 0.000000, "gpuCost": 0.000000, "gpuCostAdjustment": 0.000000, "networkTransferBytes": 797941.832389, "networkReceiveBytes": 1243829.277373, "networkCost": 0.000000, "networkCrossZoneCost": 0.000000, "networkCrossRegionCost": 0.000000, "networkInternetCost": 0.000000, "networkCostAdjustment": 0.000000, "loadBalancerCost": 0.003333, "loadBalancerCostAdjustment": 0.000000, "pvBytes": 16169288643.764706, "pvByteHours": 4311810305.003922, "pvCost": 0.000550, "pvs": { "cluster=aws-dev-1-niko:name=pvc-16465f04-6464-483e-89af-9e68b4a59e72": { "byteHours": 4311810305.0039215, "cost": 0.0005500940102068225 } }, "pvCostAdjustment": 0.000000, "ramBytes": 330301440.000000, "ramByteRequestAverage": 330301440.000000, "ramByteUsageAverage": 202833175.272727, "ramByteHours": 88080384.000000, "ramCost": 0.000351, "ramCostAdjustment": 0.000000, "ramEfficiency": 0.614085, "sharedCost": 0.000000, "externalCost": 0.000000, "totalCost": 0.004661, "totalEfficiency": 0.288087 }, "...etc": {} }, { "...etc": {} } ] } ``` -------------------------------- ### Kubecost Node Group Resources API Response Example Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=node-group-sizing An example JSON response from the Kubecost Node Group Resources API. It includes aggregated data for CPU, RAM, and GPU, detailing capacity, allocation, requests, and usage, along with window and label information. ```json { "code": 200, "data": { "window": { "start": "2025-05-01T00:00:00Z", "end": "2025-06-01T00:00:00Z" }, "labelName": "eks_amazonaws_com_nodegroup", "account": "12345", "items": [ { "name": "ng-1", "instanceType": "m5.xlarge", "start": "2025-05-01T00:00:00Z", "end": "2025-05-30T21:00:00Z", "count": { "avg": 9.97, "max": 10 }, "cpu": { "unit": "m", "capacity": { "avg": 12000 }, "allocation": { "avg": 8000 }, "request": { "avg": 8000 }, "usage": { "max": 10000, "avg": 8000 } }, "ram": { "unit": "Mi", "capacity": { "avg": 12000 }, "allocation": { "avg": 8000 }, "request": { "avg": 8000 }, "usage": { "max": 10000, "avg": 8000 } }, "gpu": { "unit": "gpu", "capacity": { "avg": 1 }, "allocation": { "avg": 0.4 }, "request": { "avg": 0.4 }, "usage": { "max": 1, "avg": 0.4 } } } ] } } ``` -------------------------------- ### Query Total Cost with Grouping (Shell) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-query-collection-total-costs This example demonstrates a GET request to the Kubecost API to retrieve total cost data, with the option to include grouped breakdowns. The `groups=true` parameter enables this detailed view, providing cost distribution across different selectors. ```shell GET /model/collection/query/total?id=8a939ba1-ff15-4600-b711-2cb109114914&window=30d&groups=true ``` -------------------------------- ### Establish Port-Forward Connection to Kubecost Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=troubleshoot-install Demonstrates how to forward local ports to the Kubecost service for browser access. It shows the default behavior and how to bind to all interfaces using the --address flag. ```bash kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090 Forwarding from 127.0.0.1:9090 -> 9090 Forwarding from [::1]:9090 -> 9090 ``` ```bash kubectl port-forward --address 0.0.0.0 --namespace kubecost deployment/kubecost-cost-analyzer 9090 Forwarding from 0.0.0.0:9090 -> 9090 ``` ```bash kubectl port-forward --address 0.0.0.0 --namespace kubecost deployment/kubecost-cost-analyzer 9090 Forwarding from 0.0.0.0:9090 -> 9090 Handling connection for 9090 Handling connection for 9090 ``` -------------------------------- ### Kube-state-metrics Pod Fails: Missing API Resources (Ingress, CertificateSigningRequest) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=troubleshoot-install The kube-state-metrics pod fails to start with errors indicating it cannot list *v1beta1.Ingress or *v1beta1.CertificateSigningRequest resources. This is due to missing API resources in Kubernetes. Resolve this by disabling the corresponding KSM metrics collectors in Helm values. ```yaml # Disable ingresses collector prometheus: kube-state-metrics: collectors: ingresses: false # Disable certificatesigningrequests collector prometheus: kube-state-metrics: collectors: certificatesigningrequests: false ``` ```bash kubectl get deployment -n kubecost kubecost-kube-state-metrics -o yaml ``` -------------------------------- ### Describe Specific Pod for Detailed Events Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=troubleshoot-install Provides detailed event logs for a specific pod, which is useful for diagnosing issues when a pod is not in a 'Running' or 'Completed' state. ```bash kubectl describe pod -n kubecost ``` -------------------------------- ### Get Condensed Allocation Payload per Line Item Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-allocation-api Demonstrates how to use the '/summary' endpoint to retrieve a condensed payload of cost metrics per line item, rather than the full schema. This is achieved by appending '/summary' to the '/model/allocation' endpoint, e.g., '.../model/allocation/summary?window=...'. The example shows a typical structure of the condensed response. ```json "allocation-line-item": { "name": "allocation-line-tem", "start": "", "end": "", "cpuCoreRequestAverage": , "cpuCoreUsageAverage": , "cpuCost": , "gpuCost": , "networkCost": , "loadBalancerCost": , "pvCost": , "ramByteRequestAverage": , "ramByteUsageAverage": , "ramCost": , "sharedCost": , "externalCost": , "totalEfficiency": , "totalCost" } ``` -------------------------------- ### Install Kubecost on AWS Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=installations-installing-kubecost-plural Installs the Kubecost bundle, specifically for AWS. This command assumes you have identified the correct bundle name using `plural bundle list kubecost`. ```bash plural bundle install kubecost kubecost-aws ``` -------------------------------- ### Query Timeseries Data from Kubecost API Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=apis-query-collection-time-series-costs This example shows how to retrieve timeseries cost data for a specific ID and time window. It utilizes a GET request to the `/model/collection/query/timeseries` endpoint. The response is a JSON object containing detailed cost breakdowns over the specified period. ```HTTP GET /model/collection/query/timeseries?id=8a939ba1-ff15-4600-b711-2cb109114914&window=30d ``` ```JSON { "id": "8a939ba1-ff15-4600-b711-2cb109114914", "name": "Infrastructure", "category": "Team", "window": { "start": "2023-01-01T00:00:00Z", "end": "2023-02-01T00:00:00Z" }, "data": { "timeseries": [ { "window": { "start": "2023-01-01T00:00:00Z", "end": "2023-01-02T00:00:00Z" }, "cost": { "totalCost": 20.0, "idleCost": 5.0, "domainCosts": { "cloudCost": { "totalCost": 10.0 }, "kubernetesCost": { "totalCost": 10.0, "idleCost": 5.0 } } } }, { "window": { "start": "2023-01-02T00:00:00Z", "end": "2023-01-03T00:00:00Z" }, "cost": { "totalCost": 20.0, "idleCost": 5.0, "domainCosts": { "cloudCost": { "totalCost": 10.0 }, "kubernetesCost": { "totalCost": 10.0, "idleCost": 5.0 } } } }, ... { "window": { "start": "2023-01-31T00:00:00Z", "end": "2023-02-01T00:00:00Z" }, "cost": { "totalCost": 20.0, "idleCost": 5.0, "domainCosts": { "cloudCost": { "totalCost": 10.0 }, "kubernetesCost": { "totalCost": 10.0, "idleCost": 5.0 } } } } ] } } ``` -------------------------------- ### Kubecost Node Group Sizing Recommendations API Response Example (JSON) Source: https://www.ibm.com/docs/en/kubecost/self-hosted/3.x/index_topic=node-group-sizing This JSON structure represents an example API response for node group sizing recommendations. It includes the time window, filtering parameters used, and a list of specific recommendations for optimizing node configurations. ```json { "code": 200, "data": { "window": { "start": "2025-09-03T00:00:00Z", "end": "2025-09-10T00:00:00Z" }, "minNodeCount": 1, "cpuMetric": "usage.p85", "cpuTargetUtilization": 0.8, "ramMetric": "usage.p95", "ramTargetUtilization": 0.8, "gpuMetric": "usage.p95", "gpuTargetUtilization": 0.8, "recommendations": [ { ```