MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Jenkins X Tutorials: Install and Configurations

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.

CommandPurpose
curl -sfL https://get.k3s.io | ... sh -s -Installs k3s, a lightweight single-binary Kubernetes distribution, as a systemd service
--write-kubeconfig-mode 644Lets 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-operatorInstalls the operator that creates and manages Vault instances
helm install vault-instanceCreates 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, git and jq.
  • 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: plain mkdir ~/.kube fails with "File exists" on any machine that already has a kubeconfig.
  • chown and chmod: sudo cp creates a root-owned copy. Changing ownership lets your user manage the file, and 600 keeps the cluster admin credentials private.
  • use-context default: when several kubeconfig files are merged, current-context comes from the first file that sets it. If ~/.kube/config already 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.com is 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 plain helm install fails 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.

  1. Install the jx CLI (see the code block below) and run jx version to confirm it works.
  2. Create your cluster git repository from the k3s/Vault template in the jx3-gitops-repositories GitHub organization (it was named jx3-k3s-vault when this was written). Use the template's Use this template button, then clone your new repository locally.
  3. Edit jx-requirements.yml in the repository. Set cluster.clusterName, your git owner, and ingress.domain. On a lab node with no DNS, a wildcard service such as <NODE_IP>.nip.io works. Keep secretStorage: vault. Commit and push.
  4. From inside the cloned repository, run jx admin operator --username <git-user> --token <git-token>. This installs the git operator in the jx-git-operator namespace, stores the git credentials, and starts the first boot job.
  5. 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.
  6. Confirm the result with kubectl get pods -n jx and jx ns jx. Then create or import a project with jx project quickstart or jx 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

SymptomLikely causeFix
The connection to the server localhost:8080 was refusedKUBECONFIG is not set in the current shellRun source ~/.bashrc or export the variable again
Helm installs go to the wrong clusterMerged kubeconfig uses another current-contextkubectl config use-context default
Helm cannot fetch the index from kubernetes-charts.banzaicloud.comDeprecated Banzai Cloud repositoryUse the oci://ghcr.io/bank-vaults/helm-charts/vault-operator chart
vault-0 stuck in PendingNo storage or not enough CPU/memoryCheck 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 IPk3s's bundled Traefik already holds ports 80 and 443Reinstall k3s with --disable traefik so ingress-nginx can bind those ports
Boot job fails on secretsExternal Secrets cannot reach VaultMake 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 644 makes 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

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
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.

Related Posts

Tanzu Command Line Options

The Tanzu CLI is VMware's plugin-based command-line tool for creating and running Kubernetes clusters, installing packages and deploying applications on Tanzu platforms. The output above is the…

Read More

Kubernetes Assignment and Project

This page is a five-day Kubernetes assignment. It starts with architecture and Pods, then moves through ReplicaSets, DaemonSets, Deployments, Services, CoreDNS service discovery and StatefulSets, and ends…

Read More

Jenkins Pipeline code for Sending an email on Build Failure

To get an email when a Jenkins build fails, call the mail step (Mailer plugin) or the emailext step (Email Extension plugin) inside the post { failure…

Read More

Kubernetes Tutorials: Example of StorageClass, PersistentVolume, PersistentVolumeClaim using EBS

This page shows how a StorageClass, a PersistentVolume (PV) and a PersistentVolumeClaim (PVC) work together to give Kubernetes pods persistent Amazon EBS storage. Below the original manifests…

Read More

Jenkins Tutorials: Meaning of $class in scripted pipeline

In a Jenkins Pipeline, $class is a special map key that tells Jenkins which plugin or core class to create when a step or property accepts more…

Read More

Minikube Tutorials: minikube commands

minikube config set memory 10000 sets the default memory for new minikube clusters. It does not resize a cluster that already exists. This page explains how minikube…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Jason Mitchell
Jason Mitchell
8 months ago

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! 

1
0
Would love your thoughts, please comment.x
()
x