jenkins

by Helm

Helm chartv0.1.2

A Jenkins Helm chart for Kubernetes

About this chart

Jenkins Helm Chart

Jenkins master and slave cluster utilizing the Jenkins Kubernetes plugin

Credit

This Chart was forked from https://github.com/kubernetes/charts/blob/master/stable/jenkins/ in order to provide the Cloud Posse flavor of CI/CD for Kubernetes. It's based largely on the effort of Lachlan Evenson, Vic Iglesias to produce the original Chart, who were inspired by the awesome work of Carlos Sanchez [email protected].

Chart Details

This chart will do the following:

  • 1 x Jenkins Master with port 8080 exposed on an external LoadBalancer
  • All using Kubernetes Deployments

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release cloudposse-incubator/jenkins

Configuration

The following tables lists the configurable parameters of the Jenkins chart and their default values.

Jenkins Master

ParameterDescriptionDefault
Master.NameJenkins master namejenkins-master
Master.ImageMaster image namecloudposse/jenkins
Master.ImageTagMaster image tagv0.1.0
Master.ImagePullPolicyMaster image pull policyAlways
Master.Componentk8s selector keyjenkins-master
Master.CpuMaster requested cpu200m
Master.MemoryMaster requested memory256Mi
Master.ServicePortk8s service port8080
Master.ContainerPortMaster listening port8080
Master.SlaveListenerPortListening port for agents50000

Jenkins Agent

ParameterDescriptionDefault
Agent.ImageAgent image namejenkinsci/cloudposse-slave
Agent.ImageTagAgent image tag2.52
Agent.ImagePullPolicyAgent image pull policyAlways
Agent.CpuAgent requested cpu200m
Agent.MemoryAgent requested memory256Mi

Github OAuth

ParameterDescriptionDefault
Github.OAuth.ClientIDGitHub OAuth Client IDREQUIRED
Github.OAuth.ClientSecretGitHub OAuth Client SecretREQUIRED
Github.OrganizationGithub OrganizationREQUIRED
Github.AdminsGithub Usernames for Jenkins AdminREQUIRED

Ingress

ParameterDescriptionDefault
DNS.HostnameHostname to associate with ServiceREQUIRED
DNS.TTLTime-to-Live300
DNS.TypeResource Record TypeCNAME

Specify each parameter using the --set key=value[,key=value] argument to helm install.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml stable/jenkins

Tip: You can use the default values.yaml

Persistence

The Jenkins image stores persistence under /var/jenkins_home path of the container. A Persistent Volume Claim is used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.

Todo

  • Enable Docker-in-Docker or Docker-on-Docker support on the Jenkins agents

Deploy jenkins with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has jenkins on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartjenkins is pinned at v0.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply