I'm creating this entry to share my findings after investigating a very frustrating issue with Lens/OpenLens, in which for a specific cluster we received the following type of errors:
failed to get /version for clusterId:<ID> [Forbidden/Bad Gateway/Internal]
(We are managing this cluster's RBAC using InfraHQ).
It occurred despite the fact that kubectl was working okay.
When assigning a cluster-admin role (infraHQ) --> allow all operations on everything, it resolved the issue.
Just in case someone stumbled upon this issue, I have resolved my issue by Executing the command:
aws eks --region ${your_eks_region} update-kubeconfig --name ${eks_cluster_name} --profile ${aws_profile}
In my case, I missed the --profile parameter that's why I'm getting the said issue.
As @anXler stated, I too am using iterm2 for Mac. I was having this exact issue, and what worked was closing the app (command + Q) and opening it via the path in iterm2. I assume an env variable was not being loaded correctly. I created an alias in my ~/.bashrc to call this path, which correctly loaded the env variables.
Add this line to ~/.bashrc or ~/.zshrc:
alias lens="open /Applications/OpenLens.app/"
After that's added, then source your rc file.
source ~/.bashrc
Now you can launch it from the terminal with lens.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With