Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed base/jenkins/templates/.gitkeep
Empty file.
38 changes: 38 additions & 0 deletions base/jenkins/templates/controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# Minimal Deployment template for Jenkins controller with InitContainer support
# Renders from environments/dev/values.yaml or equivalent in staging/prod

apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins
labels:
app: jenkins
spec:
replicas: 1
selector:
matchLabels:
app: jenkins
template:
metadata:
labels:
app: jenkins
spec:
{{- with .Values.controller.initContainers }}
initContainers:
{{ toYaml . | indent 8 }}
{{- end }}

containers:
- name: jenkins
image: jenkins/jenkins:lts
ports:
- containerPort: 8080
volumeMounts:
- name: jcasc
mountPath: /var/jenkins_home/casc_configs

{{- with .Values.controller.volumes }}
volumes:
{{ toYaml . | indent 6 }}
{{- end }}
20 changes: 16 additions & 4 deletions environments/dev/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# Helm values for Jenkins in the dev environment
# Enables JCasC, disables the default config, and prepares for external config
# injection.
# Helm values for Jenkins in the dev environment (local k3d cluster)
# This file enables JCasC, disables the default config, and prepares for external config injection.

# The 'controller' section configures the Jenkins controller behavior
controller:
Expand All @@ -12,7 +11,6 @@ controller:

# Jenkins Configuration as Code (JCasC) settings
JCasC:

# Enable JCasC support in the Helm chart
enabled: true

Expand All @@ -22,3 +20,17 @@ controller:
# Placeholder for inline config scripts.
# We rely on mounted files via InitContainer instead.
configScripts: {}

# Define shared volumes for InitContainer and Jenkins controller
volumes:
- name: jcasc
emptyDir: {}

# InitContainer to copy JCasC files into a shared volume
initContainers:
- name: jcasc-init
image: alpine:3.18
command: ["/entrypoint.sh"]
volumeMounts:
- name: jcasc
mountPath: /workspace/jcasc
Loading