Created
October 15, 2020 09:26
-
-
Save nilesh93/0183d4ecbbd9ae42549d2e5f1b830ac7 to your computer and use it in GitHub Desktop.
Pod Sidecar Log Stream Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: counter | |
spec: | |
containers: | |
- name: date | |
image: busybox | |
args: | |
- /bin/sh | |
- -c | |
- > | |
i=0; | |
while true; | |
do | |
echo "$i: $(date)" >> /var/log/date.log; | |
i=$((i+1)); | |
sleep 1; | |
done | |
volumeMounts: | |
- name: varlog | |
mountPath: /var/log | |
- name: date-log-stream | |
image: busybox | |
args: [/bin/sh, -c, 'tail -n+1 -f /var/log/date.log'] | |
volumeMounts: | |
- name: varlog | |
mountPath: /var/log | |
volumes: | |
- name: varlog | |
emptyDir: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment