mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-20 00:15:11 +00:00
we need to add the dateformat option so that the logrotate
can create unique logfiles for each rotation. Without this,
we logrotation is skipped with message like (generated in
verbose mode of logrotate):
rotating log /var/log/rotate-test.log, log->rotateCount is 5
dateext suffix '-20160718'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/rotate-test2.log-20160718.gz already exists, skipping rotation
Tested as follows:
# config in '/etc/logrotate.d/rotate-test':
/var/log/rotate-test.log {
rotate 5
copytruncate
missingok
notifempty
compress
maxsize 100M
daily
dateext
dateformat -%Y%m%d-%s
create 0644 root root
}
# create 150Mb of /var/log/rotate-test.log
$ dd if=/dev/zero of=/var/log/rotate-test.log bs=1048576 count=150 conv=notrunc oflag=append
# run logrotate
$ /usr/sbin/logrotate -v /etc/logrotate.conf
...
rotating pattern: /var/log/rotate-test.log after 1 days (5 rotations)
empty log files are not rotated, log files >= 104857600 are rotated earlier, old logs are removed
considering log /var/log/rotate-test.log
log needs rotating
rotating log /var/log/rotate-test.log, log->rotateCount is 5
Converted ' -%Y%m%d-%s' -> '-%Y%m%d-%s'
dateext suffix '-20160718-1468875268'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
copying /var/log/rotate-test.log to /var/log/rotate-test.log-20160718-1468875268
truncating /var/log/rotate-test.log
compressing log with: /bin/gzip
Repeating 'dd' and 'logrotate' commands now generate logfiles correctly.
This directory forms the base of the main SaltStack configuration. The
place to start with any SaltStack configuration is
top.sls. However, unless you are particularly keen on
reading Jinja templates, the following tables break down what
configurations run on what providers. (NB: The _states
directory is a special directory included by Salt for ensure blocks,
and is only used for the docker config.)
Key: M = Config applies to master, n = config applies to nodes
| Config | GCE | Vagrant | AWS | Azure |
|---|---|---|---|---|
| debian-auto-upgrades | M n | M n | M n | M n |
| docker | M n | M n | M n | M n |
| etcd | M | M | M | M |
| fluentd-es (pillar conditional) | M n | M n | M n | M n |
| fluentd-gcp (pillar conditional) | M n | M n | M n | M n |
| generate-cert | M | M | M | M |
| kube-addons | M | M | M | M |
| kube-apiserver | M | M | M | M |
| kube-controller-manager | M | M | M | M |
| kube-proxy | n | n | n | n |
| kube-scheduler | M | M | M | M |
| kubelet | M n | M n | M n | M n |
| logrotate | M n | n | M n | M n |
| supervisord | M n | M n | M n | M n |
| nginx | M | |||
| openvpn-client | n | |||
| openvpn | M | |||
| base | M n | M n | M n | M n |
| kube-client-tools | M | M | M | M |