Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update geoip job hooks and volume handling #1529

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,post-upgrade"
"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,pre-upgrade"
"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
# mountPath of the volume containing the database
mountPath: ""
mountPath: "" # for example: /usr/share/GeoIP
# path to the geoip database inside the volumemount
path: ""
path: "" # for example: /usr/share/GeoIP/GeoLite2-City.mmdb

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