I'm trying to containerize a workflow that touches nfs shares. For a successful run it requires user to have default uid:gid and also additional 4 or 5 groupid access. group ids are random and ideally i would like to avoid giving range of gid's in the yaml file. Is there an efficient way to get this done ? Would anyone be able to show any examples in yaml or point me to reference documents please. Thanks
The setting is called supplementalGroups
. Take a look at the example:
apiVersion: v1
kind: Pod
...
spec:
containers:
- name: ...
image: ...
volumeMounts:
- name: nfs
mountPath: /mnt
securityContext:
supplementalGroups:
- 5555
- 6666
- 12345
volumes:
- name: nfs
nfs:
server: <nfs_server_ip_or_host>
path: /opt/nfs