This tutorial demonstrates file sharing between an Ubuntu container and a Node.js container in the same Kubernetes Pod using a Jenkins pipeline.
By default, all containers within a Kubernetes Pod share the same filesystem. In this tutorial, we’ll demonstrate how to create a file in an Ubuntu container and then read it from a Node.js container within the same Pod using a Jenkins pipeline.
Containers in the same Pod share volumes and file systems, allowing seamless data exchange without additional configuration.
Once you commit and run this pipeline, Jenkins will create the Pod and execute both stages. The Ubuntu container writes ubuntu-$BUILD_ID.txt, and the Node.js container reads it immediately afterward.