Giter Site home page Giter Site logo

kubectl-cost's People

Contributors

avrodrigues5 avatar biancaburtoiu avatar dwbrown2 avatar jessegoodier avatar kaelanspatel avatar kranurag7 avatar mattray avatar michaelmdresser avatar nealormsbee avatar nickcurie avatar numonedad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubectl-cost's Issues

Timeout on larger clusters

A user reported running kubectl cost deployment ... is working fine on a small cluster but is encountering a timeout on a larger cluster. We suspect this is caused by the query to /aggregatedCostModel is not using etl=true in the parameters. See [API docs](https://github.com/kubecost/docs/blob/master/allocation-api.md#aggregated-cost-model-api).

The logs report didn't get PVC pricing in Alicloud

│ cost-model 2023-04-05T00:39:32.827912443Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::750                                                            ││ cost-model 2023-04-05T00:39:32.827931779Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::100                                                            ││ cost-model 2023-04-05T00:39:32.827949108Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::242                                                            ││ cost-model 2023-04-05T00:39:32.827969769Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::418                                                            ││ cost-model 2023-04-05T00:39:32.827989303Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::2600                                                           ││ cost-model 2023-04-05T00:39:32.828010825Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::920                                                            ││ cost-model 2023-04-05T00:39:32.828029386Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_ssd::21                                                                    ││ cost-model 2023-04-05T00:39:32.828049073Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::20                                                             ││ cost-model 2023-04-05T00:39:32.828067996Z ERR Persistent Volume pricing not found for PV with feature: ap-southeast-1::data::cloud_efficiency::2600

Does not work with SAML enabled in Kubecost

Enterprise users with SAML enabled will encounter an error like

Error: failed to query agg cost model: failed to proxy get kubecost: (get services kubecost-cost-analyzer:9090)

For those reaching this issue when encountering a similar error, this error occurs for many different reasons, SAML being one

The SAML auth flow is not easily replicable because it is web-based. This will require some digging to implement.

Missing components in total cost

It looks like loadbalancers costs can cause a discrepancy between the total columns and it's subcomponents when passing -A. The same may be true for external costs.

image

The could be an opportunity to move to the new Allocation API so we have everything in one point if we haven't done that.

Error: failed to get currency code

Really looking forward to getting this working. Thanks for building it.

I'm getting a currency code error. I guess I have to configure that somewhere.

$ kubectl cost namespace --window 5d
Error: failed to get currency code: failed to forward get kubecost: failed to get service pods: failed to get service kubecost-cost-analyzer in namespace kubecost: services "kubecost-cost-analyzer" not found
Usage:
  cost namespace [flags]

What am I doing wrong / not doing?

Support request ro HTTPS oauth proxy sidecar

In the environments with oauth-proxy as as reverse proxy to authenticate users (like OpenShift), the command fails. Neither with --use-proxy, not without it.

Setup

  • An opencost pod with a sidecar container having image quay.io/openshift/origin-oauth-proxy:4.10.0 as an oauth-proxy which listens on 8443, checks users authorization with kubernetes SAR and proxies to localhost:9090
  • A service with clusterIP type which maps port 443 on service to 8443 on pod

Logs

Command which failed with --use-proxy:

kubectl cost --service-name opencost --kubecost-namespace costs --allocation-path /allocation/compute label -l team --window 1d --service-port 443 --log-level debug --use-proxy

Output

2023-10-18T18:23:24.493238+03:30 DBG failed to get currency code, displaying as empty string: failed to proxy get kubecost. err: the server is currently unable to handle
the request (get services opencost:ƻ); data: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"no endpoints available for service \"spc
ld-opencost:ƻ\"","reason":"ServiceUnavailable","code":503}

Error: failed to query allocation API: failed to proxy get kubecost. err: the server rejected our request for an unknown reason (get services opencost:443); data: C
lient sent an HTTP request to an HTTPS server.

Command which failed without --use-proxy:

kubectl cost --service-name opencost --kubecost-namespace costs --allocation-path /allocation/compute label -l team --window 1d --service-port 8443 --log-level debug

Output

