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.
Kubernetes :: Pipeline :: Kubernetes Steps
buildImage
: Builds a Docker Image
name
The The name of the docker image.
email
(optional)
This email will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
ignorePatterns
(optional)
- Type:
class java.util.ArrayList
password
(optional)
The This password will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
path
(optional)
The The path of the folder that contains the docker image.
rm
(optional)
The Flag to remove intermediate layers.
timeout
(optional)
The The amount of time to wait for the build to complete.
username
(optional)
The This username will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
pushImage
: Pushes a Docker Image
Pushes a docker image to a docker registry.
name
The The name of the docker image.
email
(optional)
This email will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
password
(optional)
The This password will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
registry
(optional)
The Explicitly specify a remote registry if not present in the image repository.
tag
(optional)
timeout
(optional)
The The amount of time to wait for the push to complete.
username
(optional)
The This username will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
name
The The name of the docker image.
tag
The The tag.
email
(optional)
This email will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
force
(optional)
password
(optional)
The This password will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
repo
(optional)
The The image repository in which the tag will be created.
username
(optional)
The This username will be used in the fallback docker auth config object, that will be used if matching configuration is found for the registry.
withPod
: Run build steps in a MyPod
name
containers
Array / List of Nested Object
name
The name for the container to be run. One container is automatically created with 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
.
image
Docker image ID for a jenkins JNLP agent. This image is responsible to run a jenkins jnlp bootstrap agent and connect to Jenkins master. Secret key and agent name as well as jenkins callback URL are passed as argument as expected by hudson.remoting.jnlp.Main
.
alwaysPullImage
(optional)
If ticked, the latest version of the image will be pulled every time it is used. See
Images - Kubernetes for the default Kubernetes behaviour.
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
.
command
(optional)
Override the image entrypoint with a different one.
For Windows containers powershell
is a good default.
envVars
(optional)
The environment variables to pass to the container.
Array / List of Nested Choice of Objects
containerEnvVar
envVar
podEnvVar
secretEnvVar
key
The environment variable key.
secretName
Name of secret to lookup from Kubernetes.
secretKey
Key of secret to lookup from Kubernetes.
optional
Whether this secret is optional.
livenessProbe
(optional)
Nested Object
execArgs
Command executed by the liveness probe.
timeoutSeconds
Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1.
initialDelaySeconds
Number of seconds after the container has started before liveness or readiness probes are initiated. Defaults to 0 seconds. Minimum value is 0.
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.
periodSeconds
How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.
successThreshold
Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness. Minimum value is 1.
ports
(optional)
privileged
(optional)
Flag to mark the container as privileged.
resourceLimitCpu
(optional)
Kubernetes Resources Limit of CPU This value can be set to control the CPU resource limit passed when creating the Jenkins agent Docker container in Kubernetes. Unlike a resource request, this is the upper limit of resources used by your Jenkins Agent container. When left blank, the defaults of your Kubernetes cluster will be used. For more info, see the
Kubernetes docs. e.g. `500m`.
resourceLimitEphemeralStorage
(optional)
resourceLimitMemory
(optional)
Kubernetes Resources Limit of Memory This value can be set to control the memory resource limit passed when creating the Jenkins agent Docker container in Kubernetes. Unlike a resource request, this is the upper limit of resources used by your Jenkins Agent container. When left blank, the defaults of your Kubernetes cluster will be used. For more info, see the
Kubernetes docs. e.g. `250Mi`.
resourceRequestCpu
(optional)
Kubernetes Resources Request of CPU This value can be set to control the CPU resources requested when creating the Jenkins agent Docker container in Kubernetes. When left blank, the defaults of your Kubernetes cluster will be used. For more info, see the
Kubernetes docs. e.g. `500m`.
resourceRequestEphemeralStorage
(optional)
resourceRequestMemory
(optional)
Kubernetes Resources Request of Memory This value can be set to control the memory resources requested when creating the Jenkins agent Docker container in Kubernetes. When left blank, the defaults of your Kubernetes cluster will be used. For more info, see the
Kubernetes docs. e.g. `250Mi`.
runAsGroup
(optional)
Specify the gid to run as.
runAsUser
(optional)
Specify the uid to run as.
shell
(optional)
ttyEnabled
(optional)
Whether this container should allocate a TTY for itself.
workingDir
(optional)
Path to the root of the workspace from the view point of this container, such as /home/jenkins/agent.
envVars
- Type:
java.util.Map<java.lang.String, java.lang.String>
volumes
Array / List of Nested Choice of Objects
configMapVolume
mountPath
Path to mount this volume inside the pod.
configMapName
The name of the Kubernetes Config Map to mount into the pod.
optional
Whether or not this configmap needs to exist.
emptyDirVolume
hostPathVolume
nfsVolume
persistentVolumeClaim
secretVolume
mountPath
Path to mount this volume inside the pod.
secretName
The name of the Kubernetes Secret to mount into the pod.
defaultMode
The file permissions for the secret volume. Does not support Octal notation.
optional
Whether or not the secret needs to exist.
serviceAccount
The service account to use.
nodeSelector
Specify which nodes the pod should operate on by providing a comma separated list of node labels: `label1=value1,label2=value2`.
workingDir
labels
- Type:
java.util.Map<java.lang.String, java.lang.String>
Was this page helpful?
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.