Skip to content

Instantly share code, notes, and snippets.

@abn
Created November 28, 2017 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abn/35a245e37bd3377415ab263161aac4de to your computer and use it in GitHub Desktop.
Save abn/35a245e37bd3377415ab263161aac4de to your computer and use it in GitHub Desktop.
Jenkins on OpenShift: Example configmap to dynamically configure a dotnet-build-pod PodTemplate
# References:
# - https://docs.openshift.com/container-platform/3.6/using_images/other_images/jenkins.html#using-the-jenkins-kubernetes-plug-in-to-run-jobs
# - https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md
apiVersion: v1
items:
- apiVersion: v1
data:
dotnet-build-pod: |-
<org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
<inheritFrom></inheritFrom>
<name>dotnet-build-pod</name>
<instanceCap>2147483647</instanceCap>
<idleMinutes>0</idleMinutes>
<label>dotnet-build-pod</label>
<serviceAccount>jenkins</serviceAccount>
<nodeSelector></nodeSelector>
<volumes/>
<containers>
<org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
<name>jnlp</name>
<image>registry.access.redhat.com/dotnet/dotnet-20-jenkins-slave-rhel7</image>
<privileged>false</privileged>
<alwaysPullImage>false</alwaysPullImage>
<workingDir>/tmp</workingDir>
<command></command>
<args>${computer.jnlpmac} ${computer.name}</args>
<ttyEnabled>false</ttyEnabled>
<resourceRequestCpu></resourceRequestCpu>
<resourceRequestMemory></resourceRequestMemory>
<resourceLimitCpu></resourceLimitCpu>
<resourceLimitMemory></resourceLimitMemory>
<envVars/>
</org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
</containers>
<envVars/>
<annotations/>
<imagePullSecrets/>
<nodeProperties/>
</org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
kind: ConfigMap
metadata:
labels:
role: jenkins-slave
name: jenkins-slave
kind: List
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment