I was trying to increase core dump retention and node disk capacity using kubernetes deamonset. I can increase the retention period like this using a bash script but how do I do it using daemonset.
echo "/var/lib/systemd/coredump 0755 root root 10d" > /etc/tmpfiles.d/<filename>.conf
.
In the same daemonset I want to increase the MaxUse
field of file /etc/systemd/coredump.conf
to 20%.
Is it possible to do it in the same daemonset? I know this can be done using a cronjob
but I don't want to use a cronjob.
Hopefully the given information helps. Thanks for the help.
This is what I did to address this issue :
apiVersion: v1
kind: ConfigMap
metadata:
name: core-cm
data:
core.retention-period: Xd
core.max-volume-use: XG
cm
as an ENV
variable inside the container of the daemonset and mount volume for the directories which needs to be changedenv:
- name: RETENTION_PERIOD
valueFrom:
configMapKeyRef:
name: core-cm
key: core.retention-period
- name: MAX_VOLUME_USE
valueFrom:
configMapKeyRef:
name: core-cm
key: core.max-volume-use
script
that will run inside the above mentioned container.This configured all the nodes with the changes that I needed.