kubecost / kubectl-cost

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

Error: GLIBC not found #147

Closed nickcurie closed 10 months ago

nickcurie commented 1 year ago

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

dwbrown2 commented 1 year ago

Any more repro steps you can share? cc @michaelmdresser

michaelmdresser commented 1 year ago

@dwbrown2 I'm almost certain that this is a problem with WSL2 environments, but I'm not sure if it affects all or just some WSL2 environments. I believe the correct solution is to disable CGO in the kubectl-cost production build to avoid problems like this; the underlying issue is a lack of the GLIBC runtime.

If on a system without GLIBC, the repro is simply: install kubectl cost from any production source -> run. If affected, you will immediately see this error.

michaelmdresser commented 1 year ago

@dwbrown2 is this worth a patch release of kubectl cost before the v1.102 release of Kubecost? It has some overhead because I have to revert a PR that is reliant on v1.102 of Kubecost; doable, just want to know if I should be putting the effort in. Normally kubectl cost release is decoupled from Kubecost but we have some API updates that have to go in tandem.

Impact of this bug is limited to environments without the glibc runtime: e.g. Alpine containers (they use musl) and for some reason Nick's WSL2 installation. Nobody has reported this before, and no fundamental change has been made to kubectl cost's build pipeline, so I'm guessing impact is small.

michaelmdresser commented 1 year ago

Reopening because we need a new release to fix this completely.

dwbrown2 commented 1 year ago

@michaelmdresser I don't feel it's needed but no objection if you'd want to move forward with a patch!

AjayTripathy commented 1 year ago

Don't think we need to patch, let's just roll in 103

michaelmdresser commented 1 year ago

Thank you, I'll wait till 1.103 to release this patch.