Skip to content

Commit

Permalink
fix: update geoip job hooks and volume handling
Browse files Browse the repository at this point in the history
  • Loading branch information
patsevanton committed Oct 11, 2024
1 parent 558e82b commit 3406f96
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
10 changes: 8 additions & 2 deletions charts/sentry/templates/deployment-geoip-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ kind: Job
metadata:
name: geoip-install-job
annotations:
"helm.sh/hook": "pre-install"
"helm.sh/hook-weight": "3"
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "9"
spec:
template:
spec:
initContainers:
- name: init-create-geoip-dir
image: busybox
command: ['sh', '-c', 'mkdir -p /usr/share/GeoIP']
volumeMounts:
- name: {{ .Values.geodata.volumeName }}
mountPath: {{ .Values.geodata.mountPath }}
- name: init-geoip-conf
image: busybox
command: ['sh', '-c', 'echo -e "AccountID $(echo $GEOIPUPDATE_ACCOUNT_ID)\nLicenseKey $(echo $GEOIPUPDATE_LICENSE_KEY)\nEditionIDs $(echo $GEOIPUPDATE_EDITION_IDS)" > /usr/share/GeoIP/GeoIP.conf']
Expand Down
3 changes: 3 additions & 0 deletions charts/sentry/templates/pvc-geoip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
"helm.sh/hook": "pre-install"
"helm.sh/hook-weight": "-1"
spec:
accessModes:
- ReadWriteMany
Expand Down
4 changes: 2 additions & 2 deletions charts/sentry/templates/relay/deployment-relay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ spec:
mountPath: /work/.relay/config.yml
subPath: config.yml
readOnly: true
{{- if .Values.geodata.volumeName }}
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
mountPath: {{ .Values.geodata.mountPath }}
{{- end }}
Expand Down Expand Up @@ -202,7 +202,7 @@ spec:
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
persistentVolumeClaim:
claimName: data-sentry-geoip
claimName: {{ .Values.geodata.volumeName }}
{{- end }}
{{- if .Values.relay.volumes }}
{{ toYaml .Values.relay.volumes | indent 6 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/sentry/templates/sentry/web/deployment-sentry-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ spec:
readOnly: true
- mountPath: {{ .Values.filestore.filesystem.path }}
name: sentry-data
{{- if .Values.geodata.volumeName }}
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
mountPath: {{ .Values.geodata.mountPath }}
{{- end }}
Expand Down Expand Up @@ -189,7 +189,7 @@ spec:
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
persistentVolumeClaim:
claimName: data-sentry-geoip
claimName: {{ .Values.geodata.volumeName }}
{{- end }}
{{- if .Values.sentry.web.volumes }}
{{ toYaml .Values.sentry.web.volumes | indent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
readOnly: true
- mountPath: {{ .Values.filestore.filesystem.path }}
name: sentry-data
{{- if .Values.geodata.volumeName }}
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
mountPath: {{ .Values.geodata.mountPath }}
{{- end }}
Expand Down Expand Up @@ -153,7 +153,7 @@ spec:
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
persistentVolumeClaim:
claimName: data-sentry-geoip
claimName: {{ .Values.geodata.volumeName }}
{{- end }}
{{- if .Values.sentry.workerEvents.priorityClassName }}
priorityClassName: "{{ .Values.sentry.workerEvents.priorityClassName }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
readOnly: true
- mountPath: {{ .Values.filestore.filesystem.path }}
name: sentry-data
{{- if .Values.geodata.volumeName }}
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
mountPath: {{ .Values.geodata.mountPath }}
{{- end }}
Expand Down Expand Up @@ -156,7 +156,7 @@ spec:
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
persistentVolumeClaim:
claimName: data-sentry-geoip
claimName: {{ .Values.geodata.volumeName }}
{{- end }}
{{- if .Values.sentry.workerTransactions.volumes }}
{{ toYaml .Values.sentry.workerTransactions.volumes | indent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ spec:
readOnly: true
- mountPath: {{ .Values.filestore.filesystem.path }}
name: sentry-data
{{- if .Values.geodata.volumeName }}
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
mountPath: {{ .Values.geodata.mountPath }}
{{- end }}
Expand Down Expand Up @@ -171,4 +171,9 @@ spec:
{{- if .Values.sentry.worker.volumes }}
{{ toYaml .Values.sentry.worker.volumes | indent 6 }}
{{- end }}
{{- if and .Values.geodata.volumeName .Values.geodata.accountID }}
- name: {{ .Values.geodata.volumeName }}
persistentVolumeClaim:
claimName: {{ .Values.geodata.volumeName }}
{{- end }}
{{- end }}
8 changes: 4 additions & 4 deletions charts/sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ geodata:
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
# storageClass: "-"
# storageClass: "" # for example: csi-s3
size: 1Gi
volumeName: ""
volumeName: "" # for example: data-sentry-geoip

Check failure on line 170 in charts/sentry/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

170:18 [comments] too few spaces before comment
# mountPath of the volume containing the database
mountPath: ""
mountPath: "" # for example: /usr/share/GeoIP

Check failure on line 172 in charts/sentry/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

172:17 [comments] too few spaces before comment
# path to the geoip database inside the volumemount
path: ""
path: "" # for example: /usr/share/GeoIP/GeoLite2-City.mmdb

Check failure on line 174 in charts/sentry/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

174:12 [comments] too few spaces before comment

sentry:
# to not generate a sentry-secret, use these 2 values to reference an existing secret
Expand Down

0 comments on commit 3406f96

Please sign in to comment.