1
0
Fork 0
kubernetes/jenkins
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
..
README.md jenkins: Run Jenkins in Kubernetes 2022-11-25 13:38:10 -06:00
jenkins.yaml jenkins: Run Jenkins in Kubernetes 2022-11-25 13:38:10 -06:00
kustomization.yaml jenkins: Run Jenkins in Kubernetes 2022-11-25 13:38:10 -06:00

README.md

Jenkins in Kubernetes

Kubernetes Setup

Configure Jenkins resources:

ln imagepull-gitea jenkins/.dockerconfigjson
kubectl apply -k jenkins

Jenkins Setup

Install Kubernetes plugin.

Set TCP port for inbound agents setting (Manage JenkinsConfigure Global Security) to Fixed and enter 40414.

Configure Kubernetes (Manage JenkinsManage Nodes and CloudsConfigure Clouds:

  1. Add a new cloudKubernetes
  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!)