12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- ---
- apiVersion: v1
- kind: Namespace
- metadata:
- name: logging
- # create dameonset to rsync pod logs
- ---
- apiVersion: apps/v1
- kind: DaemonSet
- metadata:
- name: cron-logging
- namespace: logging
- labels:
- k8s-app: cron-logging
- spec:
- selector:
- matchLabels:
- k8s-app: cron-logging
- template:
- metadata:
- labels:
- k8s-app: cron-logging
- spec:
- containers:
- - name: rsync
- image: "eeacms/rsync:latest"
- imagePullPolicy: IfNotPresent
- args:
- - /bin/sh
- - -c
- - >
- mkdir -p /var/log/history/;
- while true;
- do
- rsync -ax /var/log/pods/ /var/log/history/;
- sleep 1;
- done
- volumeMounts:
- - mountPath: /var/log
- name: varlog
- volumes:
- - hostPath:
- path: /var/log
- name: varlog
|