-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Kubecost Version
2.2.5
Kubernetes Version
1.28
Kubernetes Platform
EKS
Description
kubectl plugin for kubecost (aka cost) errors when executing predict subcommand.
EKS 1.28.8
kubecost UI Version 2.2.5 (c0726bff)
kubectl cost version info
Git Commit: d675760
Git Branch: HEAD
Git State: clean
Git Summary: v0.6.2
Build Date: 2024-03-19T16:32:10Z
if i use the yaml example here
read -r -d '' DEF << EndOfMessage
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: default
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
resources:
requests:
cpu: "3"
memory: "2Gi"
EndOfMessage
echo "$DEF" | kubectl cost predict -f -
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 502 and data: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.25.5</center>
</body>
</html>
Steps to reproduce
- Deploy kubecost version 2.2.5
- Install cost plugin -
kubectl krew install cost - Use predict subcommand
read -r -d '' DEF << EndOfMessage
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: default
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
resources:
requests:
cpu: "3"
memory: "2Gi"
EndOfMessage
echo "$DEF" | kubectl cost predict -f -
Expected behavior
It should work
OBJECT Δ QTY RESOURCE UNIT COST PER UNIT Δ COST/MO % CHANGE
────────────────────────────────────────────────────────────────────────────────────────
default deployment +9 CPU cores 23.27 USD +209.47 USD
nginx-deployment
+6 RAM GiB 3.12 USD +18.72 USD
────────────────────────────────────────────────────────────────────────────────────────
TOTAL MONTHLY COST CHANGE +228.18 USD
But it doesn't
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 502 and data: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.25.5</center>
</body>
</html>
Impact
We want to use kubectl cost predict subcommand as part of CI/CD process this hinders end to end benefit of kubecost. Monitoring and adjusting what has already been deployed works, but blocking it being created in the first place fails.
Using version 1.x is not a valid approach
Screenshots
No response
Logs
No response
Slack discussion
Troubleshooting
- I have read and followed the issue guidelines and this is a bug impacting only the Kubecost application.
- I have searched other issues in this repository and mine is not recorded.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working