jenkins-x/jx

"jx project quickstart" fails with "failed to validate options"

angerson opened this issue · 2 comments

Problem:

jx project quickstart which is... literally the first command on the tutorial page, fails with this error on a fresh install:

error: failed to validate options: failed to create the kube client: failed to get kubernetes config: 
unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined

Steps to Reproduce:

This happens on a fresh Ubuntu 20.04 docker container, and on a fresh Ubuntu 20.04 GCP VM, and on my personal Debian computer.

$ curl -L https://github.com/jenkins-x/jx/releases/download/v3.10.19/jx-linux-amd64.tar.gz | tar xzv
$ chmod +x jx 
$ sudo mv jx /usr/local/bin
$ jx project quickstart
Installing plugin jx-project version 0.2.54 for command jx project from https://github.com/jenkins-x-plugins/jx-project/releases/download/v0.2.54/jx-project-linux-amd64.tar.gz into /home/kbuilder/.jx3/plugins/bin
error: failed to validate options: failed to create the kube client: failed to get kubernetes config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
$ jx version
version: 3.10.19
shaCommit: 6638c0ef41cf8ccdd08765227258c42804e1011c
buildDate: Wed Dec  7 14:42:35 UTC 2022
goVersion: 1.19.3
branch: main
gitTreeState: clean

jx version: 3.10.19

The page starts with "Now that you’ve setup the platform, let’s create your first project."

Have you set up the platform?

No, I haven't. Now I see what you mean.

For developers wanting to experiment with Jenkins-X from nothing, there's very little to funnel them into the correct workflow of first setting up a cluster, then running the quickstart. I was confused for these reasons:

  • The "Get Started" link on the landing page leads to "https://jenkins-x.io/v3/", where the "Developing" section comes first, before "Administration." New users like me could easily assume that "Administration" tasks come after the "Developing" tasks. I thought "Create a Project" would be the first thing to do as part of a Jenkins-X cluster setup because it came first when I wanted to "Get Started." This would be easily fixed with a brief line on the top of the documentation page saying "Start with the Admin Guide if you don't have a cluster yet, then move on to the User Guide to configure your first project."
  • I honestly did not register the "Now that you've setup the platform" text because it was styled like a subtitle, which on documentation pages are often fluff, jokes, or otherwise pointless. So I skimmed past it. A warning pop-out or other "you need a cluster first" would be helpful.
  • jx project quickstart fails with a random-seeming error. It could easily say "You need to set up a cluster before running a quickstart. See Administration documentation." The current error really doesn't help at all -- because it happens even before choosing a template and doesn't give useful feedback, it looks like a tool error rather than a user error.