2023-10-18T18:15:41.18618+03:30 DBG checking readiness of 'opencost-5766b5f4bb-vtnqn'
2023-10-18T18:15:41.186484+03:30 DBG selected pod to forward: opencost-5766b5f4bb-vtnqn
2023-10-18T18:15:41.334582+03:30 DBG Port-forward set up at: http://localhost:60877
2023-10-18T18:15:41.335083+03:30 DBG Executing GET to: http://localhost:60877/model/getConfigs
2023-10-18T18:15:42.463207+03:30 DBG failed to get currency code, displaying as empty string: failed to forward get kubecost: received non-200 status code 400 and data: C
lient sent an HTTP request to an HTTPS server.

2023-10-18T18:15:42.463384+03:30 DBG Executing GET to: http://localhost:60877/allocation/compute?accumulate=true&aggregate=cluster%2Clabel%3Ateamteam&window=1
d
Error: failed to query allocation API: failed to port forward query: received non-200 status code 400 and data: Client sent an HTTP request to an HTTPS server.

This command's parameter --service-port has been set to 8443 due to failure. Seems it points to pod's port, not service's port in port-forward mode according to the logs:

2023-10-18T18:15:41.186484+03:30 DBG selected pod to forward: opencost-5766b5f4bb-vtnqn
2023-10-18T18:15:41.334582+03:30 DBG Port-forward set up at: http://localhost:60877

Suggestion

I think there are two solutions might resolve this:

  • Provide an option to send request directly to the opencost/kubecost API server (#128)
  • Provide an option to send request as HTTPS to the service-port, with optionally pass CA. This method is different from first one, and might have other use cases, and eliminates need to expose the cost API publicly.

Add support for providing just an endpoint to hit for data, instead of proxying/port-forwarding into a cluster

Some users may wish to run kubectl cost against an already-exposed endpoint (if Kubecost endpoints are exposed publicly) or a local version of OpenCost during development.

We could add support for this with a third query mode, kubectl cost --no-cluster --path "kubecost.example.com" (or similar) that just uses an API endpoint path to make queries and doesn't port-forward or proxy using a K8s client. Flag names TBD.

This is currently low priority. If you are interested in this functionality, please comment on this issue!

View cost by pod

I know we originally had the ability to drill down to cost by pod (maybe even container). Any chance of bringing that back? I'd be interested to filter by namespace and then look at the cost of all pods in cases where there are many without a controller!

Plugin fails to connect with deny ingress NetworkPolicy

Kubectl works perfectly with the AKS cluster but kubectl-cost gives an error.

kubectl get ns k8s-kubecost
NAME           STATUS   AGE
k8s-kubecost   Active   104d

kubectl get service -n k8s-kubecost
NAME                          TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                      AGE
cost-analyzer-cost-analyzer   ClusterIP   [REDACTED]   <none>        9001/TCP,9003/TCP,9090/TCP   24d
cost-analyzer-network-costs   ClusterIP   None         <none>        3001/TCP                     27h

kubectl cost pod -N k8s-kubecost --service-name cost-analyzer-cost-analyzer -n k8s-kubecost
Error: failed to get currency code: failed to proxy get kubecost. err: an error on the server ("unknown") has prevented the request from succeeding (get services cost-analyzer-cost-analyzer:9090); data: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"error trying to reach service: dial tcp [REDACTED]:9090: i/o timeout","code":500}

The redacted IP is the private IP of the cost-analyzer pod, not a public one.

some label queries don't work

An 'app' label query like this show several apps:

$ kubectl cost label -l 'app'

+---------+--------------------+--------------------+-----------------+
| CLUSTER | LABEL:APP          | MONTHLY RATE (ALL) | COST EFFICIENCY |
+---------+--------------------+--------------------+-----------------+
| asdf    | __unallocated__    |         1234.00 |        0.73311 |
|         | cert-manager       |           0.000000 |        0.000000 |
|         | webhook            |           0.000000 |        0.000000 |
|         | prometheus         |           0.000000 |        0.000000 |
+---------+--------------------+--------------------+-----------------+
| SUMMED  |                    |        1234.00 |                 |
+---------+--------------------+--------------------+-----------------+

