configure file system in each node using kubernetes daemonset configure file system in each node using kubernetes daemonset kubernetes kubernetes

configure file system in each node using kubernetes daemonset


This is what I did to address this issue :

  1. 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
  1. Pass these values in cm as an ENV 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
  1. Write a script that will run inside the above mentioned container.

This configured all the nodes with the changes that I needed.