Skip to content

Commit

Permalink
Log the Log4Perl output to a sidecar container to make it available t…
Browse files Browse the repository at this point in the history
…o Kubernetes.ton
  • Loading branch information
hangy committed Sep 26, 2018
1 parent 3766824 commit 7608cc1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker/kubernetes/backend-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ data:
log4perl.rootLogger=TRACE, LOGFILE
log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
log4perl.appender.LOGFILE.filename=/mnt/podata/logs/log4perl.log
log4perl.appender.LOGFILE.filename=/var/log/log4perl.log
log4perl.appender.LOGFILE.mode=append
log4perl.appender.LOGFILE.layout=PatternLayout
Expand Down
12 changes: 12 additions & 0 deletions docker/kubernetes/backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
mountPath: "/opt/product-opener/html/images/products/"
- name: data
mountPath: "/mnt/podata/"
- name: varlog
mountPath: "/var/log"
containers:
- name: po-backend
image: openfoodfacts/productopener-backend
Expand All @@ -56,6 +58,14 @@ spec:
mountPath: "/opt/product-opener/html/images/products/"
- name: data
mountPath: "/mnt/podata/"
- name: varlog
mountPath: "/var/log"
- name: po-backend-log4perl
image: busybox
volumeMounts:
- name: varlog
mountPath: "/var/log"
args: [/bin/sh, -c, 'tail -n+1 -f /var/log/log4perl.log']
volumes:
- name: backend-config
configMap:
Expand All @@ -66,3 +76,5 @@ spec:
- name: data
persistentVolumeClaim:
claimName: po-data
- name: varlog
emptyDir: {}

0 comments on commit 7608cc1

Please sign in to comment.