Containers in the same Pod share volumes and file systems, allowing seamless data exchange without additional configuration.
Jenkins Pipeline Configuration
Paste the following pipeline definition into your Jenkinsfile to set up two containers—ubuntu-container and node-container—in a single Pod:
Pipeline in Action
Once you commit and run this pipeline, Jenkins will create the Pod and execute both stages. The Ubuntu container writesubuntu-$BUILD_ID.txt, and the Node.js container reads it immediately afterward.


Console Output Example
Below is an excerpt from the Jenkins console log illustrating how the file is shared between containers:Comparing Jenkins Agent Strategies
Choose the right Jenkins agent model based on your infrastructure and maintenance requirements:| Agent Type | Description |
|---|---|
| Kubernetes Cloud Agent | On-demand Pods; auto-provisioned and cleaned up per job. |
| Docker Agent | Temporary containers managed by Jenkins; easy to customize. |
| Static Node | Always-on VMs or servers; requires manual OS and tool updates. |
Static nodes demand ongoing maintenance (OS patches, software upgrades). For most CI/CD workflows, dynamic agents reduce resource waste and simplify updates.