Jenkins X Labs (0.0.100)

Jenkins X Labs is alpha! jxl builds on jx adding support for helm3 along with other enhancements.

In this blog post we're going to take a sneak peak at the extension model for adding services on top of the jx core installation (tekton-pipelines, nexus, chartmuseum and lighthouse) in your CI/CD Kubernetes cluster for overcoming the known limitations of boot.

Jenkins X Apps

The updated GitOps environment repository template now includes a jx-apps.yml in which users specify the apps that the cluster should be bootstrapped with during the jxl boot run:

apps:
- name: stable/nginx-ingress
- name: jenkins-x/jxboot-helmfile-resources
- name: jenkins-x/nexus
- name: jenkins-x/lighthouse
- name: jenkins-x/tekton
- name: jenkins-x/chartmuseum
- name: repositories
  repository: ".."

Note: most of the apps are your typical helm charts, you can fetch the chart and review it's contents i.e.: helm fetch jenkins-x/nexus --untar except for the case of repositories which we'll get back to in a later blog post.

Apps are installed in phases, e.g. the system phase which installs charts / creates the resources which are required during the apps phase. For example: nginx-ingress, external-dns and cert-manager if present in the jx-apps.yml will be installed during the system phase creating the required object resources to secure the ingresses created by the deployments created during the apps phase.

Custom values

Apps can be customized in the current model by adding values.yaml values files for the charts in the apps/$chartName/ or system/$chartName/ directories (note: this is subject to be consolidated in the apps directory in future releases).

Note: certain charts configured with Jenkins X (not just those distributed by Jenkins X!) set custom values during the deployment taken from the jenkins-x-versions version stream configured with the repositories jx-requirements.yml or set during the jxl boot run by specifying the --versions-repo and optionally --versions-ref command line parameters. For example, the stable/nginx-ingress chart configured in the jx-apps.yml is deployed with replicaCount: 3 taken from the version stream's apps/stable/nginx-ingress/values.yaml.gotmpl.

helmfile

The deployment specs are created using helmfile, included in the jxl-base-image which is extended to include the jxl binary.

Note: Jenkins X Labs docker images are pushed to the gcr.io/jenkinsxio-labs Google Cloud Registry. Jenkins X images are pushed to the gcr.io/jenkinsxio GCR.

The environments repositories default pipelines are defined in the environment-helmfile jenkins-x-kubernetes buildpack's pipeline.yaml. The generate-helmfile step generates the helmfile's which are synced to the cluster in the helmfile-system and helmfile-apps steps.

Example

In a default boot the stable/nginx-ingress service is created with the incorrect argument: publish-service: kube-system/jxing-nginx-ingress-controller taken from the version stream (full details are available in this slack thread) - the default values apply for a jx boot but not for jxl boot which installs the charts with their own defaults (the default parameters for the nginx-ingress charts are available here). We can override the jenkins-x-versions defaults by setting our own in the system/nginx-ingress/values.yaml:

# overriding the jenkins-x-versions defaults
controller:
  extraArgs:
    publish-service: nginx/nginx-ingress-controller

Run the jxl step create helmfile command in your local environment repository checkout to create the helmfile resources for inspection prior to bootstrapping the cluster. The jxl step create helmfile command will output the jx-requirements.values.yaml.gotmpl as well as the apps/helmfile.yaml and system/helmfile.yaml resources. Verify that our override is set for the stable/nginx-ingress chart in the system/helmfile.yaml's releases.values:

releases:
- chart: stable/nginx-ingress
  name: nginx-ingress
  namespace: nginx
  values:
  - /home/bmassey/.jx/jenkins-x-versions/apps/stable/nginx-ingress/values.yaml.gotmpl
  - ../jx-requirements.values.yaml.gotmpl
  - nginx-ingress/values.yaml
  version: 1.33.5

Commit the changes to your repository and boot up your cluster: jxl boot run --dir=/path/to/checkout.