Skip to content

Commit

Permalink
chown data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
slamdev committed Apr 8, 2020
1 parent 502d430 commit e05eccc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/weblate/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: weblate
description: |-
Helm chart to deploy [weblate](https://hub.docker.com/r/weblate/weblate/).
type: application
version: 0.0.1
version: 0.0.2
appVersion: "3.11.3-1"
home: https://github.com/slamdev/helm-charts/tree/master/charts/weblate
icon: https://weblate.org/static/weblate-180.png
Expand Down
5 changes: 3 additions & 2 deletions charts/weblate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ weblate
=======
Helm chart to deploy [weblate](https://hub.docker.com/r/weblate/weblate/).

Current chart version is `0.0.1`
Current chart version is `0.0.2`

Source code can be found [here](https://github.com/slamdev/helm-charts/tree/master/charts/weblate)

Expand All @@ -13,6 +13,7 @@ Source code can be found [here](https://github.com/slamdev/helm-charts/tree/mast
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | affinity for scheduler pod assignment |
| chownDataVolumeAs | string | `"1000:1000"` | specifies an owner of data volume |
| env | list | `[]` | environment variables for the container |
| envFrom | list | `[]` | environment variable sources for the container |
| fullnameOverride | string | `""` | full name of the chart. |
Expand All @@ -28,7 +29,7 @@ Source code can be found [here](https://github.com/slamdev/helm-charts/tree/mast
| livenessProbe.httpGet.port | string | `"http"` | port for liveness probe |
| nameOverride | string | `""` | override name of the chart |
| nodeSelector | object | `{}` | node for scheduler pod assignment |
| podSecurityContext | object | `{}` | specifies security settings for a pod |
| podSecurityContext | object | `{"fsGroup":1000,"runAsUser":1000}` | specifies security settings for a pod |
| readinessProbe.httpGet.path | string | `"/healthz/"` | path for readiness probe |
| readinessProbe.httpGet.port | string | `"http"` | port for readiness probe |
| resources | object | `{}` | custom resource configuration |
Expand Down
11 changes: 11 additions & 0 deletions charts/weblate/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ spec:
serviceAccountName: {{ include "weblate.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: init
image: busybox
command:
- sh
- -c
args:
- chown -R {{ .Values.chownDataVolumeAs }} /app/data;
volumeMounts:
- mountPath: "/app/data"
name: data
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down
8 changes: 6 additions & 2 deletions charts/weblate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ serviceAccount:
name:

# podSecurityContext -- specifies security settings for a pod
podSecurityContext: {}
# fsGroup: 2000
podSecurityContext:
runAsUser: 1000
fsGroup: 1000

# chownDataVolumeAs -- specifies an owner of data volume
chownDataVolumeAs: "1000:1000"

# securityContext -- specifies security settings for a container
securityContext: {}
Expand Down

0 comments on commit e05eccc

Please sign in to comment.