I have a Pod with two containers.
apiVersion: v1
kind: Pod
metadata:
name: test
spec:
containers:
- name: my-container
image: google/my-container:v1
- name: third-party
image: google/third-party:v1
One container is my image and the second is third-party image which I can’t control its stdout/stderr.
I need that my-container will access logs written in third-party container.
Inside "my-container" I want to collect all the stdout and stderr from the "third-party" container, add some metadata and write it with my logger.
I cant use a privileged container with volumeMounts.
If I could do something like this it was great.
containers:
- name: my-container
image: google/my-container:v1
volumeMounts:
- name: varlog
mountPath: /var/log
- name: third-party
image: google/third-party:v1
stdout: /var/log/stdout
stderr: /var/log/stderr
volumes:
- name: varlog
emptyDir: {}