Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wmcdona89 committed Mar 15, 2020
1 parent 7b4e039 commit 7f30711
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
15 changes: 9 additions & 6 deletions stable/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,18 @@ Some third-party systems, e.g. GitHub, use HTML-formatted data in their payload
| `agent.privileged` | Agent privileged container | `false` |
| `agent.resources` | Resources allocation (Requests and Limits) | `{requests: {cpu: 512m, memory: 512Mi}, limits: {cpu: 512m, memory: 512Mi}}`|
| `agent.volumes` | Additional volumes | `[]` |
| `agent.podRetention` | Agent Pod retention after build completes | `Never` |
| `agent.envVars` | Environment variables for the agent Pod | `[]` |
| `agent.command` | Executed command when side container starts | Not set |
| `agent.args` | Arguments passed to executed command | Not set |
| `agent.args` | Arguments passed to executed command | `${computer.jnlpmac} ${computer.name}`|
| `agent.sideContainerName` | Side container name in agent | jnlp |
| `agent.TTYEnabled` | Allocate pseudo tty to the side container | false |
| `agent.containerCap` | Maximum number of agent | 10 |
| `agent.podName` | Agent Pod base name | Not set |
| `agent.idleMinutes` | Allows the Pod to remain active for reuse | 0 |
| `agent.yamlTemplate` | The raw yaml of a Pod API Object to merge into the agent spec | Not set |
| `agent.slaveConnectTimeout`| Timeout in seconds for an agent to be online | 100 |
| `agent.workingDir` | Working directory | `/home/jenkins` |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
Expand Down Expand Up @@ -396,6 +398,9 @@ agent:
enabled: true
podName: default
resources:
requests:
cpu: 1024m
memory: 2048Mi
limits:
cpu: 1024m
memory: 2048Mi
Expand All @@ -407,12 +412,9 @@ agentList:
- podName: maven-large
inheritFrom: maven
resources:
requests:
cpu: 1024m
memory: 2048Mi
limits:
cpu: 1024m
memory: 2048Mi
memory: 4096Mi

# A hierarchy of agents. Useful when creating a custom chart to allow values to be overridden.
# Each object corresponds to a chart `agent` in terms of the values that can be set.
Expand Down Expand Up @@ -441,7 +443,8 @@ master:
{{- range .Values.agentList }}
{{- tpl (include "jenkins.agent-jcasc" (set $ "Values" (set $.Values "agent" .))) $ | nindent 6 }}
{{- end }}
{{- tpl (include "jenkins.agent-jcasc" (set . "Values" (set .Values "agent" .Values.agentHierarchy.maven))) . | nindent 6 }}
{{- tpl (include "jenkins.agent-jcasc" (set . "Values" (set .Values "agent" .Values.agentHierarchy.node))) . | nindent 6 }}
{{- tpl (include "jenkins.agent-jcasc" (set . "Values" (set .Values "agent" .Values.agentHierarchy.python))) . | nindent 6 }}
{{- $_ := set .Values "agent" $agent }}
```
Expand Down
7 changes: 5 additions & 2 deletions stable/jenkins/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jenkins:
serverUrl: "https://kubernetes.default"
{{- if .Values.agent.enabled }}
templates:
{{- tpl ( include "jenkins.agent-jcasc" . ) . | nindent 6 }}
{{- end }}
{{- if .Values.master.csrf.defaultCrumbIssuer.enabled }}
crumbIssuer:
Expand Down Expand Up @@ -170,7 +171,9 @@ Create the name of the service account for Jenkins agents to use
{{- else }}
args: "^${computer.jnlpmac} ^${computer.name}"
{{- end }}
command: {{ .Values.agent.command | default "" | quote }}
{{- if not ( kindIs "invalid" .Values.agent.command ) }}
command: {{ .Values.agent.command | quote }}
{{- end }}
envVars:
- containerEnvVar:
key: "JENKINS_URL"
Expand Down Expand Up @@ -212,7 +215,7 @@ Create the name of the service account for Jenkins agents to use
{{- end }}
{{- if .Values.agent.yamlTemplate }}
yaml: |-
{{- .Values.agent.yamlTemplate | nindent 4 }}
{{- tpl .Values.agent.yamlTemplate . | nindent 4 }}
{{- end }}
yamlMergeStrategy: "override"
{{- end }}
1 change: 1 addition & 0 deletions stable/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ agent:
# value: "value"
# Timeout in seconds for an agent to be online
slaveConnectTimeout: 100
workingDir: "/home/jenkins"

persistence:
enabled: true
Expand Down

0 comments on commit 7f30711

Please sign in to comment.