Skip to content

Commit

Permalink
Possible fix for hostPath permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaronator committed Jun 24, 2023
1 parent 4dcab86 commit 547906f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
21 changes: 20 additions & 1 deletion .charts/generic-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
{{- include "generic-service.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicas }}
revisionHistoryLimit: 3
revisionHistoryLimit: 2
strategy:
type: {{ .Values.strategyType }}
selector:
Expand All @@ -24,6 +24,25 @@ spec:
serviceAccountName: {{ include "generic-service.name" . }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.hostPaths }}
initContainers:
- name: prepare-storage
image: busybox:1.36.1
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
command:
- sh
- -c
{{- range .Values.hostPaths }}
- chmod -R 777 {{ .containerPath | quote }}
{{- end }}
volumeMounts:
{{- range .Values.hostPaths }}
- name: {{ .name }}
mountPath: {{ .containerPath | quote }}
{{- end }}
{{- end }}
containers:
- name: {{ include "generic-service.name" . }}
securityContext: {{- toYaml .Values.securityContext | nindent 10 }}
Expand Down
12 changes: 3 additions & 9 deletions crypto/monero-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ args:
- "--no-igd"
- "--no-zmq"

replicas: 0

hostPaths:
- name: data
hostPath: /srv/nvme/scrap-data/monero
containerPath: /root/.bitmonero

# pvcPaths:
# - name: data
# class: scrap-data
# path: /root/.bitmonero
containerPath: /home/monero/.bitmonero

ports:
- name: main
Expand All @@ -28,6 +25,3 @@ ports:
health:
host: monero.wagner.gg
path: "/get_info"

securityContext:
runAsUser: 0

0 comments on commit 547906f

Please sign in to comment.