But some other label queries group everything under unallocated even though there are pods with those labels:

$ kubectl cost label -l 'app.kubernetes.io/name'

+---------+------------------------------+--------------------+-----------------+
| CLUSTER | LABEL:APP.KUBERNETES.IO/NAME | MONTHLY RATE (ALL) | COST EFFICIENCY |
+---------+------------------------------+--------------------+-----------------+
| asdf   | __unallocated__              |        1234.00 |        0.73311 |
+---------+------------------------------+--------------------+-----------------+
| SUMMED  |                              |        1234.00 |                 |
+---------+------------------------------+--------------------+-----------------+

I get the same result for the label 'name'--is there some trick to the syntax?

Security Slam 2023 Participation

Hello kubecost community!

In case you missed it, last week was the kickoff for the month-long Cloud Native Security Slam! You can read more about the event and find the kickoff webinar recording here.

In the kickoff last week, it was announced that there are 5 event badges that projects can pursue. There will be swag prizes and a $100 gift card awarded for the first 200 badges that are competed— that's up to $500 per project!

To help with work prioritization, we completed a survey of CNCF end users across multiple industries, including Construction, Cybersecurity, Aerospace & Defense, Game Development & Consumer Services, Consulting, and Nuclear.

Through this survey, end users have identified their interest in seeing security improvements to the projects they use. We've asked them to share which Security Slam goals are most interesting to them— and we've compiled the results in a hope that this will help your prioritization during the upcoming event.

While some users have not authorized us to share their name, we've still included their responses in our calculation for you. We CAN tell you that the kubecost responses included Epic Games and Infosys.

After calculating the responses according to the interest-weight, we've found these to be the most interesting things that kubecost end users would like to see, from the five possible Security Slam badges.

  1. The Mechanizer
  2. The Chronicler
  3. The Inspector, The Cleaner (tie)

You can read more about the success metrics and find resources to help you achieve them here.

Join us in the #security-slam channel on the CNCF Slack to ask questions and get help from the community!

[bug] kubectl-cost version returns blank output

While executing the command kubectl-cost version, I'm getting blank output.

$ kubectl-cost version
kubectl cost version info
    Git Commit:   
    Git Branch:   
    Git State:    
    Git Summary:  
    Build Date:

The command should return output with proper version and commit ID.

gz#1988

(related to Zendesk ticket #1988)

Shorthand for all cost categories

I find my self running commands like

kubectl cost namespace

getting results like

+-------------------+--------------------+
| NAMESPACE         | MONTHLY RATE (ALL) |
+-------------------+--------------------+
| kube-system       |         171.735257 |
| kubecost-stage    |         148.139922 |
| kubecost          |         147.654236 |
| default           |         141.310171 |
| logging           |         138.559676 |
| frontend-services |         138.448290 |
| data-science      |         137.152641 |
+-------------------+--------------------+
| SUMMED            |        1023.000194 |
+-------------------+--------------------+

and then immediately want to understand what is driving the cost of each namespace. the --show-all-resources does exactly this, but I keep forgetting this flag name... what about a shorthand for this? one similar command flag would be -o wide or --show-details could work... just a couple ideas

Feature Request: kubectl cost prices

While kubectl cost currently shows costs for various assets, it doesn't show the source of pricing data.

/allNodePricing from https://github.com/opencost/opencost/blob/develop/pkg/costmodel/router.go#L1757 returns JSON for on-prem similar to

{
    "code": 200,
    "status": "success",
    "data": {
        "default": {
            "CPU": "10.25",
            "RAM": "3.50",
            "GPU": ""
        },
        "default,gpu": {
            "CPU": "10.25",
            "RAM": "3.50",
            "GPU": "2.95"
        },
        "default,spot": {
            "CPU": "0.6655",
            "RAM": "0.892",
            "GPU": ""
        }
    }
}

Public clouds have more complicated responses, but this would make it easier to see prices applied (and potentially customized). Even only showing On Demand pricing would be useful.

Error: GLIBC not found

Getting an error when running kubectl cost commands

Commands Ran: kubectl cost and kubectl cost namespace --show-all-resources
Error Message:
/home/user/.krew/bin/kubectl-cost: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/.krew/bin/kubectl-cost)
/home/user/.krew/bin/kubectl-cost: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/user/.krew/bin/kubectl-cost)
Environment: WSL2

