Hi people, I trying to change the owner of a mount point but in the pod shell I see this error:
chown: changing ownership of ‘/var/www/upload’: Operation not permitted
drwx------ 2 1001 1001 6144 May 9 16:26 /var/www/upload/
I thought that using the root user id in the securitycontext would be able to do it but it does not work:
spec:
terminationGracePeriodSeconds: 60
containers:
- name: test-sftp
securityContext:
runAsUser: 0
image: xxxxxxx.dkr.ecr.us-east-1.amazonaws.com/testsftp:x.x.x
command: ["sh", "-c", "chown 0:0 /var/www/upload"]
imagePullPolicy: IfNotPresent
ports:
- name: test-sftp
containerPort: 2222
protocol: TCP
volumeMounts:
- name: efs
mountPath: "/var/www/upload/"
I have tried, I understand that the root user ID is 0, I tried using it but it does not work:
securityContext:
fsGroup: 0
Any helps?