Skip to content

Commit 93e598a

Browse files
authored
feat: persistence improvements (#1853)
1 parent 8101fb9 commit 93e598a

14 files changed

+92
-9
lines changed

charts/sentry/templates/deployment-geoip-job.yaml renamed to charts/sentry/templates/geoip/deployment-geoip-job.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ metadata:
88
"helm.sh/hook-weight": "9"
99
spec:
1010
template:
11+
metadata:
12+
{{- if .Values.geodata.annotations }}
13+
annotations:
14+
{{ toYaml .Values.geodata.annotations | indent 8 }}
15+
{{- end }}
1116
spec:
17+
{{- if .Values.serviceAccount.enabled }}
18+
serviceAccountName: {{ .Values.serviceAccount.name }}-geoip
19+
{{- end }}
1220
initContainers:
1321
- name: init-create-geoip-dir
1422
image: busybox

charts/sentry/templates/pvc-geoip.yaml renamed to charts/sentry/templates/geoip/pvc-geoip.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ metadata:
88
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
99
release: "{{ .Release.Name }}"
1010
heritage: "{{ .Release.Service }}"
11-
annotations:
12-
"helm.sh/hook": "pre-install,pre-upgrade"
13-
"helm.sh/hook-weight": "-1"
1411
spec:
1512
accessModes:
16-
- ReadWriteMany
13+
{{- range .Values.geodata.persistence.accessModes }}
14+
- {{ . | quote }}
15+
{{- end }}
1716
resources:
1817
requests:
1918
storage: {{ .Values.geodata.persistence.size }}
19+
{{- if and (.Values.geodata.persistence.lookupVolumeName) (lookup "v1" "PersistentVolumeClaim" .Release.Namespace "data-sentry-geoip") }}
20+
volumeName: {{ (lookup "v1" "PersistentVolumeClaim" .Release.Namespace "data-sentry-geoip").spec.volumeName }}
21+
{{- end }}
2022
{{- if .Values.geodata.persistence.storageClass }}
2123
storageClassName: {{ .Values.geodata.persistence.storageClass | quote }}
2224
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if and .Values.geodata.accountID .Values.serviceAccount.enabled }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ .Values.serviceAccount.name }}-geoip
6+
{{- if .Values.serviceAccount.annotations }}
7+
annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }}
8+
{{- end }}
9+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
10+
{{- end }}
11+

charts/sentry/templates/pvc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ spec:
1515
resources:
1616
requests:
1717
storage: {{ .Values.filestore.filesystem.persistence.size | quote }}
18+
{{- if and (.Values.filestore.filesystem.persistence.lookupVolumeName) (lookup "v1" "PersistentVolumeClaim" .Release.Namespace (printf "%s-data" (include "sentry.fullname" .))) }}
19+
volumeName: {{ (lookup "v1" "PersistentVolumeClaim" .Release.Namespace (printf "%s-data" (include "sentry.fullname" .))).spec.volumeName }}
20+
{{- end }}
1821
{{- if .Values.filestore.filesystem.persistence.storageClass }}
1922
{{- if (eq "-" .Values.filestore.filesystem.persistence.storageClass) }}
2023
storageClassName: ""

charts/sentry/templates/relay/deployment-relay.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ spec:
163163
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
164164
- name: {{ .Values.geodata.volumeName }}
165165
mountPath: {{ .Values.geodata.mountPath }}
166+
readOnly: true
166167
{{- end }}
167168
{{- if .Values.relay.volumeMounts }}
168169
{{ toYaml .Values.relay.volumeMounts | indent 10 }}
@@ -212,7 +213,7 @@ spec:
212213
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
213214
- name: {{ .Values.geodata.volumeName }}
214215
persistentVolumeClaim:
215-
claimName: {{ .Values.geodata.volumeName }}
216+
claimName: data-sentry-geoip
216217
{{- end }}
217218
{{- if .Values.relay.volumes }}
218219
{{ toYaml .Values.relay.volumes | indent 6 }}

charts/sentry/templates/sentry/vroom/pvc-vroom.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ spec:
2121
resources:
2222
requests:
2323
storage: {{ .Values.vroom.persistence.size | quote }}
24+
{{- if and (.Values.vroom.persistence.lookupVolumeName) (lookup "v1" "PersistentVolumeClaim" .Release.Namespace "sentry-vroom-pvc") }}
25+
volumeName: {{ (lookup "v1" "PersistentVolumeClaim" .Release.Namespace "sentry-vroom-pvc").spec.volumeName }}
26+
{{- end }}
2427
{{- if .Values.vroom.persistence.storageClassName }}
2528
storageClassName: {{ .Values.vroom.persistence.storageClassName | quote }}
2629
{{- end }}

charts/sentry/templates/sentry/web/deployment-sentry-web.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ spec:
121121
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
122122
- name: {{ .Values.geodata.volumeName }}
123123
mountPath: {{ .Values.geodata.mountPath }}
124+
readOnly: true
124125
{{- end }}
125126
{{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }}
126127
- name: sentry-google-cloud-key
@@ -200,7 +201,7 @@ spec:
200201
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
201202
- name: {{ .Values.geodata.volumeName }}
202203
persistentVolumeClaim:
203-
claimName: {{ .Values.geodata.volumeName }}
204+
claimName: data-sentry-geoip
204205
{{- end }}
205206
{{- if .Values.sentry.web.volumes }}
206207
{{ toYaml .Values.sentry.web.volumes | indent 6 }}

charts/sentry/templates/sentry/worker/deployment-sentry-worker-events.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ spec:
116116
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
117117
- name: {{ .Values.geodata.volumeName }}
118118
mountPath: {{ .Values.geodata.mountPath }}
119+
readOnly: true
119120
{{- end }}
120121
{{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }}
121122
- name: sentry-google-cloud-key
@@ -173,7 +174,7 @@ spec:
173174
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
174175
- name: {{ .Values.geodata.volumeName }}
175176
persistentVolumeClaim:
176-
claimName: {{ .Values.geodata.volumeName }}
177+
claimName: data-sentry-geoip
177178
{{- end }}
178179
{{- if .Values.sentry.workerEvents.priorityClassName }}
179180
priorityClassName: "{{ .Values.sentry.workerEvents.priorityClassName }}"

charts/sentry/templates/sentry/worker/deployment-sentry-worker-transactions.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ spec:
116116
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
117117
- name: {{ .Values.geodata.volumeName }}
118118
mountPath: {{ .Values.geodata.mountPath }}
119+
readOnly: true
119120
{{- end }}
120121
{{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }}
121122
- name: sentry-google-cloud-key
@@ -176,7 +177,7 @@ spec:
176177
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
177178
- name: {{ .Values.geodata.volumeName }}
178179
persistentVolumeClaim:
179-
claimName: {{ .Values.geodata.volumeName }}
180+
claimName: data-sentry-geoip
180181
{{- end }}
181182
{{- if .Values.sentry.workerTransactions.volumes }}
182183
{{ toYaml .Values.sentry.workerTransactions.volumes | indent 6 }}

0 commit comments

Comments
 (0)