chown the whole directory makes it hang for loong time, even if most of the directoryu is already 1000:1000.
securityContext:
fsGroup: 1000
fsGroupChangePolicy: "OnRootMismatch"
should fix the issue.
When configuring a pod’s security context, set fsGroupChangePolicy to "OnRootMismatch" so if the root of the volume already has the correct permissions, the recursive permission change can be skipped. Kubernetes ensures that permissions of the top-level directory are changed last the first time it applies permissions
https://kubernetes.io/blog/2020/12/14/kubernetes-release-1.20-fsgroupchangepolicy-fsgrouppolicy/
chown the whole directory makes it hang for loong time, even if most of the directoryu is already 1000:1000.
should fix the issue.
https://kubernetes.io/blog/2020/12/14/kubernetes-release-1.20-fsgroupchangepolicy-fsgrouppolicy/