kubecost / kubectl-cost

CLI for determining the cost of Kubernetes workloads
Apache License 2.0
872 stars 55 forks source link

Add support for basic GPU cost prediction, support altered prediction API schema #138

Closed michaelmdresser closed 1 year ago

michaelmdresser commented 1 year ago

What does this PR change?

Adds support for GPU cost prediction for standard AMD, Intel, and NVIDIA GPU plugins.

Does this PR rely on any other PRs?

How does this PR impact users? (This is the kind of thing that goes in release notes!)

How was this PR tested?

→ go run cmd/kubectl-cost/kubectl-cost.go predict -f ./test/multi.yaml --window '2h'
+-------------------------------+------+-------+-----+------------+------------+-------------+-------------+
| WORKLOAD                      | CPU  | MEM   | GPU | CPU/MO     | MEM/MO     | GPU/MO      | TOTAL/MO    |
+-------------------------------+------+-------+-----+------------+------------+-------------+-------------+
| Deployment/nginx-deployment   | 9    | 6Gi   | 0   | 209.58 USD |  18.73 USD |    0.00 USD |  228.31 USD |
| Deployment/nginx-deployment-2 | 10   | 35Gi  | 0   | 232.87 USD | 109.23 USD |    0.00 USD |  342.10 USD |
| Pod/nginx-pod                 | 350m | 200Mi | 0   |   8.15 USD |   0.61 USD |    0.00 USD |    8.76 USD |
| Pod/nginx-pod                 | 350m | 200Mi | 3   |   8.15 USD |   0.61 USD | 2080.50 USD | 2089.26 USD |
+-------------------------------+------+-------+-----+------------+------------+-------------+-------------+
|                               |      |       |     | 458.75 USD | 129.18 USD | 2080.50 USD | 2668.42 USD |
+-------------------------------+------+-------+-----+------------+------------+-------------+-------------+

Have you made an update to documentation?

N/A