I am running kubernetes version 1.21 in a GKE environment. I require a pod to have privileged access so that it can configure and do File IO to the drives. My yaml file snippet is as follows:-
- name: imagepull-secrets
containers:
- name: test
image: {operator-repo}/test
securityContext:
privileged: true
imagePullPolicy: Always
command:
- /bin/bash
- -c
- test.sh
The pod is able to access the drives such as /dev/sdb,/dev/sdc,/dev/sdd etc. However, when I add drives via gcloud add command to the VM that is hosting the pod such as /dev/sde, this does not reflect in the /dev directory that the pod accesses.
Is this by design? Is the /dev not mounted into the pod? If so, how do make changes in the /dev directory visible to the pod.
One mechanism is to create volumeMounts. But shouldnt the privileged pods have full access to the /dev directory.