-
Notifications
You must be signed in to change notification settings - Fork 563
feat: enhance worker deployments with additional packages and CA certificates #1944
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
base: develop
Are you sure you want to change the base?
Changes from all commits
9ea1f71
7eb3fa2
02a7e04
5a41419
18695e8
954e415
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,10 +78,20 @@ spec: | |
| - name: {{ .Chart.Name }}-worker | ||
| image: "{{ template "sentry.image" . }}" | ||
| imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }} | ||
| command: ["sentry"] | ||
| command: ["/bin/bash", "-c"] | ||
| args: | ||
| - "run" | ||
| - "worker" | ||
| - | | ||
| {{- if .Values.sentry.workerEvents.installAdditionalPackages }} | ||
| pip install {{ range .Values.sentry.workerEvents.installAdditionalPackages }}{{ . }} {{ end }} | ||
| {{- end }} | ||
| {{- if .Values.sentry.workerEvents.caCertificatesSecret }} | ||
| mkdir -p /usr/local/share/ca-certificates/ | ||
| for c in $(ls -1 /usr/local/share/ca-certificates/); do | ||
| cat /usr/local/share/ca-certificates/$c >> $(python3 -m certifi) && echo >> $(python3 -m certifi) | ||
| done | ||
| update-ca-certificates | ||
| {{- end }} | ||
| sentry run worker | ||
|
Comment on lines
+83
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the first comment |
||
| - "-Q" | ||
| - {{ .Values.sentry.workerEvents.queues }} | ||
| {{- if .Values.sentry.workerEvents.concurrency }} | ||
|
|
@@ -122,6 +132,11 @@ spec: | |
| - name: sentry-google-cloud-key | ||
| mountPath: /var/run/secrets/google | ||
| {{ end }} | ||
| {{- if .Values.sentry.workerEvents.caCertificatesSecret }} | ||
| - name: ca-certificates | ||
| mountPath: /usr/local/share/ca-certificates | ||
| readOnly: true | ||
| {{- end }} | ||
| {{- if .Values.sentry.workerEvents.volumeMounts }} | ||
| {{ toYaml .Values.sentry.workerEvents.volumeMounts | indent 8 }} | ||
| {{- end }} | ||
|
|
@@ -182,4 +197,10 @@ spec: | |
| {{- if .Values.sentry.workerEvents.volumes }} | ||
| {{ toYaml .Values.sentry.workerEvents.volumes | indent 6 }} | ||
| {{- end }} | ||
| {{- if .Values.sentry.workerEvents.caCertificatesSecret }} | ||
| - name: ca-certificates | ||
| secret: | ||
| secretName: {{ .Values.sentry.workerEvents.caCertificatesSecret }} | ||
| defaultMode: 0644 | ||
| {{- end }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,10 +78,20 @@ spec: | |
| - name: {{ .Chart.Name }}-worker | ||
| image: "{{ template "sentry.image" . }}" | ||
| imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }} | ||
| command: ["sentry"] | ||
| command: ["/bin/bash", "-c"] | ||
| args: | ||
| - "run" | ||
| - "worker" | ||
| - | | ||
| {{- if .Values.sentry.workerTransactions.installAdditionalPackages }} | ||
| pip install {{ range .Values.sentry.workerTransactions.installAdditionalPackages }}{{ . }} {{ end }} | ||
| {{- end }} | ||
| {{- if .Values.sentry.workerTransactions.caCertificatesSecret }} | ||
| mkdir -p /usr/local/share/ca-certificates/ | ||
| for c in $(ls -1 /usr/local/share/ca-certificates/); do | ||
| cat /usr/local/share/ca-certificates/$c >> $(python3 -m certifi) && echo >> $(python3 -m certifi) | ||
| done | ||
| update-ca-certificates | ||
| {{- end }} | ||
| sentry run worker | ||
|
Comment on lines
+83
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the first comment |
||
| - "-Q" | ||
| - {{ .Values.sentry.workerTransactions.queues }} | ||
| {{- if .Values.sentry.workerTransactions.concurrency }} | ||
|
|
@@ -122,6 +132,11 @@ spec: | |
| - name: sentry-google-cloud-key | ||
| mountPath: /var/run/secrets/google | ||
| {{ end }} | ||
| {{- if .Values.sentry.workerTransactions.caCertificatesSecret }} | ||
| - name: ca-certificates | ||
| mountPath: /usr/local/share/ca-certificates | ||
| readOnly: true | ||
| {{- end }} | ||
| {{- if .Values.sentry.workerTransactions.volumeMounts }} | ||
| {{ toYaml .Values.sentry.workerTransactions.volumeMounts | indent 8 }} | ||
| {{- end }} | ||
|
|
@@ -182,4 +197,10 @@ spec: | |
| {{- if .Values.sentry.workerTransactions.volumes }} | ||
| {{ toYaml .Values.sentry.workerTransactions.volumes | indent 6 }} | ||
| {{- end }} | ||
| {{- if .Values.sentry.workerTransactions.caCertificatesSecret }} | ||
| - name: ca-certificates | ||
| secret: | ||
| secretName: {{ .Values.sentry.workerTransactions.caCertificatesSecret }} | ||
| defaultMode: 0644 | ||
| {{- end }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,10 +78,20 @@ spec: | |
| - name: {{ .Chart.Name }}-worker | ||
| image: "{{ template "sentry.image" . }}" | ||
| imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }} | ||
| command: ["sentry"] | ||
| command: ["/bin/bash", "-c"] | ||
| args: | ||
| - "run" | ||
| - "worker" | ||
| - | | ||
| {{- if .Values.sentry.worker.installAdditionalPackages }} | ||
| pip install {{ range .Values.sentry.worker.installAdditionalPackages }}{{ . }} {{ end }} | ||
| {{- end }} | ||
| {{- if .Values.sentry.worker.caCertificatesSecret }} | ||
| mkdir -p /usr/local/share/ca-certificates/ | ||
| for c in $(ls -1 /usr/local/share/ca-certificates/); do | ||
| cat /usr/local/share/ca-certificates/$c >> $(python3 -m certifi) && echo >> $(python3 -m certifi) | ||
| done | ||
| update-ca-certificates | ||
| {{- end }} | ||
| sentry run worker | ||
|
Comment on lines
+83
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the first comment |
||
| {{- if .Values.sentry.worker.excludeQueues }} | ||
| - "--exclude-queues" | ||
| - "{{ .Values.sentry.worker.excludeQueues }}" | ||
|
|
@@ -129,6 +139,11 @@ spec: | |
| - name: sentry-google-cloud-key | ||
| mountPath: /var/run/secrets/google | ||
| {{ end }} | ||
| {{- if .Values.sentry.worker.caCertificatesSecret }} | ||
| - name: ca-certificates | ||
| mountPath: /usr/local/share/ca-certificates | ||
| readOnly: true | ||
| {{- end }} | ||
| {{- if .Values.sentry.worker.volumeMounts }} | ||
| {{ toYaml .Values.sentry.worker.volumeMounts | indent 8 }} | ||
| {{- end }} | ||
|
|
@@ -195,4 +210,10 @@ spec: | |
| {{- if .Values.global.volumes }} | ||
| {{ toYaml .Values.global.volumes | indent 6 }} | ||
| {{- end }} | ||
| {{- if .Values.sentry.worker.caCertificatesSecret }} | ||
| - name: ca-certificates | ||
| secret: | ||
| secretName: {{ .Values.sentry.worker.caCertificatesSecret }} | ||
| defaultMode: 0644 | ||
| {{- end }} | ||
| {{- end }} | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly about
/bin/bash -c, it accepts exactly one argument. All the arguments after the first one will be ignored (well not really ignored but these args will be assigned to $0, $1, ...).$0 = --workers and $1 = 4, but
sentry run web(or the whole first string) doesn’t use $0 or $1, so those args don’t get passed to it.To make it work, you have to have:
You may want to add
set -euo pipefailso the container fails fast on errors.