hosswald commented on issue #10777:
URL: https://github.com/apache/druid/issues/10777#issuecomment-1209326361
@mstein11 much appreciated. However, I think I found an easier way (for me),
see below.
@FrankChen021 that did not help. The problem is, OpenShift mounts the volume
as owned by root:root.
To get around that, I had to convince OpenShift to let the container run
with the user defined in the Dockerfile:
`oc adm policy add-scc-to-user anyuid -z default kubeadmin`
and use an init container to set the permissions in
druid/templates/historical/statefulset.yaml (etc.):
```
initContainers:
- name: initcontainer
image: alpine:latest
command: [ "/bin/sh", "-c" ]
args:
- chown 1000:1000 /opt/druid/var/druid;
volumeMounts:
- mountPath: /opt/druid/var/druid/
name: data
```
Result:
```
PS C:\Users\...\helm\my-project> oc debug my-project-druid-historical-0 --
ls -dl /opt/druid/var/druid
Defaulting container name to druid.
Use 'oc describe pod/my-project-druid-historical-0-debug -n my-project' to
see all of the containers in this pod.
Debugging with pod/my-project-druid-historical-0-debug, original command:
<image entrypoint>
Waiting for pod to start ...
drwxrwx--- 7 druid druid 94 Aug 9 12:20 /opt/druid/var/druid
Removing debug pod ...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]