How to setup scalable Jenkins on top of a EKS Cluster with persistent Volumes?

10/6/2019

I'm stuck to setup scalable Jenkins on EKS cluster. I did on Minikube k8s on my local system to handle an additional load using the Jenkins docker slave node. But when I'm trying to set up the same setup on EKS unable to launch a docker slave node to run the job. If anyone does the same things on EKS, please share links, ideas or k8s manifest.

-- Anup
amazon-web-services
eks
high-availability
jenkins
kubernetes

1 Answer

10/6/2019

From your description, I can't understand clearly if you have a Jenkins "master" on EKS installed/configured. Assume you already installed Jenkins via helm or "yaml" and you can access it from UI.

Next step will be to install a plugin in Jenkins, called ‘Kubernetes’. This plugin is designed to implement Jenkins scaling on top of a Kubernetes cluster(Jenkins slaves/nodes).

After you installed the plugin you have to configure it.

Go to: Manage Jenkins -> Configure System -> Cloud -> Kubernetes

Jenkins Slave configuration

  1. Nr.1 is the name of your Pod (you can pick a random name)
  2. Nr.2 is more important and you have to remember this name-label because you will use in your Jenkinsfile to call this pod/slave template.
  3. Nr.3 is the name of the container (by this name you can specify the desired container to use in a specific Jenkinsfile stage.
  4. Nr.4 this container has an image to behave like a Jenkins slave/node (used from dockerhub).

Here is how you call your Pod/slave template in Jenkinsfile:

 agent {
   label "jenkins-slave"
    }

Here is how you call a specific slave/container template into Jenkinsfile:

steps {
   container('jenkins-slave') {
   }
}

For more descriptive steps feel free to Google it "How to install/configure Jenkins slave on EKS" you will get many many articles, such as this: How to install/configure Jenkins slave on EKS

Good luck!

-- Valentin
Source: StackOverflow