cdk8s-jenkins


Namecdk8s-jenkins JSON
Version 0.0.435 PyPI version JSON
download
home_pagehttps://github.com/cdk8s-team/cdk8s-jenkins.git
SummaryJenkins construct for CDK8s
upload_time2024-03-23 12:06:06
maintainerNone
docs_urlNone
authorAmazon Web Services
requires_python~=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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,

1. 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
```

1. 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](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/installing-the-operator/).

## 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:

```python
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

```python
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.

```python
const jenkins = new Jenkins(this, 'my-jenkins', {
  disableCsrfProtection: true,
});
```

### basePlugins

These are the plugins required by the jenkins operator.

```python
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.

```python
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.

```python
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.

```python
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](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuring-seed-jobs-and-pipelines/).

```python
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.

```python
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:

```python
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](https://cdk8s.io/docs/latest/concepts/escape-hatches/).

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more
information.

## License

This project is licensed under the Apache-2.0 License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cdk8s-team/cdk8s-jenkins.git",
    "name": "cdk8s-jenkins",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Amazon Web Services",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/11/f3/789dd209b59a3eb565166dfdd6c35aebc5728963d00edf3a595c974d2075/cdk8s-jenkins-0.0.435.tar.gz",
    "platform": null,
    "description": "# cdk8s-jenkins\n\n`cdk8s-jenkins` is a library that lets you easily define a manifest for deploying a Jenkins instance to your Kubernetes cluster.\n\n## Prerequisites\n\nThis library uses a Custom Resource Definition provided by jenkins, and thus requires both the CRD and the operator to be installed on the cluster.\nYou can set this up by,\n\n1. Apply the Custom Resource Definition(CRD) for jenkins on your Kubernetes cluster.\n\n```\nkubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/config/crd/bases/jenkins.io_jenkins.yaml\n```\n\n1. Install the Jenkins Operator on your Kubernetes cluster.\n\n```\nkubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/all-in-one-v1alpha2.yaml\n```\n\n> For more information regarding applying jenkins crd and installing jenkins operator, please refer [jenkins official documentaion](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/installing-the-operator/).\n\n## Usage\n\nThe library provides a high level `Jenkins` construct to provision a Jenkins instance.\nYou can just instantiate the Jenkins instance and that would add a Jenkins resource to the kubernetes manifest.\n\nThe library provide a set of defaults, so provisioning a basic Jenkins instance requires no configuration:\n\n```python\nimport { Jenkins } from 'cdk8s-jenkins';\n\n// inside your chart:\nconst jenkins = new Jenkins(this, 'my-jenkins');\n```\n\nThe library also enables configuring the following parmeters for the Jenkins instance:\n\n### metadata\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins', {\n  metadata: {\n    namespace: 'jenkins-namespace',\n    labels: { customApp: 'my-jenkins' },\n  },\n});\n```\n\n### disableCsrfProtection\n\nThis allows you to toggle CSRF Protection for Jenkins.\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins', {\n  disableCsrfProtection: true,\n});\n```\n\n### basePlugins\n\nThese are the plugins required by the jenkins operator.\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins', {\n  basePlugins: [{\n    name: 'configuration-as-code',\n    version: '1.55',\n    }],\n});\n```\n\nYou can also utilize `addBasePlugins` function to add base plugins to jenkins configuration after initialization.\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins');\njenkins.addBasePlugins([{\n  name: 'workflow-api',\n  version: '2.76',\n}]);\n```\n\n### plugins\n\nThese are the plugins that you can add to your jenkins instance.\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins', {\n  plugins: [{\n    name: 'simple-theme-plugin',\n    version: '0.7',\n    }],\n});\n```\n\nYou can also utilize `addPlugins` function to add plugins to jenkins configuration after initialization.\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins');\njenkins.addPlugins([{\n  name: 'simple-theme-plugin',\n  version: '0.7',\n}]);\n```\n\n### seedJobs\n\nYou can define list of jenkins seed job configurations here. For more info you can take look at [jenkins documentation](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuring-seed-jobs-and-pipelines/).\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins', {\n  seedJobs: [{\n    id: 'jenkins-operator',\n    targets: 'cicd/jobs/*.jenkins',\n    description: 'Jenkins Operator repository',\n    repositoryBranch: 'master',\n    repositoryUrl: 'https://github.com/jenkinsci/kubernetes-operator.git',\n    }],\n});\n```\n\nYou can also utilize `addSeedJobs` function to add seed jobs to jenkins configuration after initialization.\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins');\njenkins.addSeedJobs([{\n  id: 'jenkins-operator',\n  targets: 'cicd/jobs/*.jenkins',\n  description: 'Jenkins Operator repository',\n  repositoryBranch: 'master',\n  repositoryUrl: 'https://github.com/jenkinsci/kubernetes-operator.git',\n}]);\n```\n\n## Using escape hatches\n\nYou can utilize escape hatches to make changes to the configurations that are not yet exposed by the library.\n\nFor instance, if you would like to update the version of a base plugin:\n\n```python\nconst jenkins = new Jenkins(this, 'my-jenkins');\nconst jenkinsApiObject = ApiObject.of(jenkins);\njenkinsApiObject.addJsonPatch(JsonPatch.replace('/spec/master/basePlugins/1', {\n  name: 'workflow-job',\n  version: '3.00',\n}));\n```\n\nFor more information regarding escape hatches, take a look at [cdk8s documentation](https://cdk8s.io/docs/latest/concepts/escape-hatches/).\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more\ninformation.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Jenkins construct for CDK8s",
    "version": "0.0.435",
    "project_urls": {
        "Homepage": "https://github.com/cdk8s-team/cdk8s-jenkins.git",
        "Source": "https://github.com/cdk8s-team/cdk8s-jenkins.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "27ccbc91797e37a4c17f243bad5cdc2b176c372e90022ae6560ecff4e0e70201",
                "md5": "f8e85c6e27118e2189306d6edd653239",
                "sha256": "e751b123e880073ab19dd8d0a763413fc84efa0d7157c5eb55a4f17d7e2da9e1"
            },
            "downloads": -1,
            "filename": "cdk8s_jenkins-0.0.435-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f8e85c6e27118e2189306d6edd653239",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 158133,
            "upload_time": "2024-03-23T12:06:00",
            "upload_time_iso_8601": "2024-03-23T12:06:00.580563Z",
            "url": "https://files.pythonhosted.org/packages/27/cc/bc91797e37a4c17f243bad5cdc2b176c372e90022ae6560ecff4e0e70201/cdk8s_jenkins-0.0.435-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11f3789dd209b59a3eb565166dfdd6c35aebc5728963d00edf3a595c974d2075",
                "md5": "8ac7bc1cf5d04888ad974882b2247d86",
                "sha256": "d107262a3aa844e50678398bdeedf4eef78d25ddd9855544a1d97fd35217847b"
            },
            "downloads": -1,
            "filename": "cdk8s-jenkins-0.0.435.tar.gz",
            "has_sig": false,
            "md5_digest": "8ac7bc1cf5d04888ad974882b2247d86",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 160037,
            "upload_time": "2024-03-23T12:06:06",
            "upload_time_iso_8601": "2024-03-23T12:06:06.847769Z",
            "url": "https://files.pythonhosted.org/packages/11/f3/789dd209b59a3eb565166dfdd6c35aebc5728963d00edf3a595c974d2075/cdk8s-jenkins-0.0.435.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-23 12:06:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cdk8s-team",
    "github_project": "cdk8s-jenkins",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cdk8s-jenkins"
}
        
Elapsed time: 0.22945s