GoogleCloudPlatform / kube-jenkins-imager

Apache License 2.0
258 stars 82 forks source link

Unable to login to Jenkins after cluster_up.sh has successfully completed #26

Closed m8ttyB closed 7 years ago

m8ttyB commented 8 years ago

I've tried running through the Kubernetes example several times (each with a clean project space) and haven't been able to get it to work. I'm happy to share logs or other helpful bits to help debug this.

Upon successful completion of the cluster_up.sh an IP address is exposed and Jenkins appears to be successfully deployed.

Viewing `gcloud -v' outputs:

Google Cloud SDK 126.0.0 
bq 2.0.24
bq-nix 2.0.24
core 2016.09.12
core-nix 2016.08.05
gcloud
gsutil 4.21
gsutil-nix 4.20
kubectl
kubectl-darwin-x86_64 1.3.6

Output of ./cluster_up.sh:

$ ./cluster_up.sh
* Creating Google Container Engine cluster "imager"...
Creating cluster imager...done.
Created [https://container.googleapis.com/v1/projects/XXX/zones/us-central1-f/clusters/imager].
kubeconfig entry generated for imager.
NAME    ZONE           MASTER_VERSION  MASTER_IP      MACHINE_TYPE   NODE_VERSION  NUM_NODES  STATUS
imager  us-central1-f  1.3.6           xxx.xxx.xxx.xx  n1-standard-1  1.3.6         3          RUNNING
done.
* Configuring kubectl to use imager cluster...
Fetching cluster endpoint and auth data.
kubeconfig entry generated for imager.
done.
Getting Jenkins artifacts
Deploying Jenkins to Google Container Engine...
~/workspaces/kube-jenkins-imager/continuous-deployment-on-kubernetes ~/workspaces/kube-jenkins-imager
* Creating Jenkins home image
Created [https://www.googleapis.com/compute/v1/projects/xxx/global/images/jenkins-home-image].
NAME                PROJECT                FAMILY  DEPRECATED  STATUS
jenkins-home-image  XXX                      READY
* Creating Jenkins home disk
Created [https://www.googleapis.com/compute/v1/projects/XXX/zones/us-central1-f/disks/jenkins-home].
NAME          ZONE           SIZE_GB  TYPE         STATUS
jenkins-home  us-central1-f  10       pd-standard  READY

New disks are unformatted. You must format and mount a disk before it
can be used. You can find instructions on how to do this at:

https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting

Your Jenkins password is xyz123
namespace "jenkins" created
secret "jenkins" created
deployment "jenkins" created
service "jenkins-ui" created
service "jenkins-discovery" created
Generating a 2048 bit RSA private key
...........................+++
.....+++
writing new private key to '/tmp/tls.key'
-----
secret "tls" created
ingress "jenkins" created
~/workspaces/kube-jenkins-imager
done.
All resources deployed.
In a few minutes your loadBalancer will finish provisioning. You can run the following to get its IP address:
   kubectl get ingress jenkins --namespace jenkins -o "jsonpath={.status.loadBalancer.ingress[0].ip}";echo
craigruks commented 7 years ago

I ran into this same problem and figured out what is going on. The cluster-up.sh script checks out the GoogleCloudPlatform/continuous-deployment-on-kubernetes repository, and then modifies the jenkins/k8s/options within it. If you run cluster-up.sh again, it won't be able to modify that options file again unless you reset it. From within your repository folder, try running this before you run cluster.sh to reset the effected file:

cd continuous-deployment-on-kubernetes && git checkout jenkins/k8s/options && cd ../

Hope this helps!

m8ttyB commented 7 years ago

@craigruks thank you mightily. That's perfect!