- A Jenkins server with the [Kubernetes Plugin][] and [Blue Ocean][] installed.
- A connected Kubernetes cluster configured as a cloud agent.
Jenkinsfile Overview
The followingJenkinsfile defines two stages: one running on Ubuntu, the other in a Node.js sidecar. They share the workspace via an emptyDir volume.
Executing the Pipeline
When this pipeline runs, Jenkins dynamically provisions a Pod with two containers—ubuntu-container (default) and node-container (sidecar)—sharing an emptyDir workspace volume.


Pipeline Log Example
The log below confirms the file created in the Ubuntu container is accessible in the Node.js container:Static Nodes vs. Dynamic Agents
You can run Jenkins jobs on:Dynamic agents help you package toolchains into container images, cutting down on idle resources and improving build scalability.