From 7dbb6792824e3a6089f2005a426762fc6c493f9f Mon Sep 17 00:00:00 2001 From: Fleur Kelpin Date: Wed, 27 Jun 2018 17:59:04 +0200 Subject: [PATCH] Add values to configure a second Agent. --- molgenis-jenkins/templates/config.tpl | 83 +++++++++++++++------------ molgenis-jenkins/values.yaml | 31 +++++++++- 2 files changed, 75 insertions(+), 39 deletions(-) diff --git a/molgenis-jenkins/templates/config.tpl b/molgenis-jenkins/templates/config.tpl index 998a71d..02128f3 100644 --- a/molgenis-jenkins/templates/config.tpl +++ b/molgenis-jenkins/templates/config.tpl @@ -91,60 +91,67 @@ data: {{- end }} +{{- end -}} +{{- if .Values.Pod.Enabled }} - - - false - false - false + {{ .Values.Pod.Label }} 2147483647 - 100 0 - 0 - - - EXCLUSIVE - false - - false - + + + {{- $local := dict "first" true }} + {{- range $key, $value := .Values.Pod.NodeSelector }} + {{- if not $local.first }},{{- end }} + {{- $key }}={{ $value }} + {{- $_ := set $local "first" false }} + {{- end }} + NORMAL - - /var/run/docker.sock - /var/run/docker.sock - +{{- range $index, $volume := .Values.Pod.volumes }} + +{{- range $key, $value := $volume }}{{- if not (eq $key "type") }} + <{{ $key }}>{{ $value }} +{{- end }}{{- end }} + +{{- end }} - maven - webhost12.service.rug.nl/molgenis/molgenis-maven:latest + {{ .Values.Pod.Label }} + {{ .Values.Pod.Image }}:{{ .Values.Pod.ImageTag }} +{{- if .Values.Pod.Privileged }} + true +{{- else }} false - true +{{- end }} + {{ .Values.Pod.AlwaysPullImage }} /home/jenkins - /bin/sh -c - cat + {{ .Values.Pod.Command }} + {{ .Values.Pod.Args }} +{{- if .Values.Pod.TTY }} true - - - - - - - - - 0 - 0 - 0 - 0 - 0 - +{{- else }} + false +{{- end }} + {{.Values.Pod.Cpu}} + {{.Values.Pod.Memory}} + {{.Values.Pod.Cpu}} + {{.Values.Pod.Memory}} +{{- if .Values.Pod.ImagePullSecret }} + + + {{ .Values.Pod.ImagePullSecret }} + + +{{- else }} - +{{- end }} + {{- end -}} diff --git a/molgenis-jenkins/values.yaml b/molgenis-jenkins/values.yaml index 02af41a..e6cabfa 100644 --- a/molgenis-jenkins/values.yaml +++ b/molgenis-jenkins/values.yaml @@ -69,4 +69,33 @@ jenkins: # SecretsFilesSecret: jenkins-secrets CustomConfigMap: true rbac: - install: true \ No newline at end of file + install: true + # A second agent to configure a second pod template + Pod: + Enabled: true + Image: "webhost12.service.rug.nl/molgenis/molgenis-maven" + ImageTag: latest + # ImagePullSecret: jenkins + Label: "molgenis-maven" + Privileged: false + Cpu: "200m" + Memory: "256Mi" + # You may want to change this to true while testing a new image + AlwaysPullImage: true + Command: "/bin/sh -c" + Args: "cat" + TTY: true + # You can define the volumes that you want to mount for this container + # Allowed types are: ConfigMap, EmptyDir, HostPath, Nfs, Pod, Secret + # Configure the attributes as they appear in the corresponding Java class for that type + # https://github.com/jenkinsci/kubernetes-plugin/tree/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes + volumes: + - type: "HostPath" + mountPath: "/var/run/docker.sock" + hostPath: "/var/run/docker.sock" + # - type: Secret + # secretName: mysecret + # mountPath: /var/myapp/mysecret + NodeSelector: {} + # Key Value selectors. Ex: + # jenkins-agent: v1