I was following Henryk Konsek’s AWS Article to install Jenkins X in an AWS EKS Clustered environment, which really helped me to get started and would like to fill some of the gaps through this post.
As we know, Jenkins X is built on Kubernetes and it’s together with Amazon EKS provide a continuous delivery platform that allows developers to focus on their applications while Jenkins X (JX) is managing Staging and Production GIT repositories and pushing containers to Staging and Production EKS Clusters using those GIT repositories after building and pushing containers to the container registries (ECR).
- Installation Type
When I decided to install JX in EKS, I have a question of whether to install JX in an existing EKS cluster or do I need to create a new one. I did try to install it in an existing EKS cluster, but was unsuccessful and online documentation is not clear on how we can install it in an existing cluster. I did chose to install a new JX EKS cluster then I realised why I was unsuccessful in installing in an existing cluster by comparing differences, one of which is my existing EKS cluster is provisioned with ALB (Application Load Balancer) and JX did provision an NLB (Network Load Balancer) for the internet facing applications.
- Choosing the domain
There are two options available from the above Article,
- Use Route 53 by creating a public hosted zone
- Use nip.io as your local DNS.
but there is a third option if you don’t want to use nip.io when you are using external DNS instead of Route 53. We just need to append “–domain=aplhageek.com” to the “jx install” command. At the end of installation, JX will create a public end point for us as shown below.
? API Token: ********************************** Created user admin API Token for Jenkins server jenkins.jx.alphageek.com at http://jenkins.jx.alphageek.com
JX does also spin up NLB by this time. We just need to point the NLB DNS name to our newly created CNAME for our domain “alphageek.com.” Now we can access the Jenkins URL “http://jenkins.jx.alphageek.com”
- Which GIT Provider to chose ?
Here is the JX’s RoadMap on their features and connectors. GitHub is natively supported by JX. GitLab only supports API Version V4, but JX supports API Version V3 at the moment. BitBucket Cloud is supported, not the Server.
If you are planning to use any GIT provider other than GitHub, you need to configure it after the the JX installation is completed. Follow the doc to integrate other GIT providers with JX.
- JX Installation Steps
- Install the JX Client
- Export AWS Credentials
export AWS_ACCESS_KEY_ID=myAccessId export AWS_SECRET_ACCESS_KEY=mySecret
3. Create JX Cluster
jx create cluster eks --cluster-name=jx-cluster --skip-installation=true
Above command does take some time to return until the cluster is created.
4. Verify the cluster with below commands, versions should be compatible; otherwise, “jx install” in Step 5 might through some errors.
#jx get eks NAME REGION jx-cluster ap-southeast-2 #jx version NAME VERSION jx 2.0.33 jenkins x platform 2.0.120 Kubernetes cluster v1.12.6-eks-d69f1b kubectl v1.14.1 helm client Client: v2.13.1+g618447c git git version 2.21.0
5. Install JX Platform in newly created JX Cluster
jx install --provider=eks --default-environment-prefix=jx-cluster --docker-registry=<ECR Address> --domain=alphageek.com
Note: Append “–no-default-environments” to the above command if you don’t want to use GitHub as your GIT Provider. Follow steps to configure your GIT Provider after the JX Platform installation and after Step 6 is done.
6. Create CNAME in your domain and point NLB to it.