Closed supereagle closed 7 years ago
mkdir -f /docker/logs/${APP_NAME}/${POD_NAME}
rm -rf /apps/logs
ln -s /docker/logs/${APP_NAME}/${POD_NAME} /apps/logs
spec:
containers:
- env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
volumeMounts:
- mountPath: /docker/logs/
name: applogs
volumes:
- hostPath:
path: /apps/logs/
name: applogs
/apps/logs
as before/apps/logs/
, and reports the logs to log server
Requirements for log collection:
EVERY
pod