Jenkins X v3 runs on Amazon EKS in two parts. Terraform (the jx3-terraform-eks repository) creates the EKS cluster and installs the Jenkins X git operator. The operator then installs everything else from a cluster Git repository that you create from a template such as jx3-eks-vault. This page fills in the checklist above with the commands to run, the correct order of steps, how to check the boot worked, how to fix common failures and how to delete everything when you're done.
How the Jenkins X on EKS setup fits together
Jenkins X v3 uses GitOps. You don't install it with a single command. You keep two Git repositories, and each has its own job:
| Repository | Created from | Purpose |
|---|---|---|
| Infrastructure repo | jx3-gitops-repositories/jx3-terraform-eks | Terraform code that creates the VPC, EKS cluster, IAM roles and supporting AWS resources, then installs the git operator |
| Cluster repo | jx3-gitops-repositories/jx3-eks-vault (Vault) or jx3-eks-asm (AWS Secrets Manager) | Helmfile-based description of everything Jenkins X runs in the cluster. The git operator applies it on every commit |
Terraform receives the cluster repo URL as jx_git_url. When terraform apply finishes, the git operator clones that repo and starts a boot job. The cluster repo therefore has to exist and contain the template content before you run Terraform. The checklist above clones jx3-eks-vault as its last step, which is too late.
Prerequisites and tool checks
Install Git, Terraform, the AWS CLI v2, kubectl and the jx CLI. The checklist above leaves out kubectl, but you need it to inspect the cluster. Helm is optional on your workstation, because Jenkins X runs helmfile inside the cluster. Check each tool:
git --version
terraform version
aws --version
kubectl version --client
jx version
helm version # optionalCode language: PHP (php)
You also need a GitHub account or organisation for the two repositories, and a separate GitHub user to act as the Jenkins X bot. The bot needs write access to the cluster repo and to any application repos Jenkins X will build.
Configure AWS credentials
Step 7 above ("Configure AWS") has no instructions. Terraform reads the same credentials as the AWS CLI. The IAM identity must be allowed to create VPCs, EKS clusters, IAM roles and policies, S3 buckets and related resources, so use an administrator-level role in a sandbox account for a first install.
aws configure # or: aws configure sso
aws sts get-caller-identity
# Expected: JSON with your Account, UserId and ArnCode language: PHP (php)
Note: Running an EKS control plane, worker nodes, NAT gateways and load balancers costs money every hour. Delete the environment when you finish the lab (see the cleanup section below).
Create the bot token and the cluster repository
- Log in to GitHub as the bot user and create a personal access token. At minimum it needs the
reposcope andadmin:repo_hookso Jenkins X can create webhooks. Check the Jenkins X EKS documentation for the current full list of scopes. - Store the token in a password manager. Never paste it into a README, gist, blog post or committed file.
- Create the cluster repo from the template, not as an empty repo. On GitHub, open
jx3-gitops-repositories/jx3-eks-vaultand click Use this template, or use the GitHub CLI as shown below. - Give the bot user write access to the new repository.
gh repo create my-org/jx3-cluster-repo \
--template jx3-gitops-repositories/jx3-eks-vault \
--privateCode language: PHP (php)
If you prefer AWS Secrets Manager to an in-cluster Vault, use jx3-eks-asm as the template. The Terraform configuration must use the same secrets backend, so check the secrets-related variables in variables.tf of the infrastructure repo before you apply.
Provision EKS and Jenkins X with Terraform
Create your own infrastructure repo from the jx3-terraform-eks template so you can version your changes, then clone it. Put the non-secret variables in a terraform.tfvars file. Terraform loads this file automatically, so you don't have to repeat long -var flags on every command.
git clone https://github.com/my-org/jx3-terraform-eks.git
cd jx3-terraform-eks
cat > terraform.tfvars <<'EOF'
region = "us-east-1"
cluster_version = "<a version EKS currently supports>"
jx_git_url = "https://github.com/my-org/jx3-cluster-repo"
jx_bot_username = "my-jx-bot"
EOFCode language: PHP (php)
cluster_version = 1.20 in the original no longer works: EKS has dropped support for 1.20, and the API will reject new clusters at that version. Pick a version from the Amazon EKS supported versions list that the Terraform module also supports. Write it as a quoted string so Terraform doesn't read 1.30 as the number 1.3.
Pass the bot token through an environment variable so it never ends up in a file. The syntax depends on your shell:
# Linux / macOS (bash, zsh)
export TF_VAR_jx_bot_token='<your-bot-token>'
# Windows PowerShell
$env:TF_VAR_jx_bot_token = '<your-bot-token>'
# Windows cmd.exe
set TF_VAR_jx_bot_token=<your-bot-token>Code language: PHP (php)
terraform init
terraform plan -out tfplan
terraform apply tfplan
Saving the plan to a file means apply makes exactly the changes you reviewed. Creating the cluster usually takes a while, mostly waiting for the EKS control plane and node groups. Keep terraform.tfstate safe and out of Git, because it contains sensitive values. For anything beyond a lab, use a remote backend such as S3.
Connect to the cluster and verify the Jenkins X boot
terraform output # shows cluster name and other outputs
aws eks update-kubeconfig --region us-east-1 --name <cluster-name>
kubectl get nodes
# Follow the git operator boot job until it completes
jx admin log
# Check the Jenkins X components
kubectl get pods -n jx
kubectl get pods -A | grep -v RunningCode language: PHP (php)
jx admin log streams the boot job that the git operator runs against your cluster repo. A successful boot finishes without errors. You will also see new commits from the bot in the cluster repo, because Jenkins X writes generated configuration back to Git. After the boot, every change to the cluster (adding a repo, changing a chart value) is made as a commit to the cluster repo, not with kubectl or helm on your workstation.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
terraform apply fails with an unsupported Kubernetes version | cluster_version is end-of-life on EKS (for example 1.20) | Set a currently supported version in terraform.tfvars |
Boot job fails right away or jx admin log shows clone or auth errors | Cluster repo is empty, wrong URL, or the bot cannot access it | Create the repo from the jx3-eks-vault/jx3-eks-asm template, check jx_git_url and give the bot write access |
| Webhook or 401/403 errors from GitHub | Token missing scopes, expired or revoked | Create a new token with the required scopes, update TF_VAR_jx_bot_token and apply again |
| Secrets not populated, pods stuck waiting for secrets | Terraform secrets backend does not match the cluster repo template | Use matching settings (Vault with jx3-eks-vault, ASM with jx3-eks-asm) |
terraform destroy hangs on VPC or subnet deletion | A load balancer created by an in-cluster Service still exists | Delete LoadBalancer Services first, then destroy again |
For application-level failures after Jenkins X is running, the Kubernetes 500 errors troubleshooting guide covers a general debugging approach.
Clean up the environment
Kubernetes creates load balancers outside Terraform's state. Remove them first, otherwise the VPC can't be deleted. Then destroy the infrastructure, using the same variables and token you applied with.
kubectl get svc -A | grep LoadBalancer
kubectl delete svc <name> -n <namespace> # for each one listed
terraform destroyCode language: HTML, XML (xml)
Note: Revoke the bot token in GitHub when you tear down a lab environment. Any token that has ever appeared in public content must be revoked right away, not just deleted from the page.
Frequently asked questions
Do I need to create the cluster repository before running Terraform?
Yes. Terraform installs the git operator, which boots Jenkins X from the repository in jx_git_url. That repository must already contain the content of the jx3-eks-vault or jx3-eks-asm template.
Should I choose Vault or AWS Secrets Manager for Jenkins X on EKS?
Vault (jx3-eks-vault) runs a secrets store inside the cluster. AWS Secrets Manager (jx3-eks-asm) uses a managed AWS service, so there is less to operate. Either works, as long as the Terraform configuration uses the same backend.
Which Kubernetes version should I use for EKS with Jenkins X?
Use a version that Amazon EKS currently supports and that the jx3-terraform-eks module accepts. Older values such as 1.20 are rejected because EKS no longer supports them.
How do I pass the GitHub bot token to Terraform on Windows?
In PowerShell, run $env:TF_VAR_jx_bot_token = '<token>'. In cmd.exe, run set TF_VAR_jx_bot_token=<token>. A bare TF_VAR_jx_bot_token=... line does not work on Windows.
How do I remove Jenkins X and the EKS cluster completely?
Delete any Kubernetes Services of type LoadBalancer, then run terraform destroy from the infrastructure repo with the same variables. Finally, revoke the bot token in GitHub.
Related tutorials
- More Jenkins tutorials
- More Kubernetes tutorials
- Troubleshooting Guide to Resolving 500 Errors in Kubernetes Production Environments
- Top Jenkins interview questions and answers
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals