Question & Answer
Question
How to create a DaemonSet to automatically apply a change to worker nodes?
Answer
Answer
This DaemonSet updates each worker node in your cluster to enable "no_root_squash" as described in the Accessing File Storage on Linux topic within the documentation. The deployment is configured to allow the pods to run in privileged mode, which is necessary to update the host file system. As always, be very careful when you allow privileged access.
Because it is a DaemonSet, new worker nodes that are added when the DaemonSet is running automatically have the changes applied.
Complete the following steps:
- Create the DaemonSet to enable "no_root_squash" using the following command:
kubectl apply -f norootsquash.yaml - List the worker nodes in your cluster to view the worker IDs using the following command:
bx cs workers <cluster-name> - Reboot all of the worker nodes to apply the changes using the following command:
bx cs worker-reboot <cluster-name> <worker-id1> <worker-id2>
To delete the DaemonSet, run the following command:
kubectl delete -f norootsquash.yaml
Deleting the DaemonSet will not back out changes that are made to the underlying nodes. Worker nodes that are added after this DaemonSet is removed will not have the changes applied.
Reference example: kube-sample-daemonset
Was this topic helpful?
Document Information
Modified date:
01 August 2019
UID
ibm1KB0011038