cdk8s-jenkins
cdk8s-jenkins is a library that lets you easily define a manifest for deploying a Jenkins instance to your Kubernetes cluster.
Prerequisites
This library uses a Custom Resource Definition provided by jenkins, and thus requires both the CRD and the operator to be installed on the cluster. You can set this up by,
- Apply the Custom Resource Definition(CRD) for jenkins on your Kubernetes cluster.
kubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/config/crd/bases/jenkins.io_jenkins.yaml
- Install the Jenkins Operator on your Kubernetes cluster.
kubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/all-in-one-v1alpha2.yaml
For more information regarding applying jenkins crd and installing jenkins operator, please refer jenkins official documentaion.
Usage
The library provides a high level Jenkins construct to provision a Jenkins instance.
You can just instantiate the Jenkins instance and that would add a Jenkins resource to the kubernetes manifest.
The library provide a set of defaults, so provisioning a basic Jenkins instance requires no configuration:
import { Jenkins } from 'cdk8s-jenkins';
// inside your chart:
const jenkins = new Jenkins(this, 'my-jenkins');
The library also enables configuring the following parmeters for the Jenkins instance:
metadata
const jenkins = new Jenkins(this, 'my-jenkins', {
metadata: {
namespace: 'jenkins-namespace',
labels: { customApp: 'my-jenkins' },
},
});
disableCsrfProtection
This allows you to toggle CSRF Protection for Jenkins.
const jenkins = new Jenkins(this, 'my-jenkins', {
disableCsrfProtection: true,
});
basePlugins
These are the plugins required by the jenkins operator.
const jenkins = new Jenkins(this, 'my-jenkins', {
basePlugins: [{
name: 'configuration-as-code',
version: '1.55',
}],
});
You can also utilize addBasePlugins function to add base plugins to jenkins configuration after initialization.
const jenkins = new Jenkins(this, 'my-jenkins');
jenkins.addBasePlugins([{
name: 'workflow-api',
version: '2.76',
}]);
plugins
These are the plugins that you can add to your jenkins instance.
const jenkins = new Jenkins(this, 'my-jenkins', {
plugins: [{
name: 'simple-theme-plugin',
version: '0.7',
}],
});
You can also utilize addPlugins function to add plugins to jenkins configuration after initialization.
const jenkins = new Jenkins(this, 'my-jenkins');
jenkins.addPlugins([{
name: 'simple-theme-plugin',
version: '0.7',
}]);
seedJobs
You can define list of jenkins seed job configurations here. For more info you can take look at jenkins documentation.
const jenkins = new Jenkins(this, 'my-jenkins', {
seedJobs: [{
id: 'jenkins-operator',
targets: 'cicd/jobs/*.jenkins',
description: 'Jenkins Operator repository',
repositoryBranch: 'master',
repositoryUrl: 'https://github.com/jenkinsci/kubernetes-operator.git',
}],
});
You can also utilize addSeedJobs function to add seed jobs to jenkins configuration after initialization.
const jenkins = new Jenkins(this, 'my-jenkins');
jenkins.addSeedJobs([{
id: 'jenkins-operator',
targets: 'cicd/jobs/*.jenkins',
description: 'Jenkins Operator repository',
repositoryBranch: 'master',
repositoryUrl: 'https://github.com/jenkinsci/kubernetes-operator.git',
}]);
Using escape hatches
You can utilize escape hatches to make changes to the configurations that are not yet exposed by the library.
For instance, if you would like to update the version of a base plugin:
const jenkins = new Jenkins(this, 'my-jenkins');
const jenkinsApiObject = ApiObject.of(jenkins);
jenkinsApiObject.addJsonPatch(JsonPatch.replace('/spec/master/basePlugins/1', {
name: 'workflow-job',
version: '3.00',
}));
For more information regarding escape hatches, take a look at cdk8s documentation.
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.
Metadata
Release files for cdk8s-jenkins 0.0.622
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cdk8s_jenkins-0.0.622.tar.gz | 158.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cdk8s_jenkins-0.0.622-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 315.7 kB
Release files / cdk8s_jenkins-0.0.622.tar.gz
| Download URL | cdk8s_jenkins-0.0.622.tar.gz |
|---|---|
| Size | 158.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41b08e62ec3a7f191b7cf6086793e852f11a1a1f992b33e049f80b17771c3cad
|
|
BLAKE2b-256 checksum How to use checksums |
6528efc4abf024ac7ebf60a276865e7b086294a4844cdea81347017699a90758
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.14.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / cdk8s_jenkins-0.0.622-py3-none-any.whl
| Download URL | cdk8s_jenkins-0.0.622-py3-none-any.whl |
|---|---|
| Size | 156.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b71c1c676a7811ad6b7184ead82976345cc6f913bea6dab53774a863eded459a
|
|
BLAKE2b-256 checksum How to use checksums |
e8a59ba8b32cb072ce89d94f6db041fcae658e882b508dd1c04e65444d941e95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.14.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency log