Closed jessegoodier closed 1 year ago
@jessegoodier do you know what version of kubectl cost you're running?
@michaelmdresser @teevans for triage
Update, this is not the way to use predict. Though there still seems to be an issue with predic. Is it my client?
this is correct, requires a proper context:
k cost predict -f memory-limit-eq-request.yaml
using kubectl v1.25.4
error:
k cost predict -f memory-limit-eq-request.yaml
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 500 and data: Failed to predict cost impact of specs: cannot predict impact of nil spec
update: works on my test cluster, but not kc-demo-prod:
(arn:aws:eks:us-east-2:297945954695:cluster/test-1/jesse) ubuntu@aerog in /home/ubuntu
>k cost predict -f memory-limit-eq-request.yaml
OBJECT Δ QTY RESOURCE UNIT COST PER UNIT Δ COST/MO % CHANGE
───────────────────────────────────────────────────────────────────────────────────────
jesse deployment +44 CPU millicores 0.023 USD +1.01 USD
memory-limit-eq-request
+44 RAM MiB 0.0030 USD +0.13 USD
───────────────────────────────────────────────────────────────────────────────────────
TOTAL MONTHLY COST +1.14 USD
(arn:aws:eks:us-east-2:297945954695:cluster/test-1/jesse) ubuntu@aerog in /home/ubuntu
>kx kc-demo-prod
Switched to context "kc-demo-prod".
(kc-demo-prod/kubecost) ubuntu@aerog in /home/ubuntu
>k cost predict -f memory-limit-eq-request.yaml
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 500 and data: Failed to predict cost impact of specs: cannot predict impact of nil spec
some more info on what we are seeing:
kubectl config set-context --current --namespace=kubecost
Context "arn:aws:eks:us-west-2:297945954695:cluster/kc-demo-prod" modified.
$ chris@Christophers-MacBook-Pro ~/src/se-demo/predict_samples predict_samples_initial kubectl cost predict -f small.yaml --log-level debug
2023-04-17T13:12:49.154625-04:00 DBG ServiceName set to: kubecost-cost-analyzer
2023-04-17T13:12:49.154746-04:00 DBG KubecostNamespace set to: kubecost
2023-04-17T13:12:50.177065-04:00 DBG checking readiness of 'kubecost-cost-analyzer-74d4f67bdf-qb2km'
2023-04-17T13:12:50.177091-04:00 DBG selected pod to forward: kubecost-cost-analyzer-74d4f67bdf-qb2km
2023-04-17T13:12:50.426228-04:00 DBG Port-forward set up at: http://localhost:58222/
2023-04-17T13:12:50.432428-04:00 DBG Executing GET to: http://localhost:58222/model/clusterInfo
2023-04-17T13:12:50.678468-04:00 DBG Cluster ID for query set to: kc-demo-prod
2023-04-17T13:12:50.678526-04:00 DBG Executing POST to: http://localhost:58222/model/prediction/speccost?clusterID=kc-demo-prod&defaultNamespace=kubecost&noUsage=false&windowAvgUsage=2d&windowResourceCost=7d+offset+48h
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 500 and data: Failed to predict cost impact of specs: cannot predict impact o
```f nil spec
@michaelmdresser - Can you take a look here?
@kc-creynold @jessegoodier is this broken in nightly? We have a PR slated for release in 1.103 that should fix this: https://github.com/kubecost/kubecost-cost-model/pull/1383
quick test works in nightly.
Closing as this should be fixed in v1.103 of Kubecost. If an error is still occurring, please reopen this issue.
Not sure if this is user error or not, but:
yields: