gmacario / easy-jenkins

Easily deploy a Jenkins CI/CD infrastructure via docker-compose
MIT License
35 stars 9 forks source link

Install Kubernetes plugins #288

Closed gmacario closed 5 years ago

gmacario commented 5 years ago

References:

gmacario commented 5 years ago

Reopening issue as a reminder that I should understand how to configure the plugin to talk to an external Kubernetes cluster - See conversation in #289 for my initial attempts

gmacario commented 5 years ago

Try configuring Jenkins to connect to Kubernetes cluster "kube-101" on GCP

Reference: https://cloud.google.com/solutions/configuring-jenkins-kubernetes-engine

See also: https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md sections

Locally testing on nemo (Ubuntu 18.04.1 LTS 64-bit)

Browse https://console.cloud.google.com > Kubernetes Engine > Clusters

gcloud init
gcloud container clusters list
gcloud container describe kube-101
gcloud container clusters get-credentials kube-101
kubectl config view
kubectl cluster-info
kubectl get namespaces
kubectl create namespace easy-jenkins

Jenkins > Manage Jenkins > Configure System

Click "Test Connection" and make sure that

Connection test successful

Continue configuring Kubernetes Cloud "kube-101"

then click "Save"

gmacario commented 5 years ago

Test:

Jenkins > Open Blue Ocean > New Pipeline

The multibranch pipeline is loaded and started, however the build of branch "feature/kube-declarative-pipeline" never starts

screenshot from 2018-10-05 15-04-22

This situation can also be detected by looking at the Kubernetes dashboard of cluster "kube-101", namespace "easy-jenkins":

screenshot from 2018-10-05 15-09-12

It looks look like that the Pods mypod-kr0c7-xxxx running inside Kubernetes cluster "kube-101" on GCP are unable to connect to our Jenkins master, since the URL http://nemo.gmacario.it:9080 is behind a corporate firewall.

Closing issue, will reopen when we able to test both Jenkins master as well as the slaves deployed on the same Kubernetes cluster, or at least with some capability of communicating to each other.

gmacario commented 5 years ago

Detailed instructions to deploy a Jenkins cluster on Kubernetes posted at https://gmacario.github.io/howto/kubernetes/gcp/jenkins/2018/10/09/install-jenkinsx-on-gcp.html