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

Builds a docker image.
  • name
    The The name of the docker image.
    • Type: String
  • 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.
    • Type: String
  • ignorePatterns (optional)
      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.
    • Type: String
  • path (optional)
    The The path of the folder that contains the docker image.
    • Type: String
  • rm (optional)
    The Flag to remove intermediate layers.
    • Type: boolean
  • timeout (optional)
    The The amount of time to wait for the build to complete.
    • Type: long
  • 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.
    • Type: String

pushImage: Pushes a Docker Image

Pushes a docker image to a docker registry.
  • name
    The The name of the docker image.
    • Type: String
  • 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.
    • Type: String
  • 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.
    • Type: String
  • registry (optional)
    The Explicitly specify a remote registry if not present in the image repository.
    • Type: String
  • tag (optional)
    • Type: String
  • timeout (optional)
    The The amount of time to wait for the push to complete.
    • Type: long
  • 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.
    • Type: String

tagImage: Tags a Docker Image

Tags a docker image.
  • name
    The The name of the docker image.
    • Type: String
  • tag
    The The tag.
    • Type: String
  • 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.
    • Type: String
  • force (optional)
    • Type: boolean
  • 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.
    • Type: String
  • repo (optional)
    The The image repository in which the tag will be created.
    • Type: String
  • 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.
    • Type: String

withPod: Run build steps in a MyPod

  • name
    • Type: String
  • containers
      Array/List
      Nested Object
    • name (optional)
      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.
      • Type: String
    • image (optional)
      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.
      • Type: String
    • alwaysPullImage (optional)
      • Type: boolean
    • args (optional)
      Arguments to pass to the command. ${computer.jnlpmac} and ${computer.name} are replaced with the agent secret and name respectively.
      • Type: String
    • command (optional)
      Override the image entrypoint with a different one
      • Type: String
    • envVars (optional)
      The environment variables to pass to the container.
        Array/List
        Nested Choice of Objects
      • containerEnvVar
        • key
          The environment variable key.
          • Type: String
        • value
          The environment variable value.
          • Type: String
      • envVar
        • key
          The environment variable key.
          • Type: String
        • value
          The environment variable value.
          • Type: String
      • podEnvVar
        • key
          The environment variable key.
          • Type: String
        • value
          The environment variable value.
          • Type: String
      • secretEnvVar
        • key
          The environment variable key.
          • Type: String
        • secretName
          Name of secret to lookup from Kubernetes.
          • Type: String
        • secretKey
          Key of secret to lookup from Kubernetes.
          • Type: String
    • livenessProbe (optional)
        Nested Object
      • execArgs
        Command executed by the liveness probe.
        • Type: String
      • timeoutSeconds
        • Type: int
      • initialDelaySeconds
        • Type: int
      • failureThreshold
        • Type: int
      • periodSeconds
        • Type: int
      • successThreshold
        • Type: int
    • ports (optional)
        Array/List
        Nested Object
      • name (optional)
        The name of the port
        • Type: String
      • containerPort (optional)
        Port to expose into the pod
        • Type: int
      • hostPort (optional)
        Port to expose onto the host
        • Type: int
    • privileged (optional)
      Flag to mark the container as privileged.
      • Type: boolean
    • 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`.
      • Type: String
    • 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`.
      • Type: String
    • 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`.
      • Type: String
    • 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`.
      • Type: String
    • shell (optional)
      • Type: String
    • ttyEnabled (optional)
      • Type: boolean
    • workingDir (optional)
      Path to the root of the workspace from the view point of this node, such as "/home/jenkins", this need not be absolute provided that the launcher establishes a consistent working directory, such as "./.jenkins-agent".
      • Type: String
  • envVars
      java.lang.String>
  • volumes
      Array/List
      Nested Choice of Objects
    • configMapVolume
      • mountPath
        Path to mount this volume inside the pod.
        • Type: String
      • configMapName
        The name of the Kubernetes Config Map to mount into the pod.
        • Type: String
    • emptyDirVolume
      • mountPath
        Path to mount this volume inside the pod.
        • Type: String
      • memory
        Flag for in-memory volume.
        • Type: boolean
    • hostPathVolume
      • hostPath
        File or directory on the host node's filesystem to mount into the pod.
        • Type: String
      • mountPath
        Path to mount this volume inside the pod.
        • Type: String
    • nfsVolume
      • serverAddress
        NFS Server Address.
        • Type: String
      • serverPath
        NFS Server Path.
        • Type: String
      • readOnly
        • Type: boolean
      • mountPath
        Path to mount this volume inside the pod.
        • Type: String
    • persistentVolumeClaim
      • mountPath
        Path to mount this volume inside the pod.
        • Type: String
      • claimName
        The claim name.
        • Type: String
      • readOnly
        Flag for read-only volume.
        • Type: boolean
    • secretVolume
      • mountPath
        Path to mount this volume inside the pod.
        • Type: String
      • secretName
        The name of the Kubernetes Secret to mount into the pod.
        • Type: String
  • serviceAccount
    The service account to use.
    • Type: String
  • nodeSelector
    Specify which nodes the pod should operate on by providing a comma separated list of node labels: `label1=value1,label2=value2`.
    • Type: String
  • workingDir
    • Type: String
  • labels
      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.