{"id":39542,"date":"2026-11-27T22:05:37","date_gmt":"2026-11-27T22:05:37","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=39542"},"modified":"2026-11-27T22:05:37","modified_gmt":"2026-11-27T22:05:37","slug":"how-to-setup-jenkins-x-using-aws-eks","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-setup-jenkins-x-using-aws-eks\/","title":{"rendered":"How to Setup Jenkins X using AWS EKS?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Jenkins X v3 runs on Amazon EKS in two parts. Terraform (the <code>jx3-terraform-eks<\/code> 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 <code>jx3-eks-vault<\/code>. 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&#039;re done.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/ba2d1e219a8df16bc4205f7f2c8d76c4.js\"><\/script>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How the Jenkins X on EKS setup fits together<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Jenkins X v3 uses GitOps. You don&#039;t install it with a single command. You keep two Git repositories, and each has its own job:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Repository<\/th><th>Created from<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td>Infrastructure repo<\/td><td><code>jx3-gitops-repositories\/jx3-terraform-eks<\/code><\/td><td>Terraform code that creates the VPC, EKS cluster, IAM roles and supporting AWS resources, then installs the git operator<\/td><\/tr><tr><td>Cluster repo<\/td><td><code>jx3-gitops-repositories\/jx3-eks-vault<\/code> (Vault) or <code>jx3-eks-asm<\/code> (AWS Secrets Manager)<\/td><td>Helmfile-based description of everything Jenkins X runs in the cluster. The git operator applies it on every commit<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Terraform receives the cluster repo URL as <code>jx_git_url<\/code>. When <code>terraform apply<\/code> finishes, the git operator clones that repo and starts a boot job. The cluster repo therefore has to exist and contain the template content <strong>before<\/strong> you run Terraform. The checklist above clones <code>jx3-eks-vault<\/code> as its last step, which is too late.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites and tool checks<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Install Git, Terraform, the AWS CLI v2, <code>kubectl<\/code> and the <code>jx<\/code> CLI. The checklist above leaves out <code>kubectl<\/code>, 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:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">git --version\nterraform version\naws --version\nkubectl version --client\njx version\nhelm version   <span class=\"hljs-comment\"># optional<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configure AWS credentials<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Step 7 above (&quot;Configure AWS&quot;) 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.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">aws configure            <span class=\"hljs-comment\"># or: aws configure sso<\/span>\naws sts get-caller-identity\n<span class=\"hljs-comment\"># Expected: JSON with your Account, UserId and Arn<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> 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).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create the bot token and the cluster repository<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to GitHub as the bot user and create a personal access token. At minimum it needs the <code>repo<\/code> scope and <code>admin:repo_hook<\/code> so Jenkins X can create webhooks. Check the Jenkins X EKS documentation for the current full list of scopes.<\/li>\n\n\n<li>Store the token in a password manager. Never paste it into a README, gist, blog post or committed file.<\/li>\n\n\n<li>Create the cluster repo <strong>from the template<\/strong>, not as an empty repo. On GitHub, open <code>jx3-gitops-repositories\/jx3-eks-vault<\/code> and click <strong>Use this template<\/strong>, or use the GitHub CLI as shown below.<\/li>\n\n\n<li>Give the bot user write access to the new repository.<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">gh repo create my-org\/jx3-cluster-repo \\\n  --template jx3-gitops-repositories\/jx3-eks-vault \\\n  --<span class=\"hljs-keyword\">private<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If you prefer AWS Secrets Manager to an in-cluster Vault, use <code>jx3-eks-asm<\/code> as the template. The Terraform configuration must use the same secrets backend, so check the secrets-related variables in <code>variables.tf<\/code> of the infrastructure repo before you apply.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Provision EKS and Jenkins X with Terraform<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create your own infrastructure repo from the <code>jx3-terraform-eks<\/code> template so you can version your changes, then clone it. Put the non-secret variables in a <code>terraform.tfvars<\/code> file. Terraform loads this file automatically, so you don&#039;t have to repeat long <code>-var<\/code> flags on every command.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">git <span class=\"hljs-keyword\">clone<\/span> https:<span class=\"hljs-comment\">\/\/github.com\/my-org\/jx3-terraform-eks.git<\/span>\ncd jx3-terraform-eks\n\ncat &gt; terraform.tfvars &lt;&lt;<span class=\"hljs-string\">'EOF'<\/span>\nregion          = <span class=\"hljs-string\">\"us-east-1\"<\/span>\ncluster_version = <span class=\"hljs-string\">\"&lt;a version EKS currently supports&gt;\"<\/span>\njx_git_url      = <span class=\"hljs-string\">\"https:\/\/github.com\/my-org\/jx3-cluster-repo\"<\/span>\njx_bot_username = <span class=\"hljs-string\">\"my-jx-bot\"<\/span>\nEOF<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><code>cluster_version = 1.20<\/code> 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&#039;t read <code>1.30<\/code> as the number <code>1.3<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pass the bot token through an environment variable so it never ends up in a file. The syntax depends on your shell:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Linux \/ macOS (bash, zsh)<\/span>\nexport TF_VAR_jx_bot_token=<span class=\"hljs-string\">'&lt;your-bot-token&gt;'<\/span>\n\n<span class=\"hljs-comment\"># Windows PowerShell<\/span>\n$env:TF_VAR_jx_bot_token = <span class=\"hljs-string\">'&lt;your-bot-token&gt;'<\/span>\n\n<span class=\"hljs-comment\"># Windows cmd.exe<\/span>\nset TF_VAR_jx_bot_token=&lt;your-bot-token&gt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">terraform init\nterraform plan -out tfplan\nterraform apply tfplan<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Saving the plan to a file means <code>apply<\/code> makes exactly the changes you reviewed. Creating the cluster usually takes a while, mostly waiting for the EKS control plane and node groups. Keep <code>terraform.tfstate<\/code> safe and out of Git, because it contains sensitive values. For anything beyond a lab, use a remote backend such as S3.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Connect to the cluster and verify the Jenkins X boot<\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">terraform output                       <span class=\"hljs-comment\"># shows cluster name and other outputs<\/span>\naws eks update-kubeconfig --region us-east<span class=\"hljs-number\">-1<\/span> --name &lt;cluster-name&gt;\nkubectl get nodes\n\n<span class=\"hljs-comment\"># Follow the git operator boot job until it completes<\/span>\njx admin log\n\n<span class=\"hljs-comment\"># Check the Jenkins X components<\/span>\nkubectl get pods -n jx\nkubectl get pods -A | grep -v Running<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><code>jx admin log<\/code> 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 <code>kubectl<\/code> or <code>helm<\/code> on your workstation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Symptom<\/th><th>Likely cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>terraform apply<\/code> fails with an unsupported Kubernetes version<\/td><td><code>cluster_version<\/code> is end-of-life on EKS (for example 1.20)<\/td><td>Set a currently supported version in <code>terraform.tfvars<\/code><\/td><\/tr><tr><td>Boot job fails right away or <code>jx admin log<\/code> shows clone or auth errors<\/td><td>Cluster repo is empty, wrong URL, or the bot cannot access it<\/td><td>Create the repo from the <code>jx3-eks-vault<\/code>\/<code>jx3-eks-asm<\/code> template, check <code>jx_git_url<\/code> and give the bot write access<\/td><\/tr><tr><td>Webhook or 401\/403 errors from GitHub<\/td><td>Token missing scopes, expired or revoked<\/td><td>Create a new token with the required scopes, update <code>TF_VAR_jx_bot_token<\/code> and apply again<\/td><\/tr><tr><td>Secrets not populated, pods stuck waiting for secrets<\/td><td>Terraform secrets backend does not match the cluster repo template<\/td><td>Use matching settings (Vault with <code>jx3-eks-vault<\/code>, ASM with <code>jx3-eks-asm<\/code>)<\/td><\/tr><tr><td><code>terraform destroy<\/code> hangs on VPC or subnet deletion<\/td><td>A load balancer created by an in-cluster Service still exists<\/td><td>Delete LoadBalancer Services first, then destroy again<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For application-level failures after Jenkins X is running, the <a href=\"https:\/\/www.devopsschool.com\/blog\/troubleshooting-guide-to-resolving-500-errors-in-kubernetes-production-environments\/\">Kubernetes 500 errors troubleshooting guide<\/a> covers a general debugging approach.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Clean up the environment<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Kubernetes creates load balancers outside Terraform&#039;s state. Remove them first, otherwise the VPC can&#039;t be deleted. Then destroy the infrastructure, using the same variables and token you applied with.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">kubectl get svc -A | grep LoadBalancer\nkubectl delete svc <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">name<\/span>&gt;<\/span> -n <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">namespace<\/span>&gt;<\/span>   # for each one listed\n\nterraform destroy<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need to create the cluster repository before running Terraform?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Terraform installs the git operator, which boots Jenkins X from the repository in <code>jx_git_url<\/code>. That repository must already contain the content of the <code>jx3-eks-vault<\/code> or <code>jx3-eks-asm<\/code> template.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Should I choose Vault or AWS Secrets Manager for Jenkins X on EKS?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Vault (<code>jx3-eks-vault<\/code>) runs a secrets store inside the cluster. AWS Secrets Manager (<code>jx3-eks-asm<\/code>) uses a managed AWS service, so there is less to operate. Either works, as long as the Terraform configuration uses the same backend.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Which Kubernetes version should I use for EKS with Jenkins X?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use a version that Amazon EKS currently supports and that the <code>jx3-terraform-eks<\/code> module accepts. Older values such as 1.20 are rejected because EKS no longer supports them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I pass the GitHub bot token to Terraform on Windows?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In PowerShell, run <code>$env:TF_VAR_jx_bot_token = &#039;&lt;token&gt;&#039;<\/code>. In cmd.exe, run <code>set TF_VAR_jx_bot_token=&lt;token&gt;<\/code>. A bare <code>TF_VAR_jx_bot_token=...<\/code> line does not work on Windows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I remove Jenkins X and the EKS cluster completely?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Delete any Kubernetes Services of type LoadBalancer, then run <code>terraform destroy<\/code> from the infrastructure repo with the same variables. Finally, revoke the bot token in GitHub.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/devops\/jenkins\/\">More Jenkins tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/containers-kubernetes\/kubernetes\/\">More Kubernetes tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/troubleshooting-guide-to-resolving-500-errors-in-kubernetes-production-environments\/\">Troubleshooting Guide to Resolving 500 Errors in Kubernetes Production Environments<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/top-50-jenkins-interview-questions-and-answers\/\">Top Jenkins interview questions and answers<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[42,4859],"tags":[4987],"class_list":["post-39542","post","type-post","status-publish","format-standard","hentry","category-jenkins","category-kubernetes","tag-amazon-eks"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/39542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=39542"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/39542\/revisions"}],"predecessor-version":[{"id":80382,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/39542\/revisions\/80382"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=39542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=39542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=39542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}