Complete the code to add a sidecar container named 'logger' to the pod spec.
containers:
- name: app
image: myapp:latest
- name: [1]
image: busybox
command: ['sh', '-c', 'tail -f /var/log/app.log']The sidecar container is named 'logger' to clearly indicate its role alongside the main app container.
Complete the code to mount a shared volume named 'shared-logs' to both containers.
volumes:
- name: shared-logs
emptyDir: {}
containers:
- name: app
image: myapp:latest
volumeMounts:
- name: shared-logs
mountPath: [1]
- name: logger
image: busybox
volumeMounts:
- name: shared-logs
mountPath: /var/logThe app container writes logs to '/app/logs', which is shared with the logger container mounted at '/var/log'.
Fix the error in the sidecar container's command to continuously output logs.
containers:
- name: logger
image: busybox
command: ['sh', '-c', [1]]The command 'tail -f' keeps the log output streaming continuously, which is needed for a sidecar logger.
Fill both blanks to define a pod with a main and sidecar container sharing a volume.
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
containers:
- name: main-app
image: myapp:latest
volumeMounts:
- name: [1]
mountPath: /app/logs
- name: sidecar-logger
image: busybox
volumeMounts:
- name: [2]
mountPath: /var/log
volumes:
- name: shared-logs
emptyDir: {}Both containers mount the same volume named 'shared-logs' to share log files.
Fill all three blanks to complete the sidecar container spec with proper image, command, and volume mount.
containers:
- name: sidecar-logger
image: [1]
command: ['sh', '-c', [2]]
volumeMounts:
- name: shared-logs
mountPath: [3]The sidecar uses the 'busybox' image, runs 'tail -f' to follow logs, and mounts the shared volume at '/var/log'.