You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When hostpath (and probably PVC) used as Storage clickhouse server fail to write anything to /var/lib/clickhouse/ as server process running with user id 105.
the files or directories created on the underlying hosts are only writable by root. You either need to run your process as root in a privileged Container or modify the file permissions on the host to be able to write to a hostPath volume
I've solved that by adding additional init container to clickhouse template (first one, before config container):
initContainers:
- name: chown
image: alpine:3.6
securityContext:
runAsUser: 0
fsGroup: 0
command:
- '/bin/sh'
- '-c'
- chown -R 105:106 /var/lib/clickhouse/
volumeMounts:
{{- if .Values.storage.hostpath }}
- name: hostpath
mountPath: /var/lib/clickhouse/
{{- end }}
{{- if .Values.storage.pvc }}
- name: {{ .Values.storage.pvc.name }}
mountPath: /var/lib/clickhouse/
{{- end }}
{{- if .Values.storage.emptyDir }}
- name: data
mountPath: /var/lib/clickhouse/
{{- end }}
BTW, emptyDir works well without any modifications as volume created with correct owner when runAsUser used in securityContext.
The text was updated successfully, but these errors were encountered:
Hi!
When
hostpath
(and probably PVC) used as Storage clickhouse server fail to write anything to/var/lib/clickhouse/
as server process running with user id 105.Regarding to hostPath documentation:
I've solved that by adding additional init container to clickhouse template (first one, before
config
container):BTW,
emptyDir
works well without any modifications as volume created with correct owner whenrunAsUser
used insecurityContext
.The text was updated successfully, but these errors were encountered: