The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
container
: Run build steps in a containername
String
shell
(optional)
Specifies a shell which will run inside the container and process requests from Jenkins to run executables, set environment variables, and similar infrastructure.
This does not affect the shell used to run user code, such as sh
steps. To run your scripts with a specific shell on Linux, use an interpreter line:
sh '''#!/bin/bash
for x in {0..9}; do echo x; done
'''
or just use a subprocess and an externally versioned script:
sh 'bash ci.sh'
On Windows, choose between the bat
or powershell
steps.
For a pod running on Linux, defaults to sh
, which should be in $PATH
; for a pod running on Windows, defaults to cmd
, which should be in %Path%
. Should not generally be overridden.
String
podTemplate
: Define a podTemplate to use in the kubernetes pluginDefines a Kubernetes pod template that can be used to create nodes.
Example:
podTemplate(...) { node(POD_LABEL) { // some steps } }
activeDeadlineSeconds
(optional)
int
annotations
(optional)
key
String
value
String
cloud
(optional)
String
containers
(optional)
name
jnlp
, and runs the Jenkins JNLP agent service. In order to replace the default JNLP agent, the name of the container with the custom JNLP image must be jnlp
.String
image
hudson.remoting.jnlp.Main
.String
alwaysPullImage
(optional)
boolean
args
(optional)
Arguments to pass to the command.
${computer.jnlpmac}
and ${computer.name}
are replaced with the agent secret and name respectively.
For Windows containers the args Start-Sleep 999999
are reasonable choices to go with powershell
.
String
command
(optional)
Override the image entrypoint with a different one.
For Windows containers powershell
is a good default.
String
envVars
(optional)
containerEnvVar
key
String
value
String
envVar
key
String
value
String
podEnvVar
key
String
value
String
secretEnvVar
key
String
secretName
String
secretKey
String
optional
boolean
livenessProbe
(optional)
execArgs
String
timeoutSeconds
int
initialDelaySeconds
int
failureThreshold
When a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up.
Giving up in case of liveness probe means restarting the container.
In case of readiness probe the Pod will be marked Unready. Defaults to 3. Minimum value is 1.
int
periodSeconds
How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.
int
successThreshold
int
ports
(optional)
name
(optional)
String
containerPort
(optional)
int
hostPort
(optional)
int
privileged
(optional)
boolean
resourceLimitCpu
(optional)
String
resourceLimitEphemeralStorage
(optional)
String
resourceLimitMemory
(optional)
String
resourceRequestCpu
(optional)
String
resourceRequestEphemeralStorage
(optional)
String
resourceRequestMemory
(optional)
String
runAsGroup
(optional)
String
runAsUser
(optional)
String
shell
(optional)
String
ttyEnabled
(optional)
boolean
workingDir
(optional)
String
envVars
(optional)
containerEnvVar
key
String
value
String
envVar
key
String
value
String
podEnvVar
key
String
value
String
secretEnvVar
key
String
secretName
String
secretKey
String
optional
boolean
hostNetwork
(optional)
boolean
idleMinutes
(optional)
int
imagePullSecrets
(optional)
String
inheritFrom
(optional)
String
instanceCap
(optional)
int
label
(optional)
POD_LABEL
so you can use this as the argument to the node
step.
podTemplate(...) { node(POD_LABEL) { // some steps } }
String
name
(optional)
String
namespace
(optional)
String
nodeSelector
(optional)
String
nodeUsageMode
(optional)
String
podRetention
(optional)
always
default
never
onFailure
runAsGroup
(optional)
String
runAsUser
(optional)
String
schedulerName
(optional)
String
serviceAccount
(optional)
String
showRawYaml
(optional)
boolean
slaveConnectTimeout
(optional)
int
supplementalGroups
(optional)
String
volumes
(optional)
configMapVolume
mountPath
String
configMapName
String
optional
boolean
subPath
(optional)
String
emptyDirVolume
mountPath
String
memory
boolean
hostPathVolume
hostPath
String
mountPath
String
nfsVolume
serverAddress
String
serverPath
String
readOnly
boolean
mountPath
String
persistentVolumeClaim
mountPath
String
claimName
String
readOnly
boolean
secretVolume
mountPath
String
secretName
String
defaultMode
String
optional
boolean
workingDir
(optional)
String
workspaceVolume
(optional)
dynamicPVC
accessModes
(optional)
String
requestsSize
(optional)
String
storageClassName
(optional)
String
emptyDirWorkspaceVolume
memory
boolean
hostPathWorkspaceVolume
hostPath
String
nfsWorkspaceVolume
serverAddress
String
serverPath
String
readOnly
boolean
persistentVolumeClaimWorkspaceVolume
claimName
String
readOnly
boolean
yaml
(optional)
String
yamlMergeStrategy
(optional)
merge
override
kubeconfig
: Setup Kubernetes CLI (kubectl)serverUrl
String
credentialsId
String
caCertificate
Leaving this field empty will skip the certificate verification.
String
containerLog
: Get container log from Kubernetesname
containerTemplate
.
String
limitBytes
(optional)
int
returnLog
(optional)
boolean
sinceSeconds
(optional)
int
tailingLines
(optional)
int
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.