15. Demo: Multi-Container Pods in Kubernetes 🔁 Shared Volume

Опубликовано: 31 Май 2025
на канале: TechOps Tutorials
30
2

Want to see Kubernetes multi-container pods in action? 🚀 In this demo, we’ll walk through creating a pod with two containers sharing data using an emptyDir volume — the classic sidecar pattern! Whether you're new to Kubernetes or brushing up on best practices, this hands-on guide makes it easy to understand how containers in a pod can collaborate using shared volumes.

✔️ Create a pod with two BusyBox containers
✔️ One container writes logs, the other reads them
✔️ Learn how emptyDir enables inter-container communication
✔️ Real-time log streaming with kubectl logs
✔️ Practical sidecar pattern example — made simple!

📺 Watch Part 1 (Theory + Slides):
👉    • 14. Kubernetes Multi-Container Pods Explained  

💬 Like what you see? Subscribe for more DevOps & Kubernetes demos!
🧠 Don’t forget to check out Part 1: “Kubernetes Multi-Container Pods Explained 🔍” for the theory.

📜 Commands Used in This Video:
vim multi-container-pod.yaml
kubectl apply -f multi-container-pod.yaml
kubectl get pods
kubectl logs shared-volume-pod -c writer
kubectl logs shared-volume-pod -c reader
kubectl exec -it shared-volume-pod -c reader -- sh
cat /data/log.txt
exit
kubectl delete pod shared-volume-pod

📚 Chapters
0:00 🚀 Intro to Multicontainer Pods
1:11 📝 Creating the YAML File
1:56 ✍️ Writer Container Setup
3:18 📖 Reader Container Setup
4:40 ☁️ EmptyDir Volume Explained
5:00 🔎 YAML File Review
6:01 ▶️ Applying the Pod
6:43 📊 Checking Container Logs
7:42 💻 Inspecting Shared File
8:25 ♻️ Pod Lifecycle & Debugging
8:59 🗑️ Deleting the Pod
9:29 💡 Demo Recap & Use Cases

#Kubernetes #MultiContainerPods #K8sDemo #SidecarPattern #DevOpsTools