This blog describes how to Install Jenkins X on AWS EKS cluster
Jenkins X is an open-source tool that automates CI/CD workflow for cloud native apps on Kubernetes. It harnesses the power of Kubernetes and let its users use it without knowing internal working of Kubernetes. Jenkins X is a collection of some of the best of breed tools and microservices like Kubernetes, Tekton, Helm, Lighthouse, Terraform, Octant(UI), Hashicorp Vault, Kaniko, Grafana, Prometheus, kuberhealthy, etc.
Before we proceed, please follow the prerequisites blogs which I wrote earlier AWS-EKS-Cluster and How to create Github organization and bot user accounts.
Jenkins X provides a cluster git repository template for managing Jenkins X configuration. To change anything in your Jenkins X cluster, open a pull request to this repository. Fork this repository to your GitHub organization account by clicking on this link.
The recommended approach to install Jenkins X is via terraform script that is provided by another git repository. Fork this repository into your GitHub organization account via this link.
Now clone this repository into your local and open the project via your favorite IDE.
Open outputs.tf file and modify below parameter vault_user_id:
Also, open the variables.tf file and modify the following parameters:
default: [“192.168.64.0/18”, “192.168.0.0/18”]
default: [“192.168.128.0/18”, “192.168.192.0/18”]
vpc_id: default: (vpc-id-of-eks-cluster)
nginx_chart_version: default: “3.12.0”
Save GitHub bot user token as an environment variable
To initialize terraform
To see potential changes made by Terraform
To execute the install
When prompted for provider.aws.region, enter the AWS region where your EKS cluster is provisioned. If the terraform apply command ran successfully then you will see similar output as below
Note: It can take up to 10 minutes to install Jenkins X.
Verify Jenkins X installation
jx ns jx kubectl get es -A
Check all pods are running in jx namespace
kubectl get pods -n jx
Another command to verify successful Jenkins X installation
jx verify install
To visualize Jenkins X installation and pipelines on UI, run this command. It will automatically open UI in a browser
Verify ingress is working. Replace <hook-jx…> below with the value of hook’s HOSTS.
kubectl get ing -A curl -v http://<hook-jx…>/hook
TIP #1 If kubectl get es -A gives 404 status error, it most likely means that the secret generation step in the boot log did not work. One way to re-generate secrets is by making a direct push to the main branch of the cluster git repo (not by creating a pull request).
To verify successful secret generation, check admin logs using the following command and select the latest log
jx admin log
If ingress controller is not working
curl -v http://<hook-jx…>/hook
does not give a 200 status code then check your ingress controller pod (nexus-nexus-…) is running via kubectl get pods -n jx
Verify this ingress IP is same as Elastic Network Interface (ENI) public IPv4 of the Network Load Balancer (NLB) created during Jenkins X installation.
As you can see how easily we can tweak input variables as per our need in terraform script and run only one command (terraform apply) to create the entire Jenkins X cluster. Now we can import our application git repository to this Jenkins X cluster and can create multiple pipelines.
Use the Feedback tab to make any comments or ask questions. You can also start a conversation with us.