Jenkins that build Gentoo-based systems, like Aimee OS, need a persistent storage volume for the Gentoo ebuild repository. The Job initially populates the repository using `emerge-webrsync`, and then the CronJob keeps it up-to-date by running `emaint sync` daily. In addition to the Portage repository, we also need a volume to store built binary packages. Jenkins job pods can mount this volume to make binary packages they build available for subsequent runs. Both of these volumes are exposed to use cases outside the cluster using `rsync` in daemon mode. This can be useful for e.g. local builds. |
||
---|---|---|
.. | ||
.gitignore | ||
README.md | ||
gentoo-storage.yaml | ||
iscsi-migrate.yaml | ||
iscsi.yaml | ||
jenkins.yaml | ||
kustomization.yaml | ||
secrets.yaml | ||
ssh_known_hosts |
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 Jenkins → Configure Global
Security) to Fixed and enter 40414
.
Configure Kubernetes (Manage Jenkins → Manage Nodes and Clouds → Configure Clouds:
- Add a new cloud → Kubernetes
- Enter a name
- 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!)
iSCSI Persistent Volume
Because of the large size of the Jenkins volume, it does not work well managed by Longhorn. Instead, we use a pre-provisioned iSCSI volume on the Synology NAS. This improves performance and avoids keeping multiple replicas of the Jenkins data, while still benefiting from snapshots, etc.