This page covers a local Jenkins X v3 lab: a single-node k3s cluster with HashiCorp Vault for secrets, followed by the Jenkins X git operator. The commands above prepare k3s and Vault, and the sections below correct a few problems in them, show how to check that each part works, and add the steps that actually install Jenkins X.
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=v1.24 sh -s - --write-kubeconfig-mode 644
mkdir ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/k3s-config
# Set it also in the bashrc or zshrc file, or you can flatten both of these configs into a single file
export KUBECONFIG=~/.kube/config:~/.kube/k3s-config
vi ~/.bashrc
#go to the end of the file and paste the export command
export KUBECONFIG=~/.kube/config:~/.kube/k3s-config
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm repo add jxgh https://jenkins-x-charts.github.io/repo
helm repo update
helm install vault-operator banzaicloud-stable/vault-operator --create-namespace -n jx-vault
helm install vault-instance jxgh/vault-instance -n jx-vault
Code language: PHP (php)
What the commands above do
Jenkins X v3 uses GitOps. You don't run a one-shot installer. Instead, a cluster git repository describes everything Jenkins X should install, and a git operator inside the cluster applies it. Before that can happen, the cluster needs a secret backend. On a local or on-premises cluster, that backend is usually Vault, run by the Bank-Vaults Vault operator. That is what the example above sets up.
| Command | Purpose |
|---|---|
curl -sfL https://get.k3s.io | ... sh -s - | Installs k3s, a lightweight single-binary Kubernetes distribution, as a systemd service |
--write-kubeconfig-mode 644 | Lets non-root users read /etc/rancher/k3s/k3s.yaml |
export KUBECONFIG=... | Merges your existing kubeconfig with the k3s one so kubectl and helm can reach the cluster |
helm install vault-operator | Installs the operator that creates and manages Vault instances |
helm install vault-instance | Creates a Vault custom resource in jx-vault. Jenkins X reads and writes its secrets there through External Secrets |
Prerequisites
- A Linux VM or machine with root access. For a lab, 4 vCPUs and 8 GB RAM or more is a sensible minimum, because Jenkins X runs Tekton, Lighthouse, ingress-nginx, Vault and other components together.
- Helm 3.8 or later (needed for OCI chart registries), plus
curl,gitandjq. - A GitHub account, or another supported git provider, and a personal access token with repo scope. A dedicated bot account is better than your personal one.
- Inbound access to ports 80 and 443 on the node if webhooks from your git provider must reach the cluster.
Corrected k3s and Vault commands
This version fixes the problems in the example above. Each change is explained after the code.
# 1. Install k3s (pick a currently supported channel; v1.24 is end-of-life)
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=stable sh -s - --write-kubeconfig-mode 644
# 2. Copy the kubeconfig and make it owned by your user
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/k3s-config
sudo chown "$USER":"$USER" ~/.kube/k3s-config
chmod 600 ~/.kube/k3s-config
# 3. Make KUBECONFIG permanent without opening an editor
echo 'export KUBECONFIG=~/.kube/config:~/.kube/k3s-config' >> ~/.bashrc
source ~/.bashrc
# 4. Switch to the k3s context (k3s names it "default")
kubectl config use-context default
kubectl get nodes
# 5. Install the Vault operator from the Bank-Vaults OCI registry
helm upgrade --install vault-operator \
oci://ghcr.io/bank-vaults/helm-charts/vault-operator \
--namespace jx-vault --create-namespace
# 6. Install the Jenkins X Vault instance
helm repo add jxgh https://jenkins-x-charts.github.io/repo
helm repo update
helm upgrade --install vault-instance jxgh/vault-instance --namespace jx-vaultCode language: PHP (php)
mkdir -p: plainmkdir ~/.kubefails with "File exists" on any machine that already has a kubeconfig.chownandchmod:sudo cpcreates a root-owned copy. Changing ownership lets your user manage the file, and600keeps the cluster admin credentials private.use-context default: when several kubeconfig files are merged,current-contextcomes from the first file that sets it. If~/.kube/configalready points at another cluster, your Helm installs land on that cluster instead of k3s.- Bank-Vaults OCI chart: Banzai Cloud's chart repository at
kubernetes-charts.banzaicloud.comis deprecated. The Vault operator now lives in the Bank-Vaults project and is published as an OCI chart. helm upgrade --install: you can safely re-run it. A plainhelm installfails if the release already exists.
Note: Check the Jenkins X documentation for the Kubernetes versions it currently supports before you pick a k3s channel. You can pin a specific minor channel (for example INSTALL_K3S_CHANNEL=v1.30) if the docs require one, but avoid channels that are past upstream end-of-life.
Verify k3s and Vault
kubectl get nodes
kubectl get pods -n jx-vault
kubectl get vault -n jx-vaultCode language: JavaScript (javascript)
The node should be Ready. In jx-vault you should see the operator pod and a vault-0 pod. Vault pods often take a minute or two to start while the operator initialises and unseals the instance.
NAME READY STATUS RESTARTS AGE
vault-0 3/3 Running 0 2m
vault-configurer-xxxxxxxxx-xxxxx 1/1 Running 0 2m
vault-operator-xxxxxxxxx-xxxxx 1/1 Running 0 3m
Pod names and container counts depend on chart versions. What matters is that everything reaches Running and stops restarting.
Complete the Jenkins X installation
The example above stops once Vault is running, but Jenkins X itself is not installed yet. These steps finish the job.
- Install the
jxCLI (see the code block below) and runjx versionto confirm it works. - Create your cluster git repository from the k3s/Vault template in the
jx3-gitops-repositoriesGitHub organization (it was namedjx3-k3s-vaultwhen this was written). Use the template's Use this template button, then clone your new repository locally. - Edit
jx-requirements.ymlin the repository. Setcluster.clusterName, your git owner, andingress.domain. On a lab node with no DNS, a wildcard service such as<NODE_IP>.nip.ioworks. KeepsecretStorage: vault. Commit and push. - From inside the cloned repository, run
jx admin operator --username <git-user> --token <git-token>. This installs the git operator in thejx-git-operatornamespace, stores the git credentials, and starts the first boot job. - Watch the boot job with
jx admin log -w. It runs the helmfile in your repository and installs Tekton, Lighthouse, ingress-nginx and the other components. The first run can take several minutes. - Confirm the result with
kubectl get pods -n jxandjx ns jx. Then create or import a project withjx project quickstartorjx project import.
# Install the latest jx CLI on Linux amd64
JX_VERSION=$(curl -s https://api.github.com/repos/jenkins-x/jx/releases/latest | jq -r '.tag_name')
curl -L "https://github.com/jenkins-x/jx/releases/download/${JX_VERSION}/jx-linux-amd64.tar.gz" | tar xzv jx
sudo mv jx /usr/local/bin/
jx versionCode language: PHP (php)
Note: After this, change the cluster through git, not with kubectl or helm. Each push to the cluster repository triggers a new boot job, so manual changes get overwritten.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
The connection to the server localhost:8080 was refused | KUBECONFIG is not set in the current shell | Run source ~/.bashrc or export the variable again |
| Helm installs go to the wrong cluster | Merged kubeconfig uses another current-context | kubectl config use-context default |
Helm cannot fetch the index from kubernetes-charts.banzaicloud.com | Deprecated Banzai Cloud repository | Use the oci://ghcr.io/bank-vaults/helm-charts/vault-operator chart |
vault-0 stuck in Pending | No storage or not enough CPU/memory | Check kubectl describe pod vault-0 -n jx-vault. k3s ships the local-path StorageClass, so make sure it is the default |
| ingress-nginx service shows no external IP | k3s's bundled Traefik already holds ports 80 and 443 | Reinstall k3s with --disable traefik so ingress-nginx can bind those ports |
| Boot job fails on secrets | External Secrets cannot reach Vault | Make sure the Vault pods are healthy in jx-vault, then use jx admin log -w to see which step fails |
Security and production notes
- A single-node k3s cluster with a Vault instance on local storage is for labs only. If the node dies, you lose Vault's data and every pipeline secret with it.
--write-kubeconfig-mode 644makes cluster admin credentials readable by every local user. Only use it on a machine you control alone.- Give the git bot token the narrowest scopes Jenkins X needs, and rotate it. It is stored in the cluster and has write access to your repositories.
- Check the Jenkins X project's current release activity and maintenance status before you adopt it for production. Also compare it with alternatives such as Tekton on its own or Argo CD with a separate CI system.
- For more general cluster debugging, see the Kubernetes troubleshooting guide.
Frequently asked questions
Is Jenkins X the same as Jenkins?
No. Jenkins X is a separate project for CI/CD on Kubernetes, built on Tekton pipelines, Lighthouse for git webhooks, and GitOps. It does not run a classic Jenkins controller.
Do I need Vault to run Jenkins X?
Jenkins X v3 needs a secret backend for External Secrets. On cloud providers this can be the provider's own secret manager. On local and on-premises clusters such as k3s, Vault is the usual choice.
Why does Jenkins X need a git repository to install?
Jenkins X v3 is installed and upgraded through GitOps. The git operator watches your cluster repository and runs a boot job each time it changes, so the repository is the single source of truth for the installation.
How do I uninstall k3s after the lab?
Run /usr/local/bin/k3s-uninstall.sh on a server node. It stops the service and removes k3s, its data and its kubeconfig from /etc/rancher/k3s.
Can I use minikube or kind instead of k3s?
Jenkins X provides templates for other local clusters, such as minikube. The overall flow is the same: install the secret backend, create the cluster repository from the matching template, then run jx admin operator.
Related tutorials
- More Jenkins tutorials
- More Kubernetes tutorials
- Troubleshooting Guide to Resolving 500 Errors in Kubernetes Production Environments
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
I like how this post explains Jenkins X installation and configuration in a clear and simple way. The stepโbyโstep instructions make it easier to follow, especially for someone new to Jenkins X. Thanks for the helpful guide!