apiVersion: v1
kind: Pod
metadata:
  name: web-with-logging
  labels:
    app: web-demo
spec:
  containers:
    # Main application container
    - name: nginx
      image: nginx:latest
      ports:
        - containerPort: 80
      volumeMounts:
        - name: logs
          mountPath: /var/log/nginx
    
    # Sidecar: Log processor
    - name: log-collector
      image: busybox:latest
      command: ['sh', '-c', 'tail -f /logs/access.log']
      volumeMounts:
        - name: logs
          mountPath: /logs
  
  # Shared volume between containers
  volumes:
    - name: logs
      emptyDir: {}
