-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error reporting if kubeconfig is missing or cluster unreachable #315
Comments
Did some more testing and I think that it's due to a kube config issue. Try this to reproduce it:
I think it's probably ok that it generates some kind of error since it can't talk to the server/kube, but it would be nice if it gave some of hint as to either a) which config file that's missing, or b) let it fail with a TCP error so we'll get a better error about not being able to connect to localhost. |
The current behavior falls back to the default location ~/.kube/config even if you specify explicitly
just saying. Beside,
+1 |
I tested with the latest version of kn.
I think the error messages are acceptable to some extend. The possible improvements may be:
@navidshaikh any comments ? |
@daisy-ycguo in this case:
what is the error condition being detected? No URL specified to connect to? If so, perhaps we could simply reword this say that - something like:
It's minor but saying "specified" is clearer that config data is missing. Saying something on the "backend" is missing isn't as clear to me what's going on because someone could interpret it as a server-side issue, not a client one. |
The error is detected when the invocation to backend serving API returns a 404 error.
|
on latest release v0.9.0 or current master with no ~/.kube/config or env $KUBECONFIG, I see
(this is the original issue Doug reported, we should add a hint here about missing 'kubeconfig') restoring kubeconfig and make the cluster unreachable
This error message can be improved, sure! but the other error you mentioned
is correct I think. |
/assign |
What's kind of funny is that when I think about the two errors messages: I actually find the 2nd one more helpful (user friendly) despite it using more geeky terms - which is the opposite what I might expect. ;-) I think it's because the 2nd one gives the exact reason behind the error condition and gives the user the exact info they need to try to fix it... their server at that address isn't there. The 1st one is too vague for people to know exactly what happened and doesn't give a hint how to fix it. For example, if the first one said what @daisy-ycguo mentioned "a 404 was returned from the server URL" (and showed me the URL) I think there would be no confusion at all and I have a hint at how to fix it - despite it being more geeky. So, what about something like: |
I had a similar issue getting started with KNative. Just bought the I installed knative:
However I keep getting ➜ knative-play kn
Manage your Knative building blocks:
* Serving: Manage your services and release new software to them.
* Eventing: Manage event subscriptions and channels. Connect up event sources.
Usage:
kn [command]
Available Commands:
completion Output shell completion code
help Help about any command
plugin Plugin command group
revision Revision command group
route Route command group
service Service command group
source Event source command group
trigger Trigger command group
version Prints the client version
Flags:
--config string kn config file (default is $HOME/.kn/config.yaml)
-h, --help help for kn
--kubeconfig string kubectl config file (default is $HOME/.kube/config)
--log-http log http traffic
--lookup-plugins look for kn plugins in $PATH
--plugins-dir string kn plugins directory (default "~/.kn/plugins")
Use "kn [command] --help" for more information about a command. ➜ knative-play kn service list
Get https://192.168.99.100:8443/apis/serving.knative.dev/v1/namespaces/default/services: dial tcp 192.168.99.100:8443: i/o timeout knative-play kn service create hello-example --image gcr.io/knative-samples/helloworld-go --env TARGET="First"
Get https://192.168.99.100:8443/apis/serving.knative.dev/v1/namespaces/default/services/hello-example: dial tcp 192.168.99.100:8443: i/o timeout |
Tried to install by cloning repo and running I guess I need to add it to my I then tried following other approaches from https://knative.dev/docs/install/install-kn/ The links at the bottom for nightly and latest release both give a https://knative.dev/docs/install/install-kn/gcr.io/knative-nightly/knative.dev/client/cmd/kn Please improve the installation/setup guide :) |
Is this the "correct" way of installing KNative!? To install Knative, first install the CRDs by running the kubectl apply command once with the kubectl apply --selector knative.dev/crd-install=true \
--filename https://github.com/knative/serving/releases/download/v0.12.0/serving.yaml \
--filename https://github.com/knative/eventing/releases/download/v0.12.0/eventing.yaml \
--filename https://github.com/knative/serving/releases/download/v0.12.0/monitoring.yaml To complete the install of Knative and its dependencies, run the kubectl apply --filename https://github.com/knative/serving/releases/download/v0.12.0/serving.yaml \
--filename https://github.com/knative/eventing/releases/download/v0.12.0/eventing.yaml \
--filename https://github.com/knative/serving/releases/download/v0.12.0/monitoring.yaml Monitor the Knative components until all of the components show a kubectl get pods --namespace knative-serving
kubectl get pods --namespace knative-eventing
kubectl get pods --namespace knative-monitoring It is very unclear and confusing... |
When I try this approach, I get: unable to recognize "https://github.com/knative/serving/releases/download/v0.12.0/serving.yaml": no matches for kind "Image" in version "caching.internal.knative.dev/v1alpha1"
unable to recognize "https://github.com/knative/serving/releases/download/v0.12.0/serving.yaml": no matches for kind "Gateway" in version "networking.istio.io/v1alpha3"
unable to recognize "https://github.com/knative/serving/releases/download/v0.12.0/serving.yaml": no matches for kind "Gateway" in version "networking.istio.io/v1alpha3" I've installed Istio though |
@kristianmandrup : Thanks for reporting!
go install will output the binary in your
Yes, its fixed and ready to be rolled out in the next release, correct links are |
@navidshaikh Thanks for your quick reply I installed $ which go
/usr/local/bin/go
✗ echo $GOPATH
➜ client git:(master) ✗ I haven't used Go before, looking at GOPATH wiki docs The Currently I have no Go projects however, but I guess I can create a placeholder in ✗ echo $PATH
/Users/kristianmandrup/.nvm/versions/node/v13.7.0/bin::/Users/kristianmandrup/.nimble/bin:/Users/kristianmandrup/.gem/ruby/2.6.0/bin:/usr/local/opt/python/libexec/bin:/Users/kristianmandrup/Library/Python/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/kristianmandrup/Library/Android/sdk/tools/bin:/Users/kristianmandrup/Library/Android/sdk/platform-tools:/Users/kristianmandrup/Library/Android/sdk/emulator
➜ client git:(master) ✗ Thanks |
I still have no idea how to install KNative on Mac OSX using any of these approached. I will try to follow this guide now: https://ubuntu.com/blog/getting-started-with-knative-1 |
For reference, see #648 for way to install kn on macOs Mojave. |
Fixes knative#315 - Improve error reporting if - kubeconfig file is missing or - there is no route to host - i/o timeout
Fixes knative#315 - Improve error reporting if - kubeconfig file is missing or - there is no route to host - i/o timeout
Fixes knative#315 - Improve error reporting if - kubeconfig file is missing or - there is no route to host - i/o timeout
Fixes knative#315 - Improve error reporting if - kubeconfig file is missing or - there is no route to host - i/o timeout
Fixes #315 - Improve error reporting if - kubeconfig file is missing or - there is no route to host - i/o timeout
on master right now I see this in a totally clean env:
A config file should be optional.
The text was updated successfully, but these errors were encountered: