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.
This commit is contained in:
2022-11-16 08:55:19 -06:00
parent 19ad5023b8
commit 404fadc68a
3 changed files with 153 additions and 24 deletions

View File

@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- jenkins.yaml
secretGenerator:
- name: imagepull-gitea
namespace: jenkins
type: kubernetes.io/dockerconfigjson
files:
- .dockerconfigjson