Questions on setting up Jenkins in GKE

5/6/2019

I am setting up Jenkins in GKE using stable helm chart(https://github.com/helm/charts/tree/master/stable/jenkins) as discussed in https://cloud.google.com/solutions/jenkins-on-kubernetes-engine-tutorial

I am a beginner in kubernetes/GKE, and want to know how the following things can be achieved:

  1. I want the $JENKINS_HOME data to be accessible even when I bring a new GKE cluster up and deploy jenkins there. I will need NFS server for this. Is Cloud Filestore a good choice or should I create an NFS server on my own?
  2. How do we achieve HA for Jenkins master pod?
  3. Should I keep the Jenkins ServiceType as LoadBalancer or should I use Ingress Controller and define Jenkins service as ClusterIP instead. What are advantages of one over the other?
-- Girish
google-kubernetes-engine
jenkins
kubernetes
kubernetes-helm

1 Answer

5/6/2019
  1. Filestore should be fine. You can use static PersistentVolumes or use dynamic provisioning like that. I guess in case of Jenkins you want static volume like that.

  2. I don't think you need HA for Jenkins pod other than what's already provided by Kubernetes. In case of problems with node Jenkins pod will be started on another machine. I guess 1-2 minutes of very rare downtime for Jenkins is not so critical.

  3. You'd better use Ingress because this allows you to reuse the same Load Balancer (which costs money) for other services. Also I would recommend using Nginx Ingress as an Ingress Controller because it is highly configurable. GKE Ingress is not very flexible, actually it is not flexible at all. You should use GKE Ingress only if you want to make use of Google Global Load Balancing, e.g. place your service in multiple regions.

-- Vasily Angapov
Source: StackOverflow