32 lines
821 B
Markdown
32 lines
821 B
Markdown
# Jenkins in Kubernetes
|
|
|
|
## Kubernetes Setup
|
|
|
|
Configure Jenkins resources:
|
|
|
|
```sh
|
|
ln imagepull-gitea jenkins/.dockerconfigjson
|
|
kubectl apply -k jenkins
|
|
```
|
|
|
|
## Jenkins Setup
|
|
|
|
Install [Kubernetes plugin][0].
|
|
|
|
Set *TCP port for inbound agents* setting (*Manage Jenkins* → *Configure Global
|
|
Security*) to *Fixed* and enter `40414`.
|
|
|
|
Configure Kubernetes (*Manage Jenkins* → *Manage Nodes and Clouds* → *Configure
|
|
Clouds*:
|
|
|
|
1. *Add a new cloud* → *Kubernetes*
|
|
2. Enter a name
|
|
3. *Kubernetes Cloud details...*
|
|
* *Kubernetes URL*: (leave blank; will use Kubernetes service discovery)
|
|
* *Kubernetes Namespace*: `jenkins-jobs`
|
|
* *Credentials*: `- none -` (will use Service Account token)
|
|
* *Jenkins tunnel*: `jenkins.jenkins.svc.cluster.local:` (trailing colon!)
|
|
|
|
|
|
[0]: https://plugins.jenkins.io/kubernetes/
|