Predict command is not working through proxy

Greetings,

I have a customer attempting to use this plugin with their deployment. They have setup a proxy for other users to access it. They also have SSO/SAML, but may not matter as they have the proxy set up

ZD issue link:
https://kubecost.zendesk.com/agent/tickets/3893

It's not working for the predict command, see:

$ k cost predict -f /tmp/bla --use-proxy --log-level debug --server localhost:8080 
2023-04-21T22:00:13.75934787-03:00 ServiceName set to: kubecost-cost-analyzer 
2023-04-21T22:00:13.759386015-03:00 KubecostNamespace set to: kubecost 
Error: acquiring cluster ID from service: failed to proxy get kubecost. err: the server is currently unable to handle the request (get services kubecost-cost-analyzer:⎂); data: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"no endpoints available for service \"kubecost-cost-analyzer:⎂\"","reason":"ServiceUnavailable","code":503}`

While without proxy it works fine, like

OBJECT Δ QTY RESOURCE UNIT COST PER UNIT Δ COST/MO % CHANGE 
──────────────────────────────────────────────────────────────────────────────────────── 
default deployment +9 CPU cores 21.85 USD +196.63 USD 
nginx-deployment 
+6 RAM GiB 2.93 USD +17.59 USD 

──────────────────────────────────────────────────────────────────────────────────────── 
TOTAL MONTHLY COST +214.22 USD 

I'll share this issue with the customer to stay up to date

[FR/BUG] Show __idle__ costs (again) using OpenCost

First-of-all I appreciate all the work that was done in this awesome tool :)

Imho it was possible for kubectl-cost to show "idle"-costs for OpenCost in the past. This does not seem to work anymore.
I guess it is related to this: opencost/opencost#1270 (comment)
It would be nice to add ?includeIdle=true parameter to the requests to opencost api (or make it an option).

Regards,
Daniel

Feature requests - Output + Implementations

Hello to all,

I'm opening this issue, for 2 feature requests.

First one would be to be able to get the output of kubectl-cost formatted in CSV and/or JSON.
From the [https://github.com/kubecost/docs/blob/master/allocation.md#querying] documentation it is possible by API calls ("format").

Second would be the possibility to use other query stuff from querying (same link as above) , like the aggregation options, and the filters.

Thanks for all the work and in advance for further

Regards,

[FR] Results in JSON format

This command-line tool is really interesting to use for automation as well. It would be really useful if it could also provide the results in JSON format so that they can also be digested by automation scripts.

Add whitelist filters to commands

We currently provide no way to filter output, something like kubectl cost namespace --whitelist ns1,ns2,ns3 which would only display cost data for namespaces ns1, ns2, and ns3.

The backing /aggregatedCostModel API provides filtering and so does the /allocation API.

They do so in different ways, however, making this a little more complicated than just passing a filter through to the API call.

[FR] Savings statistics available with CLI

I can't find a way to extract the information related to the Saving panels.

Are they available? If they are not, this issue of mine is to be understood as a feature request. 😛

A potential risk of kubecost makes a worker node get the token of any Service Account

Summary

  The Kubecost in GKE gave excessive authority when defining Service Account named "kubecost-1-cost-analyzer-serviceaccount-name-dff5" "kubecost-1-cost-analyzer-prometheus-serviceaccounts-server-name-e82d" and "kubecost-1-deployer-kvsqj". Besides, these Service Accounts are mounted into pod, witch makes it possible for attackers to raise rights to administrators.
 

Detailed Analysis

  • We deployed Kubecost in the marketplace of Google's GKE cluster by default.

  • The clusterrole named "default:kubecost-1:cost-analyzer.serviceAccount.name-r0" defines the "*" verb of "pods, deployments, replicationcontrollers and nodes". And this clusterrole is bound to the Service Account named "kubecost-1-cost-analyzer-serviceaccount-name-dff5". The Service Account is mounted into the pod named "kubecost-1-cost-analyzer-789fc48778-xgpkg".

  • The clusterrole named "default:kubecost-1:cost-analyzer.prometheus.serviceAccounts.server.name-r0" defines the "*" verb of "pods, jobs, deployments, statefulsets, replicationcontrollers and nodes". And this clusterrole is bound to the Service Account named "kubecost-1-cost-analyzer-prometheus-serviceaccounts-server-name-e82d". The Service Account is mounted into the pod named "kubecost-1-prometheus-server-6f9d5c9989-l972j".

  • The clusterrole named "default:kubecost-1:deployerServiceAccount-r0" defines the "*" verb of "clusterroles and clusterrolebindings". And this clusterrole is bound to the Service Account named "kubecost-1-deployer-sa". The Service Account is mounted into the pod named "kubecost-1-deployer-kvsqj".
     

Attacking Strategy

  If a malicious user controls a specific worker node which has the pod mentioned above, or steals one of the SA token mentioned above.He/She can raise permissions to administrator level and control the whole cluster.
For example,

  • With the "*" verb of "clusterroles and clusterrolebindings", attacker can elevate privileges by creating a clusterrolebinding resource and binding cluster-admin to their own Service Account.

  • With the "*" verb of "pods, jobs, deployments, statefulsets, replicationcontrollers", attacker can elevate privileges by creating a pod to mount and steal any Service Account he/she want.

  • With the "*" verb of nodes, attacker can hijack other components and steal token by adding a "NoExecute" taint to other nodes.

Mitigation Discussion

  • Developer could use the rolebinding instead of the clusterrolebinding to restrict permissions to namespace.

  • Developers could define precise permissions for workload resources, including pods, deployments, jobs, statefulsets, replicationcontrollers , rather than using wildcard (*).

  • The "kubecost-1-deployer" appears to be used for initialization, and developers can delete resources such as the corresponding pod or Service Account after they are no longer needed.

A few questions

  • Is it a real issue in Kubecost?
  • If it's a real issue, can Kubecost mitigate the risks following my suggestions discussed in the "mitigation discussion"?
  • If it's a real issue, does Kubecost plan to fix this issue?

Reporter list

Looking forward to your reply. Regards Xingyu Liu

Introduce a pure-HTTP (no K8s client) query mode for use when only API access is available (e.g. Kubecost Cloud)

Problem

Users of Kubecost's hosted product do not have cluster/kubectl access to the cluster in which the primary Kubecost instance is running, because Kubecost is hosting that in our internal infrastructure. This means they cannot use kubectl cost to get cost information because the CLI currently supports two query modes: port-forward and proxy, both of which require cluster access:

if p.UseProxy {
clientset, err := kubernetes.NewForConfig(p.RestConfig)
if err != nil {
return nil, fmt.Errorf("failed to create clientset for proxied query: %s", err)
}
bytes, err = clientset.CoreV1().Services(p.KubecostNamespace).ProxyGet("", p.ServiceName, fmt.Sprint(p.ServicePort), p.AllocationPath, p.QueryParams).DoRaw(p.Ctx)
if err != nil {
return nil, fmt.Errorf("failed to proxy get kubecost. err: %s; data: %s", err, bytes)
}
} else {
bytes, err = portForwardedQueryService(p.RestConfig, p.KubecostNamespace, p.ServiceName, p.AllocationPath, p.ServicePort, p.QueryParams, p.Ctx)
if err != nil {
return nil, fmt.Errorf("failed to port forward query: %s", err)
}
}

Proposed solution

Implement a new query mode http (on top of the current proxy and port-forward) that sends requests directly to a Kubecost HTTP API endpoint without using a K8s client to execute the request.

Possible additions

It would be amazing (though probably difficult) to somehow tie the current cluster in the user's Kubeconfig to a cluster ID in Kubecost, enabling intelligent filtering of Kubecost data based on the current Kubeconfig context. This is a step 2 for this request, unless it turns out to be simple. (perhaps we could see if there is a kubecost namespace and snag the cluster ID from env vars?)

predict method not allowed on 1.102

Not sure if this is user error or not, but:

k cost predict -f cpu-limit-eq-request.yaml --predict-speccost-path https://demo.kubecost.xyz/model/prediction/speccost

yields:

Error: Failed querying the speccost API. This API requires a version of Kubecost >= 1.101, which may be why this query failed. If running Kubecost v1.100, you can downgrade kubectl cost to v0.4 for old-style prediction. Error: failed to port forward query: received non-200 status code 405 and data: <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.22.1</center>
</body>
</html>

Provide documentation on role permissions needed

As Platform team I would like to know how to craft a role for our developers so they can safely use kubecost via kubectl cost but can't break anything.

Also I don't want to find out by myself one step after the other when following the error messages e.g. :

$ kubectl cost namespace
Error: failed to query allocation API: failed to port forward query: failed to get service pods: failed to get service kubecost-cost-analyzer in namespace kubecost: services "kubecost-cost-analyzer" is forbidden: User "aws:123456789:example-user" cannot get resource "services" in API group "" in the namespace "kubecost"

gz#2059

(related to Zendesk ticket #2059)

Stop using /aggregatedCostModel

Kubectl cost uses the Aggregated cost model API for monthly rate queries, i.e. non --historical queries. That API is old and we want to switch everything to use the Allocation API which kubectl cost already uses for --historical queries.

We should be able to cut out /aggregatedCostModel queries by hitting /allocation and then transforming the cost numbers to a monthly rate based on the coverage of the resulting data. Special care will have to be taken due to the time-based quirks of the Allocation API. Instead of doing something like cost * (month / query window) we should do cost * (month / duration of resulting data coverage).

Show Asset prices on kubectl

It would be really cool to support kubectl cost assets so you could see the fully cost of nodes, LBs, etc in your cluster! This is available in kubecost APIs we just need to expose to the CLI.

Last month Usage for chargeback ( internal billing )

Hello,

Is there a way to get last month data for CPU, RAM and disk in term of usage or request ?

I'm wondering to use kubectl-cost with Kubecost core model to do that but for now, I don't found a way to pass information about the window range with a start and end date. Something like :

Kubectl cost --historical --start-date xxx --end-date yyy

Missing --service-name flag

I do have custom implementation of the kubecost analyzer in different namespace and with different name so I'm not able to call tui:

see:
image

or:
image

list of services:
image

Make the unit of cost clear

Cost is currently displayed without a unit. There is an API endpoint /model/getConfigs with a field .data.currencyCode that returns the unit of currency. If empty string, it is assumed to be USD.

PV cost not working

With #91 and #93, the PV cost field when using --show-pv or -A shows zeros, due to the marshalling of the pvs not working and because pvCost doesn't exist in the Allocation struct. Thus, we're not getting a value for the PV cost.

Either fixing the marshalling of the pvs here or just creating a workaround would both solve the problem.

Efficiency is not displayed for the total column

Running latest with the following command:

kubectl cost namespace --show-efficiency

and I get this output without efficiency metrics:

+-------------------+--------------------+
| NAMESPACE         | MONTHLY RATE (ALL) |
+-------------------+--------------------+
| kubecost          |          43.520037 |
| kube-system       |          34.135655 |
| kubecost-stage    |          25.915218 |
| default           |           3.467030 |
| frontend-services |           1.386221 |
| logging           |           1.341132 |
| data-science      |           0.009510 |
+-------------------+--------------------+
| SUMMED            |     USD 109.774804 |
+-------------------+--------------------+

Add `--opencost` flag to specify standard OpenCost settings

When using kubectl cost with OpenCost, there are a bunch of boilerplate CLI options you have to add:
--service-port 9003 --service-name opencost --kubecost-namespace opencost --allocation-path /allocation/compute

It would be handy to just pass --opencost and get all of those set by default (while still allowing for being more specific if needed).

Kubecost incorrectly calculates savings

On the overview page, it reports my cluster as costing $42k/mo, but on /request-sizing.html it is reporting $225k/mo in potential savings when the window is 30 days and the profile is High Availability.

I think you're multiplying possible savings over a month by the number of days in the look-back window.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.