Get started

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Tekton as the underlying pipeline engine.

 

Step 1: Provision your Kubernetes Cluster

Provisioning your Kubernetes cluster is easy. Jenkins X does not really care how you provision your cluster, however there are many resources that are provisioned, so we recommend using the Terraform modules we've made available. Prerequisite for using them is an installed terraform binary. You can find the installation instructions here.

 

1. Create a main.tf file in an empty directory and add the code snippet below. You will need to provide the GCP project id in which to install the cluster.

module "jx" {
  source = "jenkins-x/jx/google"

  gcp_project = "<my-gcp-project-id>"
}

output "jx_requirements" {
  value = module.jx.jx_requirements
}

This setup uses defaults parameters. For more details instructions on how to provision a Kubernetes cluster with the GKE Terraform module refer to the GKE terraform module.

2. Provision the cluster using Terraform.

terraform init
terraform apply

1. Create a main.tf file in an empty directory and add the code snippet below.

module "eks-jx" {
  source  = "jenkins-x/eks-jx/aws"
}

output "jx_requirements" {
  value = module.eks-jx.jx_requirements
}

output "vault_user_id" {
  value       = module.eks-jx.vault_user_id
  description = "The Vault IAM user id"
}

output "vault_user_secret" {
  value       = module.eks-jx.vault_user_secret
  description = "The Vault IAM user secret"
}

This setup uses defaults parameters. For more details instructions on how to provision a Kubernetes cluster with the EKS Terraform module refer to the EKS terraform module.

2. Provision the cluster using Terraform.

terraform init
terraform apply

export VAULT_AWS_ACCESS_KEY_ID=$(terraform output vault_user_id)
export VAULT_AWS_SECRET_ACCESS_KEY=$(terraform output vault_user_secret)

 

 

Step 2: Install the Jenkins X CLI

The next step is installing the Jenkins X binary jx for your operating system.

Using Homebrew

brew install jenkins-x/jx/jx

Using Curl

# Download the `.tar` file, unarchive it.
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent https://api.github.com/repos/jenkins-x/jx/releases/latest | jq -r '.tag_name')/jx-darwin-amd64.tar.gz" | tar xzv "jx"

# Add `jx` to your path
sudo mv jx /usr/local/bin

# verify installation
jx version --short
 
# Download the `.tar` file, and unarchive it in a directory where you can run the `jx` command.
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent "https://github.com/jenkins-x/jx/releases/latest" | sed 's#.*tag/\(.*\)\".*#\1#')/jx-linux-amd64.tar.gz" | tar xzv "jx"

# Move binary to your path
sudo mv jx /usr/local/bin

# verify installation
jx version --short
 

Using Chocolatey

1. Right-click menu:Start\[Command Prompt (Admin)\].

2. At the shell prompt, execute a `powershell.exe` command to download and install the `choco` binary and set the installation path so that the binary can be executed:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile `
-InputFormat None -ExecutionPolicy Bypass `
-Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" `
&& SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
3. Install Jenkins X using Chocolatey:
choco install jenkins-x

 

 

 

Step 3: Install Jenkins X on your cluster

You have provisioned your Kubernetes cluster and installed the jx CLI. Now you are ready to install Jenkins X into the cluster. To do that, you will use the jx boot command. For more details around JX Boot refer to the Run Boot section.

In an empty directory run:

terraform output jx_requirements > <some_empty_dir>/jx-requirements.yml
cd <some_empty_dir>
jx boot --requirements jx-requirements.yml