Jx: should we add a new diagnostic command? e.g. `jx diagnostic`

Created on 11 Jul 2018  路  6Comments  路  Source: jenkins-x/jx

it seems when folks have issues we tend to ask them to run a few different commands like:

jx version
kubectl get pvc
kubectl get pod

I wonder if we should have a simple single command we can generate a nice output of, say, those 3 commands to start with? Then over time we can improve the output to add more useful information over time?

good first issue help wanted kinenhancement

All 6 comments

I guess another option is to add a verbose version of jx status maybe?

I was thinking of adding a helm diagnostic so perhaps make this an extendable command hierarchy?

I like the idea of a diagnostic command that we can add more stuff to as we include more features or learn of common failures. Even offer things to try, or auto search for existing issues on jx?

@tdcox @rawlingsj agree to both of those!

it could also output a link to the FAQ as well - have started curating a list of common issues there https://jenkins-x.io/faq/issues/

I can tackle this one. Here's what I'm thinking of having it print:

  • jx status
  • jx version
  • kubectl get po
  • kubectl get pvc
  • kubectl get svc

Plus a link to https://jenkins-x.io/faq/issues/ like @jstrachan suggested.

Anything else I should add as a starter? Or things I could remove from that list. And if I add a command for Helm (such as jx diagnostic helm), what should I add there?

Edit: Here's some sample output I whipped up quickly in Go:

johns-mbp-3:jx johncollier$ jx diagnostic
*** Jenkins-X Version ***
Using helmBinary helm, with noTiller false
NAME               VERSION
jx                 1.3.295-dev+a03f2097
jenkins x platform 0.0.2454
kubernetes cluster v1.11.1+icp-ee
kubectl            v1.9.4
helm client        v2.10.0+g9ad53aa
helm server        v2.10.0+g9ad53aa
git                git version 2.15.2 (Apple Git-101.1)

*** Jenkins-X Status ***
Jenkins X checks passed for Cluster(mycluster): 6 nodes, memory 30% of 64949304Ki, cpu 39% of 28. Jenkins is running at http://jenkins.jx.9.42.2.216.nip.io

*** Kubernetes PVCs ***
NAME                        STATUS    VOLUME         CAPACITY   ACCESS MODES   STORAGECLASS   AGE
jenkins                     Bound     jxpv3          30Gi       RWO                           2d
jenkins-x-docker-registry   Bound     jxpv1          100Gi      RWO                           2d
jenkins-x-mongodb           Bound     jxpv2          8Gi        RWO                           2d
jenkins-x-nexus             Bound     jenkinsslave   8Gi        RWO                           2d

*** Kubernetes Pods ***
NAME                                             READY     STATUS    RESTARTS   AGE
jenkins-598db5b8b7-4k9pn                         1/1       Running   2          2d
jenkins-x-chartmuseum-55c9598b56-bgzbv           1/1       Running   2          2d
jenkins-x-controller-workflow-64d4d69466-g8k8d   1/1       Running   1          2d
jenkins-x-docker-registry-7b56b4f555-nwr8q       1/1       Running   2          2d
jenkins-x-heapster-65fd697bb-xggh5               2/2       Running   4          2d
jenkins-x-mongodb-6bfd5d9c79-7hwt4               1/1       Running   3          2d
jenkins-x-monocular-api-5c85d647d5-bblkh         1/1       Running   4          2d
jenkins-x-monocular-prerender-5848c74fdc-cwl6z   1/1       Running   2          2d
jenkins-x-monocular-ui-7fb574b54d-9x2rg          1/1       Running   2          2d
jenkins-x-nexus-8655db64f7-7p8s8                 1/1       Running   1          2d
pipelinecontroller-6b5b8d9f47-bdnsb              1/1       Running   1          2d
tester-maven                                     2/2       Running   0          1d

*** Kubernetes Services ***
NAME                            TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)             AGE
heapster                        ClusterIP   10.0.0.123   <none>        8082/TCP            2d
jenkins                         ClusterIP   10.0.0.153   <none>        8080/TCP            2d
jenkins-agent                   ClusterIP   10.0.0.96    <none>        50000/TCP           2d
jenkins-x-chartmuseum           ClusterIP   10.0.0.152   <none>        8080/TCP            2d
jenkins-x-docker-registry       ClusterIP   10.0.0.66    <none>        5000/TCP            2d
jenkins-x-mongodb               ClusterIP   10.0.0.42    <none>        27017/TCP           2d
jenkins-x-monocular-api         ClusterIP   10.0.0.130   <none>        80/TCP              2d
jenkins-x-monocular-prerender   ClusterIP   10.0.0.233   <none>        80/TCP              2d
jenkins-x-monocular-ui          ClusterIP   10.0.0.227   <none>        80/TCP              2d
nexus                           ClusterIP   10.0.0.240   <none>        80/TCP              2d
tester-maven                    ClusterIP   10.0.0.45    <none>        5005/TCP,8080/TCP   1d
tester-maven-theia              ClusterIP   10.0.0.97    <none>        80/TCP              1d

Please visit https://jenkins-x.io/faq/issues/ for any known issues.
Finished printing diagnostic information.

I've got a change here that implements it: https://github.com/johnmcollier/jx/commit/6c417c52a2bada2c816b87afe02f83cb11cfed70

I'll clean it up a bit later and open a PR.

Was this page helpful?
0 / 5 - 0 ratings