Added cron container, for logs rotating

Closes-Bug: 1615598
Change-Id: I9ffaf4c2429f80821e5efbabd4d2a70ed2650d35
This commit is contained in:
Proskurin Kirill 2016-08-19 16:45:34 +02:00
parent b78237a53e
commit acdd220ded
5 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,8 @@
FROM {{ namespace }}/base-tools:{{ tag }}
MAINTAINER {{ maintainer }}
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y install --no-install-recommends \
cron \
logrotate \
&& apt-get clean

38
service/cron.yaml Normal file
View File

@ -0,0 +1,38 @@
service:
name: cron
daemonset: true
containers:
- name: cron
image: cron
probes:
readiness: "true"
liveness: "true"
volumes:
- name: mysql-logs
path: "/var/log/ccp/mysql"
type: host
readOnly: False
- name: rabbitmq-logs
path: "/var/log/ccp/rabbitmq"
type: host
readOnly: False
- name: keystone-logs
path: "/var/log/ccp/keystone"
type: host
readOnly: False
- name: horizon-logs
path: "/var/log/ccp/horizon"
type: host
readOnly: False
daemon:
command: cron -f
files:
- logrotate.conf
- logrotate-services.conf
files:
logrotate.conf:
path: /etc/logrotate.conf
content: cron-logrotate-global.conf.j2
logrotate-services.conf:
path: /etc/logrotate.d/logrotate-services.conf
content: cron-logrotate-services.conf.j2

View File

@ -0,0 +1,12 @@
{{ cron_rotate_interval }}
rotate {{ cron_rotate_days }}
copytruncate
compress
delaycompress
notifempty
missingok
minsize {{ cron_rotate_minsize }}
maxsize {{ cron_rotate_maxsize }}
include /etc/logrotate.d

View File

@ -0,0 +1,12 @@
{% set services = [
'mysql',
'rabbitmq',
'keystone',
'horizon',
]
%}
{% for service in services %}
"/var/log/ccp/{{ service }}/*.log"
{}
{% endfor %}

View File

@ -15,6 +15,10 @@ configs:
influxdb_port: 8086
influxdb_user: ""
snap_log_level: 3
cron_rotate_interval: "daily"
cron_rotate_days: 6
cron_rotate_minsize: "1M"
cron_rotate_maxsize: "100M"
versions:
influxdb_version: "0.13.0"
grafana_version: "3.0.3-1463994644"