100 días de DevOps: día 54

Día 54: Optimiza tu blog con un H2 SEO amigable a buscadores y atractivo para tus lectores. Enseña cómo crearlo de manera rápida y efectiva.

3 oct 2025 • 3 min read • Q2BSTUDIO Team

100 Días de DevOps: Día 54 - Genera un H2 para mi blog

Dominar volúmenes compartidos en Kubernetes es clave cuando las aplicaciones en contenedores necesitan intercambiar datos temporales de forma eficiente. En este artículo explico un caso práctico en el que configuramos un volumen emptyDir compartido entre dos contenedores dentro del mismo Pod.

Objetivo: compartir datos temporales

Crear un Pod llamado volume-share-xfusion que despliegue dos contenedores usando la imagen fedora:latest. Definir un volumen compartido llamado volume-share de tipo emptyDir y montarlo en rutas distintas en cada contenedor: /tmp/beta en el primero y /tmp/apps en el segundo. Comprobar que los archivos creados desde un contenedor son inmediatamente visibles desde el otro.

Solución: manifest YAML del Pod

apiVersion: v1

kind: Pod

metadata:

name: volume-share-xfusion

spec:

volumes:

- name: volume-share

emptyDir: {}

containers:

- name: volume-container-xfusion-1

image: fedora:latest

command: [ /bin/sh, -c, sleep 3600 ]

volumeMounts:

- name: volume-share

mountPath: /tmp/beta

- name: volume-container-xfusion-2

image: fedora:latest

command: [ /bin/sh, -c, sleep 3600 ]

volumeMounts:

- name: volume-share

mountPath: /tmp/apps

Por qué funciona

emptyDir crea un directorio en el nodo cuando el Pod se asigna y comparte su ciclo de vida con el Pod. Ambos contenedores montan el mismo volumen volume-share por eso acceden al mismo espacio en el sistema de archivos del nodo, lo que lo convierte en una solución ideal para compartir archivos temporales entre contenedores estrechamente acoplados.

Ejecución y verificación

Despliega el Pod con kubectl apply -f pod.yaml

Para crear un archivo desde el primer contenedor puedes entrar en su shell con kubectl exec -it volume-share-xfusion -c volume-container-xfusion-1 -- /bin/bash y dentro del contenedor ejecutar echo Shared volume test > /tmp/beta/beta.txt

Verifica en el segundo contenedor listando la ruta compartida con kubectl exec -it volume-share-xfusion -c volume-container-xfusion-2 -- ls /tmp/apps Deberías ver el archivo beta.txt inmediatamente, lo que confirma que el volumen compartido funciona correctamente.

Aplicaciones reales y servicios relacionados

Este patrón es útil en aplicaciones a medida y arquitecturas de microservicios que requieren compartir cachés, colas locales o datos temporales entre contenedores. En Q2BSTUDIO diseñamos soluciones de software a medida y aplicaciones a medida optimizadas para entornos cloud y contenedorización. Si tu proyecto necesita desplegar Kubernetes en infraestructuras gestionadas, podemos ayudarte con servicios cloud aws y azure y con la integración de pipelines seguros y eficientes. Conecta tus necesidades de desarrollo con nuestra experiencia en inteligencia artificial y servicios inteligencia de negocio para sacar más valor a los datos.

Conoce nuestros servicios de despliegue cloud y soluciones a medida en servicios cloud AWS y Azure y descubre cómo desarrollamos software a medida y aplicaciones a medida para empresas que necesitan escalabilidad, seguridad y continuidad operacional.

Además de orquestación y despliegue, en Q2BSTUDIO ofrecemos especialización en inteligencia artificial, ia para empresas, agentes IA, ciberseguridad y pentesting, servicios inteligencia de negocio y soluciones con power bi. Nuestro enfoque integral garantiza que tus aplicaciones no solo funcionen, sino que sean seguras, observables y capaces de aprovechar datos y modelos para generar valor.

Si quieres una consultoría o una prueba de concepto para compartir volúmenes, integrar pipelines CI CD o llevar tus aplicaciones a la nube con seguridad y rendimiento, contacta con Q2BSTUDIO y te acompañaremos en cada fase del proyecto.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.

Live Chat