How to Install Jenkins X on a Nodeless EKS Cluster

Vilmos Nebehaj
Elotl blog
Published in
3 min readJun 3, 2019

Jenkins X is a next generation CI/CD framework that is designed with cloud applications and Kubernetes in mind.

We already wrote about why a nodeless setup, where pods and containers run without pre-configured worker nodes, is a particulary good fit for CI/CD. Let’s look at how Jenkins X can be installed on a nodeless Kubernetes cluster, running on AWS, using Milpa as its container runtime.

Prerequisites

The recommended way to install Jenkins X is via their command line tool, jx. Download the binary, and make sure it is in your $PATH.

$ jx versionNAME               VERSION
jx 2.0.46
Kubernetes cluster v1.10.13-eks-g484b8
kubectl v1.14.1
helm client Client: v2.13.1+g618447c
git git version 2.11.0
Operating System Debian GNU/Linux 9.7 (stretch)

Jx can create the Kubernetes cluster for you before installing the Jenkins X components on it, but here we will use Terraform to create the EKS cluster, so we can customize the worker to use a nodeless setup with Milpa.

The steps for creating the cluster is the same we’ve already detailed in Nodeless Kubernetes on EKS. Make sure that you have a working cluster and kubeconfig before proceeding:

$ kubectl get nodesNAME                        STATUS   ROLES    AGE   VERSION
ip-10-0-1-90.ec2.internal Ready <none> 36m v1.10.13-01-eks

Once your cluster is ready for Jenkins X to be installed, create a config file for Jenkins X:

$ cat <<EOF > myvalues.yaml
monocular:
api:
resources:
limits:
memory: 2Gi
mongodb:
mongodbDatabase: ""
jenkins:
Master:
Cpu: "2000m"
Memory: "4096Mi"
EOF

Here we override a few parameters in the Helm charts jx uses under the hood to install its components.

Installation

Now install Jenkins X in your new EKS cluster:

$ jx install --provider=eks --default-environment-prefix=elotl-cloudSetting the dev namespace to: jx
Namespace jx created
Using helmBinary helm with feature flag: none[...]

During the install process, jx will ask questions for customizing your setup. One of them is about the wildcard DNS alias that will point at the main Jenkins X load balancer. You can use the free service nip.io for setting this up; check the hostname of the ELB:

$ kubectl get svc -n kube-system jxing-nginx-ingress-controllerNAME                             TYPE           CLUSTER-IP       EXTERNAL-IP                                               PORT(S)                      AGE
jxing-nginx-ingress-controller LoadBalancer 172.20.240.123 a997f8044863e11e9bac50ada54bafa9-15e0bfb8165ab207.elb.us-east-1.amazonaws.com 80:31673/TCP,443:30761/TCP 45m

The IP address:

$ host a997f8044863e11e9bac50ada54bafa9-15e0bfb8165ab207.elb.us-east-1.amazonaws.coma997f8044863e11e9bac50ada54bafa9-15e0bfb8165ab207.elb.us-east-1.amazonaws.com has address 34.235.199.28

Any subdomain with nip.io appended to the IP address will be resolved back to the same IP:

$ host 34.235.199.28.nip.io34.235.199.28.nip.io has address 34.235.199.28

For example, if you configure Jenkins X to use a static Jenkins server, it will be available at http://jenkins.jx.34.235.199.28.nip.io/.

The rest of the questions come with sane defaults, but feel free to customize your setup.

It will take a bit of time for all the images to be downloaded and the the pods to start up. Once jx successfully finishes, the installation is complete and Jenkins X is ready to be used:

Jenkins X installation completed successfully********************************************************NOTE: Your admin password is: 30nmuqHoW9y.EMjaK+1e********************************************************Your Kubernetes context is now set to the namespace: jx
To switch back to your original namespace use: jx namespace jx
Or to use this context/namespace in just one terminal use: jx shell
For help on switching contexts see: https://jenkins-x.io/developing/kube-context/
To import existing projects into Jenkins: jx import
To create a new Spring Boot microservice: jx create spring -d web -d actuator
To create a new microservice from a quickstart: jx create quickstart
Jenkins X with a static Jenkins server

Removing Jenkins X is simple:

$ jx uninstall --context=aws

Note: Milpa currently does not support persistent volumes. Any data saved by pods to a persistent volume will go away when the pod is restarted.

--

--