[stable/jenkins] Create agent-jcasc template to configure multiple agents #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR provides the ability to configure multiple agents via JCasC. See the README for an example.
Which issue this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged)Special notes for your reviewer:
The pod template definition (
kubernetes.templates
) in templatejenkins.casc.defaults
is moved to a newjenkins.agent-jcasc
template with the following modifications. See http://www.mergely.com/h9N9IvrT/?ws=1.name
fields moved to the top so they stand outcommand
quoted when not nil to support empty string (empty string ensures Jenkins doesn't apply a default value such as/bin/sh -c
)resources
,resources.limits
,resources.requests
, andyamlTemplate
workingDir
parameterizedvolumes
addedI chose not to make use of the kubernetes plugin casc fields related to agent inheritance.
defaultsProviderTemplate
- the agent from which all other agents inherit configurationMerging
agent
into the other agents in the JCasC allows all agents to make use of the chart's default configuration foragent
. To wait for the kubernetes plugin to merge the values at runtime means each agent would need to setsideContainerName
(so container values could be inherited) as well as set any fields which get assigned a default value when nil and thus aren't eligible for inheritance (e.g.command
andworkingDir
).inheritFrom
- indicates from which agent this agent should inherit configurationI thought an
agent.inheritFrom
field would look out of place in the chart since the chart only defines a single agent.helm template
testsfor helm 2 use
--execute
instead of--show-only
auto-reload
default JCasC config
JCasC ConfigScripts
stable/jenkins/agent-values.yaml contains the example from the README
NO auto-reload
default JCasC config
JCasC ConfigScripts
stable/jenkins/agent-values.yaml contains the example from the README
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
[stable/mychartname]
)