Skip to content

Instantly share code, notes, and snippets.

@abn
Created November 30, 2017 13:43
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/757abfdfb2639941a4a1b3bb8a2622ad to your computer and use it in GitHub Desktop.
Save abn/757abfdfb2639941a4a1b3bb8a2622ad to your computer and use it in GitHub Desktop.
OpenShift Template: Jenkins Slave Pod ConfigMap
---
apiVersion: v1
kind: Template
labels:
template: jenkins-slave-config-template
metadata:
annotations:
description: |
A template to create a Jenkins slave ConfigMap.
openshift.io/display-name: Jenkins Slave ConfigMap
tags: jenkins
name: jenkins-slave-config
objects:
- apiVersion: v1
data:
dotnet-build-pod: |-
<org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
<inheritFrom></inheritFrom>
<name>${POD_NAME}</name>
<instanceCap>2147483647</instanceCap>
<idleMinutes>0</idleMinutes>
<label>${POD_NAME}</label>
<serviceAccount>jenkins</serviceAccount>
<nodeSelector></nodeSelector>
<volumes/>
<containers>
<org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
<name>jnlp</name>
<image>${IMAGE}</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: ${NAME}
parameters:
- name: NAME
displayName: Name
description: The name assigned the config map.
value: jenkins-slave-dotnet
- name: POD_NAME
displayName: Pod Name
description: The name assigned the config map and the jenkins pod template.
required: true
- name: IMAGE
displayName: Image
description: Image to use for Jenkins executor
required: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment