From d72569f68f0fbb680e27fe6f66c75e1cbe784d2e Mon Sep 17 00:00:00 2001 From: Claude AI Date: Sun, 8 Mar 2026 15:23:51 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20jenkins=20Helm=20chart=20=E2=80=94=20de?= =?UTF-8?q?ployment=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm/jenkins/templates/deployment.yaml | 100 +++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 helm/jenkins/templates/deployment.yaml diff --git a/helm/jenkins/templates/deployment.yaml b/helm/jenkins/templates/deployment.yaml new file mode 100644 index 0000000..22a7abd --- /dev/null +++ b/helm/jenkins/templates/deployment.yaml @@ -0,0 +1,100 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "jenkins.name" . }} + namespace: {{ .Values.namespace }} + labels: + {{- include "jenkins.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "jenkins.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "jenkins.selectorLabels" . | nindent 8 }} + spec: + serviceAccountName: {{ include "jenkins.serviceAccountName" . }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + initContainers: + {{- if .Values.initContainers.installDocker.enabled }} + - name: install-docker + image: {{ .Values.initContainers.installDocker.image }} + command: + - sh + - -c + - | + echo "Installing Docker CLI..." + cp /usr/local/bin/docker /tmp/tools-bin/ + chmod +x /tmp/tools-bin/docker + echo "Docker CLI installed" + volumeMounts: + - name: tools-bin + mountPath: /tmp/tools-bin + {{- end }} + {{- if .Values.initContainers.installKubectl.enabled }} + - name: install-kubectl + image: {{ .Values.initContainers.installKubectl.image }} + command: + - sh + - -c + - | + echo "Installing kubectl {{ .Values.initContainers.installKubectl.kubectlVersion }}..." + wget -q -O /tmp/tools-bin/kubectl \ + "https://dl.k8s.io/release/{{ .Values.initContainers.installKubectl.kubectlVersion }}/bin/linux/amd64/kubectl" + chmod +x /tmp/tools-bin/kubectl + echo "kubectl installed" + volumeMounts: + - name: tools-bin + mountPath: /tmp/tools-bin + {{- end }} + containers: + - name: {{ include "jenkins.name" . }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.httpPort }} + - name: agent + containerPort: {{ .Values.service.agentPort }} + env: + {{- toYaml .Values.extraEnv | nindent 12 }} + {{- if .Values.containerd.enabled }} + - name: DOCKER_HOST + value: "unix:///var/run/containerd.sock" + {{- end }} + command: + - sh + - -c + - | + export PATH="/tmp/tools-bin:$PATH" + exec /usr/local/bin/jenkins.sh + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: jenkins-home + mountPath: /var/jenkins_home + {{- if .Values.containerd.enabled }} + - name: docker-sock + mountPath: /var/run/containerd.sock + {{- end }} + - name: tools-bin + mountPath: /tmp/tools-bin + volumes: + - name: jenkins-home + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.claimName }} + {{- else }} + emptyDir: {} + {{- end }} + {{- if .Values.containerd.enabled }} + - name: docker-sock + hostPath: + path: {{ .Values.containerd.socketPath }} + type: Socket + {{- end }} + - name: tools-bin + emptyDir: {}