sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
692 stars 766 forks source link

The connection to the server localhost:8080 was refused - did you specify the right host or port? #23571

Open Git-Nachi opened 1 month ago

Git-Nachi commented 1 month ago

Tutorials: https://developers.sap.com/tutorials/btp-app-kyma-prepare-dev-environment.html

In Step 4: Log in to your Kyma cluster

After downloading the .yaml file from KubeconfigURL, manual copy may not work properly as defined in the tutorial (MacOS). Because, its difficult to find .KUBE folder in mac & in many case it is not visible at all even with ls -A command in terminal. Any further commands like "kubectl create namespace risk-management" will throw following error message.

"The connection to the server localhost:8080 was refused - did you specify the right host or port?"

To over come this -> Easy way is to set the environment with EXPORT KUBECONFIG=<Downloaded .yaml file path>.

This means, right after downloading the .yaml, in the VS Code terminal write ----> EXPORT KUBECONFIG=.

For ex, it should look like this - EXPORT KUBECONFIG=/Users/abc/Downloads/config.yaml

I feel, this is much easier to set the environment & this should work irrespective of OS. However, I'm submitting this for your review. Please check and add this hint too, it may help someone else who is puzzled with 8080 refusal error.

Reference Blog / Tutorial : https://developers.sap.com/tutorials/btp-kyma-extension.html#d1e76efd-61f4-420c-a9db-12c4615ed635