1
0
Fork 0
Commit Graph

13 Commits (fd400eb1deef08084ef6addf072cb01ea62e070a)

Author SHA1 Message Date
Dustin 20ef2a287b jenkins: Update to 2.426.2 2024-01-22 18:01:03 -06:00
Dustin ad65a12b66 jenkins: Allow Jenkins to read pod logs
Jenkins needs permission to read pod logs so it can display output from
the JNLP agent if it crashes.
2023-12-27 15:33:36 -06:00
Dustin 12d3c32855 jenkins: RBAC for K8s Credentials Provider
The [Kubernetes Credentials Provider][0] plugin for Jenkins allows
Jenkins to expose Kubernetes Secret resources as Jenkins Credentials.
Jobs can use them like normal Jenkins credentials, e.g. using
`withCredentials`, `sshagent`, etc.  The only drawback is that every
credential exposed this way is available to every job, at least until
[PR #40][1] is merged.  Fortunately, jobs managed by this Jenkins
instance are all trusted; no anonymous pull requests are possible, so
the risk is mitigated.

[0]: https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/
[1]: https://github.com/jenkinsci/kubernetes-credentials-provider-plugin/pull/40
2023-11-10 15:27:38 -06:00
Dustin c5188d042b jenkins: Add default imagePullSecrets for jobs
Setting the `imagePullSecrets` property on the default service account
for the *jenkins-jobs* namespace allows jobs to run from private
container images automatically, without additional configuration in the
pipeline definitions.
2023-11-10 15:13:19 -06:00
Dustin 0e7bd36d34 jenkins: Pin to x86_64 nodes
The Raspberry Pi usually has the most free RAM of all the Kubernetes
nodes, so pods tend to get assigned there even when it would not be
appropriate.  Jenkins, for example definitely does not need to run
there, so let's force it to run on the bigger nodes.
2023-10-22 22:07:22 -05:00
Dustin 52153d0e20 jenkins: Update to 2.414.3 2023-10-22 21:58:47 -05:00
Dustin 860bfb1e2c jenkins: Set instance label for Argo CD
Argo CD wants every resource managed by an application to have that
application's name as the value of the `app.kubernetes.io/instance`
label.
2023-10-14 07:24:42 -05:00
Dustin 0c8480ba21 jenkins: Update to v2.401.3 2023-08-09 14:04:23 -05:00
Dustin 889cd29a3c jenkins: Update to 2.375.1
I don't want Jenkins updating itself whenever the pod restarts, so I'm
going to pin it to a specific version.  This way, I can be sure to take
a snapshot of the data volume before upgrading.
2022-12-02 22:15:11 -06:00
Dustin b8ccbd0b09 jenkins: Avoid SELinux relabel of data dir
Setting a static SELinux level for the container allows CRI-O to skip
relabeling all the files in the persistent volume each time the
container starts.  For this to work, the pod needs a special annotation,
and CRI-O itself has to be configured to respect it:

```toml
[crio.runtime.runtimes.runc]
allowed_annotations = ["io.kubernetes.cri-o.TrySkipVolumeSELinuxLabel"]
```

This *dramatically* improves the start time of the Jenkins container.
Instead of taking 5+ minutes, it now starts instantly.

https://github.com/cri-o/cri-o/issues/6185#issuecomment-1334719982
2022-12-01 21:35:02 -06:00
Dustin 404fadc68a jenkins: Run Jenkins in Kubernetes
Running Jenkins in Kubernetes is relatively straightforward.  The
Kubernetes plugin automatically discovers all the connection and
authentication configuration, so a `kubeconfig` file is no longer
necessary.  I did set the *Jenkins tunnel* option, though, so that
agents will connect directly to the Jenkins JNLP port instead of going
through the ingress controller.

Jobs now run in pods in the *jenkins-job* namespace instead of the
*jenkins* namespace.  The latter is now where the Jenkins controller
runs, and the controller should not have permission to modify its own
resources.
2022-11-25 13:38:10 -06:00
Dustin 19ad5023b8 jenkins: Restrict role permissions
Jenkins doesn't really need full control of all resources in its
namespace.  Rather, it only needs to be able to manage Pod and
PersistentVolumeClaim resources.
2022-11-18 13:52:25 -06:00
Dustin 70cb9186a6 Add Jenkins setup resources 2022-07-25 17:52:55 -05:00