Please enable Javascript to view the contents
Kubernetes-使用初始化容器修改挂卷的权限
重要
配置
Deployment中配置举例
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| spec:
selector:
matchLabels:
app: {{ template "common.name" . }}
replicas: {{ .Values.deploymentReplicas }}
template:
metadata:
name: {{ template "common.name" . }}
annotations:
container.security.alpha.kubernetes.io/{{- template "common.name" . -}}: "runtime/default"
labels:
app: {{ template "common.name" . }}
release: "{{ .Release.Name }}"
spec:
{{- if .Values.persistenceEnabled}}
initContainers:
- name: volume-permissions
image: reg.chebai.org/paas/busybox:latest
command: ['sh', '-c', 'chmod -R 777 {{ .Values.volumeMounts.mountPath | quote }}']
volumeMounts:
- mountPath: {{ .Values.volumeMounts.mountPath | quote }}
name: {{ $.Values.serviceName }}-nfs
{{- end }}
|
Reference
作者
Hex
CloudNative Developer