cdk8s-jenkins


Namecdk8s-jenkins JSON
Version 0.0.468 PyPI version JSON
download
home_pagehttps://github.com/cdk8s-team/cdk8s-jenkins.git
SummaryJenkins construct for CDK8s
upload_time2024-12-24 12:06:32
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/cb/a1/c65f58b1d67621b302dd93fea994f1e39530dd8e3d4f2119870241b92029/cdk8s_jenkins-0.0.468.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.468",
    "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": "3958266b8456c577611ba00be07bf16565560ac016f4bdbb244fe17f86b3a6ed",
                "md5": "34832eca4b46453ab4101f7bc1963030",
                "sha256": "7f119f917e63bff9d3453e36680e24399b6413dcc0c4d37d8b00cde55d0ce59e"
            },
            "downloads": -1,
            "filename": "cdk8s_jenkins-0.0.468-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "34832eca4b46453ab4101f7bc1963030",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 156486,
            "upload_time": "2024-12-24T12:06:29",
            "upload_time_iso_8601": "2024-12-24T12:06:29.523135Z",
            "url": "https://files.pythonhosted.org/packages/39/58/266b8456c577611ba00be07bf16565560ac016f4bdbb244fe17f86b3a6ed/cdk8s_jenkins-0.0.468-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cba1c65f58b1d67621b302dd93fea994f1e39530dd8e3d4f2119870241b92029",
                "md5": "eae45eac222b58129049de2d0f694f13",
                "sha256": "e4d852c0e19b21062dbbf32b3d4af2dcca392697d9660269ebbac2bac7fff0f8"
            },
            "downloads": -1,
            "filename": "cdk8s_jenkins-0.0.468.tar.gz",
            "has_sig": false,
            "md5_digest": "eae45eac222b58129049de2d0f694f13",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 158036,
            "upload_time": "2024-12-24T12:06:32",
            "upload_time_iso_8601": "2024-12-24T12:06:32.714532Z",
            "url": "https://files.pythonhosted.org/packages/cb/a1/c65f58b1d67621b302dd93fea994f1e39530dd8e3d4f2119870241b92029/cdk8s_jenkins-0.0.468.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-24 12:06:32",
    "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.54176s