configure file system in each node using kubernetes daemonset
This is what I did to address this issue :
- Create a config map which contains values for both retention period and MaxUse like this :
apiVersion: v1kind: ConfigMapmetadata: name: core-cmdata: core.retention-period: Xd core.max-volume-use: XG
- Pass these values in
cm
as anENV
variable inside the container of the daemonset and mount volume for the directories which needs to be changed
env: - 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
- Write a
script
that will run inside the above mentioned container.
This configured all the nodes with the changes that I needed.