Skip to content

Commit

Permalink
feat!: ingest consumers and workers separation (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiIuzhaninYS authored May 14, 2024
1 parent c18ce9f commit 5969544
Show file tree
Hide file tree
Showing 19 changed files with 746 additions and 220 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ Big thanks to the maintainers of the [deprecated chart](https://github.com/helm/

For now the full list of values is not documented but you can get inspired by the values.yaml specific to each directory.

## Upgrading from 22.x.x Version of This Chart to 23.x.x

This version introduces changes to definitions of ingest-consumers and workers. These changes allow to balance
ingestion pipeline with more granularity.

### Major Changes

- **Ingest consumers**: Templates for Deployment and HPA manifests are now separate for ingest-consumer-events,
ingest-consumer-attachments and ingest-consumer-transactions.
- **Workers**: Templates for two additional worker Deployments added, each of them with its own HPA. By default they're
configured for error- and transaction-related tasks processing, but queues to consume can be redefined for both.

### Migration Guide

Since labels are immutable in k8s Deployments, `helm upgrade --force` should be used to recreate ingest-consumer Deployments.
As an alternative, existing ingest-consumer Deployments can be removed manually with `kubectl delete` before upgrading helm release.

## Upgrading from 21.x.x Version of This Chart to 22.x.x

This version introduces a significant change by dropping support for Kafka Zookeeper and transitioning to Kafka Kraft
Expand Down
6 changes: 5 additions & 1 deletion sentry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Note: this table is incomplete, so have a look at the values.yaml in case you mi
| `sentry.billingMetricsConsumer.enabled` | Enable Sentry billing metrics | `true` |
| `sentry.cron.enabled` | Enable Sentry cron | `true` |
| `sentry.genericMetricsConsumer.enabled` | Enable Sentry generic metrics consumer | `true` |
| `sentry.ingestConsumer.enabled` | Enable Sentry ingest consumer attachments, events, transactions | `true` |
| `sentry.ingestConsumerAttachments.enabled` | Enable Sentry ingest consumer attachments | `true` |
| `sentry.ingestConsumerEvents.enabled` | Enable Sentry ingest consumer events | `true` |
| `sentry.ingestConsumerTransactions.enabled` | Enable Sentry ingest consumer transactions | `true` |
| `sentry.ingestMonitors.enabled` | Enable Sentry ingest monitors | `true` |
| `sentry.ingestOccurrences.enabled` | Enable Sentry ingest occurences | `true` |
| `sentry.ingestReplayRecordings.enabled` | Enable Sentry ingest replay recordings | `true` |
Expand All @@ -81,6 +83,8 @@ Note: this table is incomplete, so have a look at the values.yaml in case you mi
| `sentry.subscriptionConsumerTransactions.enabled` | Enable Sentry subscription consumer transactions | `true` |
| `sentry.sentry.web.enabled` | Enable Sentry web | `true` |
| `sentry.sentry.worker.enabled` | Enable Sentry worker | `true` |
| `sentry.sentry.workerEvents.enabled` | Enable additional Sentry events worker | `true` |
| `sentry.sentry.workerTransactions.enabled` | Enable additional Sentry transactions worker | `true` |
| `serviceAccount.annotations` | Additional Service Account annotations. | `{}` |
| `serviceAccount.enabled` | If `true`, a custom Service Account will be used. | `false` |
| `serviceAccount.name` | The base name of the ServiceAccount to use. Will be appended with e.g. `snuba` or `web` for the pods accordingly. | `"sentry"` |
Expand Down
76 changes: 38 additions & 38 deletions sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.sentry.ingestConsumer.enabled }}
{{- if .Values.sentry.ingestConsumerAttachments.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -23,38 +23,38 @@ spec:
matchLabels:
app: {{ template "sentry.fullname" . }}
release: "{{ .Release.Name }}"
role: ingest-consumer
{{- if not .Values.sentry.ingestConsumer.autoscaling.enabled }}
replicas: {{ .Values.sentry.ingestConsumer.replicas }}
role: ingest-consumer-attachments
{{- if not .Values.sentry.ingestConsumerAttachments.autoscaling.enabled }}
replicas: {{ .Values.sentry.ingestConsumerAttachments.replicas }}
{{- end }}
template:
metadata:
annotations:
checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }}
checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }}
checksum/config.yaml: {{ include "sentry.config" . | sha256sum }}
{{- if .Values.sentry.ingestConsumer.annotations }}
{{ toYaml .Values.sentry.ingestConsumer.annotations | indent 8 }}
{{- if .Values.sentry.ingestConsumerAttachments.annotations }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.annotations | indent 8 }}
{{- end }}
labels:
app: {{ template "sentry.fullname" . }}
release: "{{ .Release.Name }}"
role: ingest-consumer
{{- if .Values.sentry.ingestConsumer.podLabels }}
{{ toYaml .Values.sentry.ingestConsumer.podLabels | indent 8 }}
role: ingest-consumer-attachments
{{- if .Values.sentry.ingestConsumerAttachments.podLabels }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.podLabels | indent 8 }}
{{- end }}
spec:
affinity:
{{- if .Values.sentry.ingestConsumer.affinity }}
{{ toYaml .Values.sentry.ingestConsumer.affinity | indent 8 }}
{{- if .Values.sentry.ingestConsumerAttachments.affinity }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.affinity | indent 8 }}
{{- end }}
{{- if .Values.sentry.ingestConsumer.nodeSelector }}
{{- if .Values.sentry.ingestConsumerAttachments.nodeSelector }}
nodeSelector:
{{ toYaml .Values.sentry.ingestConsumer.nodeSelector | indent 8 }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.sentry.ingestConsumer.tolerations }}
{{- if .Values.sentry.ingestConsumerAttachments.tolerations }}
tolerations:
{{ toYaml .Values.sentry.ingestConsumer.tolerations | indent 8 }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.tolerations | indent 8 }}
{{- end }}
{{- if .Values.images.sentry.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -67,9 +67,9 @@ spec:
dnsConfig:
{{ toYaml .Values.dnsConfig | indent 8 }}
{{- end }}
{{- if .Values.sentry.ingestConsumer.securityContext }}
{{- if .Values.sentry.ingestConsumerAttachments.securityContext }}
securityContext:
{{ toYaml .Values.sentry.ingestConsumer.securityContext | indent 8 }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.securityContext | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-ingest-consumer-attachments
Expand All @@ -82,34 +82,34 @@ spec:
- "ingest-attachments"
- "--consumer-group"
- "ingest-consumer"
{{- if .Values.sentry.ingestConsumer.livenessProbe.enabled }}
{{- if .Values.sentry.ingestConsumerAttachments.livenessProbe.enabled }}
- "--healthcheck-file-path"
- "/tmp/health.txt"
{{- end }}
- "--"
{{- if .Values.sentry.ingestConsumer.maxBatchSize }}
{{- if .Values.sentry.ingestConsumerAttachments.maxBatchSize }}
- "--max-batch-size"
- "{{ .Values.sentry.ingestConsumer.maxBatchSize }}"
- "{{ .Values.sentry.ingestConsumerAttachments.maxBatchSize }}"
{{- end }}
{{- if .Values.sentry.ingestConsumer.concurrency }}
{{- if .Values.sentry.ingestConsumerAttachments.concurrency }}
- "--processes"
- "{{ .Values.sentry.ingestConsumer.concurrency }}"
- "{{ .Values.sentry.ingestConsumerAttachments.concurrency }}"
{{- end }}
{{- if .Values.sentry.ingestConsumer.livenessProbe.enabled }}
{{- if .Values.sentry.ingestConsumerAttachments.livenessProbe.enabled }}
livenessProbe:
exec:
command:
- rm
- /tmp/health.txt
initialDelaySeconds: {{ .Values.sentry.ingestConsumer.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.sentry.ingestConsumer.livenessProbe.periodSeconds }}
initialDelaySeconds: {{ .Values.sentry.ingestConsumerAttachments.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.sentry.ingestConsumerAttachments.livenessProbe.periodSeconds }}
{{- end }}
env:
- name: C_FORCE_ROOT
value: "true"
{{ include "sentry.env" . | indent 8 }}
{{- if .Values.sentry.ingestConsumer.env }}
{{ toYaml .Values.sentry.ingestConsumer.env | indent 8 }}
{{- if .Values.sentry.ingestConsumerAttachments.env }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.env | indent 8 }}
{{- end }}
volumeMounts:
- mountPath: /etc/sentry
Expand All @@ -121,17 +121,17 @@ spec:
- name: sentry-google-cloud-key
mountPath: /var/run/secrets/google
{{ end }}
{{- if .Values.sentry.ingestConsumer.volumeMounts }}
{{ toYaml .Values.sentry.ingestConsumer.volumeMounts | indent 8 }}
{{- if .Values.sentry.ingestConsumerAttachments.volumeMounts }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.volumeMounts | indent 8 }}
{{- end }}
resources:
{{ toYaml .Values.sentry.ingestConsumer.resources | indent 12 }}
{{- if .Values.sentry.ingestConsumer.containerSecurityContext }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.resources | indent 12 }}
{{- if .Values.sentry.ingestConsumerAttachments.containerSecurityContext }}
securityContext:
{{ toYaml .Values.sentry.ingestConsumer.containerSecurityContext | indent 12 }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.containerSecurityContext | indent 12 }}
{{- end }}
{{- if .Values.sentry.ingestConsumer.sidecars }}
{{ toYaml .Values.sentry.ingestConsumer.sidecars | indent 6 }}
{{- if .Values.sentry.ingestConsumerAttachments.sidecars }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.sidecars | indent 6 }}
{{- end }}
{{- if .Values.serviceAccount.enabled }}
serviceAccountName: {{ .Values.serviceAccount.name }}-ingest-consumer-attachments
Expand All @@ -157,10 +157,10 @@ spec:
secret:
secretName: {{ .Values.filestore.gcs.secretName }}
{{ end }}
{{- if .Values.sentry.ingestConsumer.volumes }}
{{ toYaml .Values.sentry.ingestConsumer.volumes | indent 6 }}
{{- if .Values.sentry.ingestConsumerAttachments.volumes }}
{{ toYaml .Values.sentry.ingestConsumerAttachments.volumes | indent 6 }}
{{- end }}
{{- if .Values.sentry.ingestConsumer.priorityClassName }}
priorityClassName: "{{ .Values.sentry.ingestConsumer.priorityClassName }}"
{{- if .Values.sentry.ingestConsumerAttachments.priorityClassName }}
priorityClassName: "{{ .Values.sentry.ingestConsumerAttachments.priorityClassName }}"
{{- end }}
{{- end }}
Loading

0 comments on commit 5969544

Please sign in to comment.