39 lines
		
	
	
		
			755 B
		
	
	
	
		
			YAML
		
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			755 B
		
	
	
	
		
			YAML
		
	
	
	
apiVersion: v1
 | 
						|
kind: Pod
 | 
						|
metadata:
 | 
						|
  name: counter
 | 
						|
spec:
 | 
						|
  containers:
 | 
						|
  - name: count
 | 
						|
    image: busybox
 | 
						|
    args:
 | 
						|
    - /bin/sh
 | 
						|
    - -c
 | 
						|
    - >
 | 
						|
      i=0;
 | 
						|
      while true;
 | 
						|
      do
 | 
						|
        echo "$i: $(date)" >> /var/log/1.log;
 | 
						|
        echo "$(date) INFO $i" >> /var/log/2.log;
 | 
						|
        i=$((i+1));
 | 
						|
        sleep 1;
 | 
						|
      done      
 | 
						|
    volumeMounts:
 | 
						|
    - name: varlog
 | 
						|
      mountPath: /var/log
 | 
						|
  - name: count-log-1
 | 
						|
    image: busybox
 | 
						|
    args: [/bin/sh, -c, 'tail -n+1 -f /var/log/1.log']
 | 
						|
    volumeMounts:
 | 
						|
    - name: varlog
 | 
						|
      mountPath: /var/log
 | 
						|
  - name: count-log-2
 | 
						|
    image: busybox
 | 
						|
    args: [/bin/sh, -c, 'tail -n+1 -f /var/log/2.log']
 | 
						|
    volumeMounts:
 | 
						|
    - name: varlog
 | 
						|
      mountPath: /var/log
 | 
						|
  volumes:
 | 
						|
  - name: varlog
 | 
						|
    emptyDir: {}
 |