From 596954497af0acef2cce4014056ca756c5eb3592 Mon Sep 17 00:00:00 2001 From: Nikolai Iuzhanin <99660565+NikolaiIuzhaninYS@users.noreply.github.com> Date: Tue, 14 May 2024 13:36:19 +0300 Subject: [PATCH] feat!: ingest consumers and workers separation (#1245) --- README.md | 17 ++ sentry/README.md | 6 +- ...nt-sentry-ingest-consumer-attachments.yaml | 76 ++++----- ...loyment-sentry-ingest-consumer-events.yaml | 78 ++++----- ...t-sentry-ingest-consumer-transactions.yaml | 78 ++++----- .../deployment-sentry-worker-events.yaml | 155 ++++++++++++++++++ ...deployment-sentry-worker-transactions.yaml | 155 ++++++++++++++++++ sentry/templates/deployment-symbolicator.yaml | 2 +- .../hpa-ingest-consumer-attachments.yaml | 33 ++++ .../templates/hpa-ingest-consumer-events.yaml | 33 ++++ .../hpa-ingest-consumer-transactions.yaml | 33 ++++ sentry/templates/hpa-ingestConsumer.yaml | 97 ----------- sentry/templates/hpa-worker-events.yaml | 33 ++++ sentry/templates/hpa-worker-transactions.yaml | 33 ++++ ...nt-sentry-ingest-consumer-attachments.yaml | 2 +- ...account-sentry-ingest-consumer-events.yaml | 2 +- ...t-sentry-ingest-consumer-transactions.yaml | 2 +- .../serviceaccount-sentry-worker.yaml | 2 +- sentry/values.yaml | 129 ++++++++++++++- 19 files changed, 746 insertions(+), 220 deletions(-) create mode 100644 sentry/templates/deployment-sentry-worker-events.yaml create mode 100644 sentry/templates/deployment-sentry-worker-transactions.yaml create mode 100644 sentry/templates/hpa-ingest-consumer-attachments.yaml create mode 100644 sentry/templates/hpa-ingest-consumer-events.yaml create mode 100644 sentry/templates/hpa-ingest-consumer-transactions.yaml delete mode 100644 sentry/templates/hpa-ingestConsumer.yaml create mode 100644 sentry/templates/hpa-worker-events.yaml create mode 100644 sentry/templates/hpa-worker-transactions.yaml diff --git a/README.md b/README.md index 06c3147e0..456307871 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/sentry/README.md b/sentry/README.md index 3a47cdd61..e7d34126d 100644 --- a/sentry/README.md +++ b/sentry/README.md @@ -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` | @@ -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"` | diff --git a/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml b/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml index 4e63eee0e..052737e51 100644 --- a/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml +++ b/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml @@ -1,4 +1,4 @@ -{{- if .Values.sentry.ingestConsumer.enabled }} +{{- if .Values.sentry.ingestConsumerAttachments.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -23,9 +23,9 @@ 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: @@ -33,28 +33,28 @@ spec: 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: @@ -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 @@ -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 @@ -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 @@ -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 }} diff --git a/sentry/templates/deployment-sentry-ingest-consumer-events.yaml b/sentry/templates/deployment-sentry-ingest-consumer-events.yaml index 082cb6968..c2c2ea651 100644 --- a/sentry/templates/deployment-sentry-ingest-consumer-events.yaml +++ b/sentry/templates/deployment-sentry-ingest-consumer-events.yaml @@ -1,4 +1,4 @@ -{{- if .Values.sentry.ingestConsumer.enabled }} +{{- if .Values.sentry.ingestConsumerEvents.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -23,9 +23,9 @@ 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-events +{{- if not .Values.sentry.ingestConsumerEvents.autoscaling.enabled }} + replicas: {{ .Values.sentry.ingestConsumerEvents.replicas }} {{- end }} template: metadata: @@ -33,28 +33,28 @@ spec: 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.ingestConsumerEvents.annotations }} +{{ toYaml .Values.sentry.ingestConsumerEvents.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-events + {{- if .Values.sentry.ingestConsumerEvents.podLabels }} +{{ toYaml .Values.sentry.ingestConsumerEvents.podLabels | indent 8 }} {{- end }} spec: affinity: - {{- if .Values.sentry.ingestConsumer.affinity }} -{{ toYaml .Values.sentry.ingestConsumer.affinity | indent 8 }} + {{- if .Values.sentry.ingestConsumerEvents.affinity }} +{{ toYaml .Values.sentry.ingestConsumerEvents.affinity | indent 8 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.nodeSelector }} + {{- if .Values.sentry.ingestConsumerEvents.nodeSelector }} nodeSelector: -{{ toYaml .Values.sentry.ingestConsumer.nodeSelector | indent 8 }} +{{ toYaml .Values.sentry.ingestConsumerEvents.nodeSelector | indent 8 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.tolerations }} + {{- if .Values.sentry.ingestConsumerEvents.tolerations }} tolerations: -{{ toYaml .Values.sentry.ingestConsumer.tolerations | indent 8 }} +{{ toYaml .Values.sentry.ingestConsumerEvents.tolerations | indent 8 }} {{- end }} {{- if .Values.images.sentry.imagePullSecrets }} imagePullSecrets: @@ -67,9 +67,9 @@ spec: dnsConfig: {{ toYaml .Values.dnsConfig | indent 8 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.securityContext }} + {{- if .Values.sentry.ingestConsumerEvents.securityContext }} securityContext: -{{ toYaml .Values.sentry.ingestConsumer.securityContext | indent 8 }} +{{ toYaml .Values.sentry.ingestConsumerEvents.securityContext | indent 8 }} {{- end }} containers: - name: {{ .Chart.Name }}-ingest-consumer-events @@ -82,37 +82,37 @@ spec: - "ingest-events" - "--consumer-group" - "ingest-consumer" - {{- if .Values.sentry.ingestConsumer.noStrictOffsetReset }} + {{- if .Values.sentry.ingestConsumerEvents.noStrictOffsetReset }} - "--no-strict-offset-reset" {{- end }} - {{- if .Values.sentry.ingestConsumer.livenessProbe.enabled }} + {{- if .Values.sentry.ingestConsumerEvents.livenessProbe.enabled }} - "--healthcheck-file-path" - "/tmp/health.txt" {{- end }} - "--" - {{- if .Values.sentry.ingestConsumer.maxBatchSize }} + {{- if .Values.sentry.ingestConsumerEvents.maxBatchSize }} - "--max-batch-size" - - "{{ .Values.sentry.ingestConsumer.maxBatchSize }}" + - "{{ .Values.sentry.ingestConsumerEvents.maxBatchSize }}" {{- end }} - {{- if .Values.sentry.ingestConsumer.concurrency }} + {{- if .Values.sentry.ingestConsumerEvents.concurrency }} - "--processes" - - "{{ .Values.sentry.ingestConsumer.concurrency }}" + - "{{ .Values.sentry.ingestConsumerEvents.concurrency }}" {{- end }} - {{- if .Values.sentry.ingestConsumer.livenessProbe.enabled }} + {{- if .Values.sentry.ingestConsumerEvents.livenessProbe.enabled }} livenessProbe: exec: command: - rm - /tmp/health.txt - initialDelaySeconds: {{ .Values.sentry.ingestConsumer.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.sentry.ingestConsumer.livenessProbe.periodSeconds }} + initialDelaySeconds: {{ .Values.sentry.ingestConsumerEvents.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.sentry.ingestConsumerEvents.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.ingestConsumerEvents.env }} +{{ toYaml .Values.sentry.ingestConsumerEvents.env | indent 8 }} {{- end }} volumeMounts: - mountPath: /etc/sentry @@ -124,17 +124,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.ingestConsumerEvents.volumeMounts }} +{{ toYaml .Values.sentry.ingestConsumerEvents.volumeMounts | indent 8 }} {{- end }} resources: -{{ toYaml .Values.sentry.ingestConsumer.resources | indent 12 }} -{{- if .Values.sentry.ingestConsumer.containerSecurityContext }} +{{ toYaml .Values.sentry.ingestConsumerEvents.resources | indent 12 }} +{{- if .Values.sentry.ingestConsumerEvents.containerSecurityContext }} securityContext: -{{ toYaml .Values.sentry.ingestConsumer.containerSecurityContext | indent 12 }} +{{ toYaml .Values.sentry.ingestConsumerEvents.containerSecurityContext | indent 12 }} {{- end }} -{{- if .Values.sentry.ingestConsumer.sidecars }} -{{ toYaml .Values.sentry.ingestConsumer.sidecars | indent 6 }} +{{- if .Values.sentry.ingestConsumerEvents.sidecars }} +{{ toYaml .Values.sentry.ingestConsumerEvents.sidecars | indent 6 }} {{- end }} {{- if .Values.serviceAccount.enabled }} serviceAccountName: {{ .Values.serviceAccount.name }}-ingest-consumer-events @@ -160,10 +160,10 @@ spec: secret: secretName: {{ .Values.filestore.gcs.secretName }} {{ end }} -{{- if .Values.sentry.ingestConsumer.volumes }} -{{ toYaml .Values.sentry.ingestConsumer.volumes | indent 6 }} +{{- if .Values.sentry.ingestConsumerEvents.volumes }} +{{ toYaml .Values.sentry.ingestConsumerEvents.volumes | indent 6 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.priorityClassName }} - priorityClassName: "{{ .Values.sentry.ingestConsumer.priorityClassName }}" + {{- if .Values.sentry.ingestConsumerEvents.priorityClassName }} + priorityClassName: "{{ .Values.sentry.ingestConsumerEvents.priorityClassName }}" {{- end }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml b/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml index fce9ccdbd..9ccbe5d3c 100644 --- a/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml +++ b/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml @@ -1,4 +1,4 @@ -{{- if .Values.sentry.ingestConsumer.enabled }} +{{- if .Values.sentry.ingestConsumerTransactions.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -23,9 +23,9 @@ 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-transactions +{{- if not .Values.sentry.ingestConsumerTransactions.autoscaling.enabled }} + replicas: {{ .Values.sentry.ingestConsumerTransactions.replicas }} {{- end }} template: metadata: @@ -33,28 +33,28 @@ spec: 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.ingestConsumerTransactions.annotations }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.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-transactions + {{- if .Values.sentry.ingestConsumerTransactions.podLabels }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.podLabels | indent 8 }} {{- end }} spec: affinity: - {{- if .Values.sentry.ingestConsumer.affinity }} -{{ toYaml .Values.sentry.ingestConsumer.affinity | indent 8 }} + {{- if .Values.sentry.ingestConsumerTransactions.affinity }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.affinity | indent 8 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.nodeSelector }} + {{- if .Values.sentry.ingestConsumerTransactions.nodeSelector }} nodeSelector: -{{ toYaml .Values.sentry.ingestConsumer.nodeSelector | indent 8 }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.nodeSelector | indent 8 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.tolerations }} + {{- if .Values.sentry.ingestConsumerTransactions.tolerations }} tolerations: -{{ toYaml .Values.sentry.ingestConsumer.tolerations | indent 8 }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.tolerations | indent 8 }} {{- end }} {{- if .Values.images.sentry.imagePullSecrets }} imagePullSecrets: @@ -67,9 +67,9 @@ spec: dnsConfig: {{ toYaml .Values.dnsConfig | indent 8 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.securityContext }} + {{- if .Values.sentry.ingestConsumerTransactions.securityContext }} securityContext: -{{ toYaml .Values.sentry.ingestConsumer.securityContext | indent 8 }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.securityContext | indent 8 }} {{- end }} containers: - name: {{ .Chart.Name }}-ingest-consumer-transactions @@ -82,37 +82,37 @@ spec: - "ingest-transactions" - "--consumer-group" - "ingest-consumer" - {{- if .Values.sentry.ingestConsumer.noStrictOffsetReset }} + {{- if .Values.sentry.ingestConsumerTransactions.noStrictOffsetReset }} - "--no-strict-offset-reset" {{- end }} - {{- if .Values.sentry.ingestConsumer.livenessProbe.enabled }} + {{- if .Values.sentry.ingestConsumerTransactions.livenessProbe.enabled }} - "--healthcheck-file-path" - "/tmp/health.txt" {{- end }} - "--" - {{- if .Values.sentry.ingestConsumer.maxBatchSize }} + {{- if .Values.sentry.ingestConsumerTransactions.maxBatchSize }} - "--max-batch-size" - - "{{ .Values.sentry.ingestConsumer.maxBatchSize }}" + - "{{ .Values.sentry.ingestConsumerTransactions.maxBatchSize }}" {{- end }} - {{- if .Values.sentry.ingestConsumer.concurrency }} + {{- if .Values.sentry.ingestConsumerTransactions.concurrency }} - "--processes" - - "{{ .Values.sentry.ingestConsumer.concurrency }}" + - "{{ .Values.sentry.ingestConsumerTransactions.concurrency }}" {{- end }} - {{- if .Values.sentry.ingestConsumer.livenessProbe.enabled }} + {{- if .Values.sentry.ingestConsumerTransactions.livenessProbe.enabled }} livenessProbe: exec: command: - rm - /tmp/health.txt - initialDelaySeconds: {{ .Values.sentry.ingestConsumer.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.sentry.ingestConsumer.livenessProbe.periodSeconds }} + initialDelaySeconds: {{ .Values.sentry.ingestConsumerTransactions.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.sentry.ingestConsumerTransactions.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.ingestConsumerTransactions.env }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.env | indent 8 }} {{- end }} volumeMounts: - mountPath: /etc/sentry @@ -124,17 +124,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.ingestConsumerTransactions.volumeMounts }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.volumeMounts | indent 8 }} {{- end }} resources: -{{ toYaml .Values.sentry.ingestConsumer.resources | indent 12 }} -{{- if .Values.sentry.ingestConsumer.containerSecurityContext }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.resources | indent 12 }} +{{- if .Values.sentry.ingestConsumerTransactions.containerSecurityContext }} securityContext: -{{ toYaml .Values.sentry.ingestConsumer.containerSecurityContext | indent 12 }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.containerSecurityContext | indent 12 }} {{- end }} -{{- if .Values.sentry.ingestConsumer.sidecars }} -{{ toYaml .Values.sentry.ingestConsumer.sidecars | indent 6 }} +{{- if .Values.sentry.ingestConsumerTransactions.sidecars }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.sidecars | indent 6 }} {{- end }} {{- if .Values.serviceAccount.enabled }} serviceAccountName: {{ .Values.serviceAccount.name }}-ingest-consumer-transactions @@ -160,10 +160,10 @@ spec: secret: secretName: {{ .Values.filestore.gcs.secretName }} {{ end }} -{{- if .Values.sentry.ingestConsumer.volumes }} -{{ toYaml .Values.sentry.ingestConsumer.volumes | indent 6 }} +{{- if .Values.sentry.ingestConsumerTransactions.volumes }} +{{ toYaml .Values.sentry.ingestConsumerTransactions.volumes | indent 6 }} {{- end }} - {{- if .Values.sentry.ingestConsumer.priorityClassName }} - priorityClassName: "{{ .Values.sentry.ingestConsumer.priorityClassName }}" + {{- if .Values.sentry.ingestConsumerTransactions.priorityClassName }} + priorityClassName: "{{ .Values.sentry.ingestConsumerTransactions.priorityClassName }}" {{- end }} {{- end }} diff --git a/sentry/templates/deployment-sentry-worker-events.yaml b/sentry/templates/deployment-sentry-worker-events.yaml new file mode 100644 index 000000000..22e90448a --- /dev/null +++ b/sentry/templates/deployment-sentry-worker-events.yaml @@ -0,0 +1,155 @@ +{{- if .Values.sentry.workerEvents.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sentry.fullname" . }}-worker + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + selector: + matchLabels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: worker +{{- if not .Values.sentry.workerEvents.autoscaling.enabled }} + replicas: {{ .Values.sentry.workerEvents.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.workerEvents.annotations }} +{{ toYaml .Values.sentry.workerEvents.annotations | indent 8 }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: worker + {{- if .Values.sentry.workerEvents.podLabels }} +{{ toYaml .Values.sentry.workerEvents.podLabels | indent 8 }} + {{- end }} + spec: + affinity: + {{- if .Values.sentry.workerEvents.affinity }} +{{ toYaml .Values.sentry.workerEvents.affinity | indent 8 }} + {{- end }} + {{- if .Values.sentry.workerEvents.nodeSelector }} + nodeSelector: +{{ toYaml .Values.sentry.workerEvents.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.sentry.workerEvents.tolerations }} + tolerations: +{{ toYaml .Values.sentry.workerEvents.tolerations | indent 8 }} + {{- end }} + {{- if .Values.images.sentry.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }} + {{- end }} + {{- if .Values.dnsPolicy }} + dnsPolicy: {{ .Values.dnsPolicy | quote }} + {{- end }} + {{- if .Values.dnsConfig }} + dnsConfig: +{{ toYaml .Values.dnsConfig | indent 8 }} + {{- end }} + {{- if .Values.sentry.workerEvents.securityContext }} + securityContext: +{{ toYaml .Values.sentry.workerEvents.securityContext | indent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-worker + image: "{{ template "sentry.image" . }}" + imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }} + command: ["sentry"] + args: + - "run" + - "worker" + - "-Q" + - {{ .Values.sentry.workerEvents.queues }} + {{- if .Values.sentry.workerEvents.concurrency }} + - "-c" + - "{{ .Values.sentry.workerEvents.concurrency }}" + {{- end }} + env: + - name: C_FORCE_ROOT + value: "true" +{{ include "sentry.env" . | indent 8 }} +{{- if .Values.sentry.workerEvents.env }} +{{ toYaml .Values.sentry.workerEvents.env | indent 8 }} +{{- end }} + volumeMounts: + - mountPath: /etc/sentry + name: config + readOnly: true + - mountPath: {{ .Values.filestore.filesystem.path }} + name: sentry-data + {{- if .Values.geodata.volumeName }} + - name: {{ .Values.geodata.volumeName }} + mountPath: {{ .Values.geodata.mountPath }} + {{- end }} + {{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }} + - name: sentry-google-cloud-key + mountPath: /var/run/secrets/google + {{ end }} +{{- if .Values.sentry.workerEvents.volumeMounts }} +{{ toYaml .Values.sentry.workerEvents.volumeMounts | indent 8 }} +{{- end }} + {{- if .Values.sentry.workerEvents.livenessProbe.enabled }} + livenessProbe: + periodSeconds: {{ .Values.sentry.workerEvents.livenessProbe.periodSeconds }} + initialDelaySeconds: 10 + timeoutSeconds: {{ .Values.sentry.workerEvents.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.sentry.workerEvents.livenessProbe.failureThreshold }} + exec: + command: + - sentry + - exec + - -c + - 'from sentry.celery import app; import os; dest="celery@{}".format(os.environ["HOSTNAME"]); print(app.control.ping(destination=[dest], timeout=5)[0][dest]["ok"])' +{{- end }} + resources: +{{ toYaml .Values.sentry.workerEvents.resources | indent 12 }} +{{- if .Values.sentry.workerEvents.containerSecurityContext }} + securityContext: +{{ toYaml .Values.sentry.workerEvents.containerSecurityContext | indent 12 }} +{{- end }} +{{- if .Values.sentry.workerEvents.sidecars }} +{{ toYaml .Values.sentry.workerEvents.sidecars | indent 6 }} +{{- end }} + {{- if .Values.serviceAccount.enabled }} + serviceAccountName: {{ .Values.serviceAccount.name }}-worker + {{- end }} + volumes: + - name: config + configMap: + name: {{ template "sentry.fullname" . }}-sentry + - name: sentry-data + {{- if and (eq .Values.filestore.backend "filesystem") .Values.filestore.filesystem.persistence.enabled (.Values.filestore.filesystem.persistence.persistentWorkers) }} + {{- if .Values.filestore.filesystem.persistence.existingClaim }} + persistentVolumeClaim: + claimName: {{ .Values.filestore.filesystem.persistence.existingClaim }} + {{- else }} + persistentVolumeClaim: + claimName: {{ template "sentry.fullname" . }}-data + {{- end }} + {{- else }} + emptyDir: {} + {{ end }} + {{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }} + - name: sentry-google-cloud-key + secret: + secretName: {{ .Values.filestore.gcs.secretName }} + {{ end }} + {{- if .Values.sentry.workerEvents.priorityClassName }} + priorityClassName: "{{ .Values.sentry.workerEvents.priorityClassName }}" + {{- end }} +{{- if .Values.sentry.workerEvents.volumes }} +{{ toYaml .Values.sentry.workerEvents.volumes | indent 6 }} +{{- end }} +{{- end }} diff --git a/sentry/templates/deployment-sentry-worker-transactions.yaml b/sentry/templates/deployment-sentry-worker-transactions.yaml new file mode 100644 index 000000000..7685157bc --- /dev/null +++ b/sentry/templates/deployment-sentry-worker-transactions.yaml @@ -0,0 +1,155 @@ +{{- if .Values.sentry.workerTransactions.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sentry.fullname" . }}-worker + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + selector: + matchLabels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: worker +{{- if not .Values.sentry.workerTransactions.autoscaling.enabled }} + replicas: {{ .Values.sentry.workerTransactions.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.workerTransactions.annotations }} +{{ toYaml .Values.sentry.workerTransactions.annotations | indent 8 }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: worker + {{- if .Values.sentry.workerTransactions.podLabels }} +{{ toYaml .Values.sentry.workerTransactions.podLabels | indent 8 }} + {{- end }} + spec: + affinity: + {{- if .Values.sentry.workerTransactions.affinity }} +{{ toYaml .Values.sentry.workerTransactions.affinity | indent 8 }} + {{- end }} + {{- if .Values.sentry.workerTransactions.nodeSelector }} + nodeSelector: +{{ toYaml .Values.sentry.workerTransactions.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.sentry.workerTransactions.tolerations }} + tolerations: +{{ toYaml .Values.sentry.workerTransactions.tolerations | indent 8 }} + {{- end }} + {{- if .Values.images.sentry.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }} + {{- end }} + {{- if .Values.dnsPolicy }} + dnsPolicy: {{ .Values.dnsPolicy | quote }} + {{- end }} + {{- if .Values.dnsConfig }} + dnsConfig: +{{ toYaml .Values.dnsConfig | indent 8 }} + {{- end }} + {{- if .Values.sentry.workerTransactions.securityContext }} + securityContext: +{{ toYaml .Values.sentry.workerTransactions.securityContext | indent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-worker + image: "{{ template "sentry.image" . }}" + imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }} + command: ["sentry"] + args: + - "run" + - "worker" + - "-Q" + - {{ .Values.sentry.workerTransactions.queues }} + {{- if .Values.sentry.workerTransactions.concurrency }} + - "-c" + - "{{ .Values.sentry.workerTransactions.concurrency }}" + {{- end }} + env: + - name: C_FORCE_ROOT + value: "true" +{{ include "sentry.env" . | indent 8 }} +{{- if .Values.sentry.workerTransactions.env }} +{{ toYaml .Values.sentry.workerTransactions.env | indent 8 }} +{{- end }} + volumeMounts: + - mountPath: /etc/sentry + name: config + readOnly: true + - mountPath: {{ .Values.filestore.filesystem.path }} + name: sentry-data + {{- if .Values.geodata.volumeName }} + - name: {{ .Values.geodata.volumeName }} + mountPath: {{ .Values.geodata.mountPath }} + {{- end }} + {{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }} + - name: sentry-google-cloud-key + mountPath: /var/run/secrets/google + {{ end }} +{{- if .Values.sentry.workerTransactions.volumeMounts }} +{{ toYaml .Values.sentry.workerTransactions.volumeMounts | indent 8 }} +{{- end }} + {{- if .Values.sentry.workerTransactions.livenessProbe.enabled }} + livenessProbe: + periodSeconds: {{ .Values.sentry.workerTransactions.livenessProbe.periodSeconds }} + initialDelaySeconds: 10 + timeoutSeconds: {{ .Values.sentry.workerTransactions.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.sentry.workerTransactions.livenessProbe.failureThreshold }} + exec: + command: + - sentry + - exec + - -c + - 'from sentry.celery import app; import os; dest="celery@{}".format(os.environ["HOSTNAME"]); print(app.control.ping(destination=[dest], timeout=5)[0][dest]["ok"])' +{{- end }} + resources: +{{ toYaml .Values.sentry.workerTransactions.resources | indent 12 }} +{{- if .Values.sentry.workerTransactions.containerSecurityContext }} + securityContext: +{{ toYaml .Values.sentry.workerTransactions.containerSecurityContext | indent 12 }} +{{- end }} +{{- if .Values.sentry.workerTransactions.sidecars }} +{{ toYaml .Values.sentry.workerTransactions.sidecars | indent 6 }} +{{- end }} + {{- if .Values.serviceAccount.enabled }} + serviceAccountName: {{ .Values.serviceAccount.name }}-worker + {{- end }} + volumes: + - name: config + configMap: + name: {{ template "sentry.fullname" . }}-sentry + - name: sentry-data + {{- if and (eq .Values.filestore.backend "filesystem") .Values.filestore.filesystem.persistence.enabled (.Values.filestore.filesystem.persistence.persistentWorkers) }} + {{- if .Values.filestore.filesystem.persistence.existingClaim }} + persistentVolumeClaim: + claimName: {{ .Values.filestore.filesystem.persistence.existingClaim }} + {{- else }} + persistentVolumeClaim: + claimName: {{ template "sentry.fullname" . }}-data + {{- end }} + {{- else }} + emptyDir: {} + {{ end }} + {{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }} + - name: sentry-google-cloud-key + secret: + secretName: {{ .Values.filestore.gcs.secretName }} + {{ end }} + {{- if .Values.sentry.workerTransactions.priorityClassName }} + priorityClassName: "{{ .Values.sentry.workerTransactions.priorityClassName }}" + {{- end }} +{{- if .Values.sentry.workerTransactions.volumes }} +{{ toYaml .Values.sentry.workerTransactions.volumes | indent 6 }} +{{- end }} +{{- end }} diff --git a/sentry/templates/deployment-symbolicator.yaml b/sentry/templates/deployment-symbolicator.yaml index 9b1ff7d66..15e8202bf 100644 --- a/sentry/templates/deployment-symbolicator.yaml +++ b/sentry/templates/deployment-symbolicator.yaml @@ -128,7 +128,7 @@ spec: secret: secretName: {{ .Values.filestore.gcs.secretName }} {{ end }} -{{- if .Values.sentry.ingestConsumer.volumes }} +{{- if .Values.symbolicator.api.volumes }} {{ toYaml .Values.symbolicator.api.volumes | indent 6 }} {{- end }} {{- if .Values.symbolicator.api.priorityClassName }} diff --git a/sentry/templates/hpa-ingest-consumer-attachments.yaml b/sentry/templates/hpa-ingest-consumer-attachments.yaml new file mode 100644 index 000000000..e3a87bb8e --- /dev/null +++ b/sentry/templates/hpa-ingest-consumer-attachments.yaml @@ -0,0 +1,33 @@ +{{- if and .Values.sentry.ingestConsumerAttachments.enabled .Values.sentry.ingestConsumerAttachments.autoscaling.enabled }} +apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "sentry.fullname" . }}-sentry-ingest-consumer-attachments +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "sentry.fullname" . }}-ingest-consumer-attachments + minReplicas: {{ .Values.sentry.ingestConsumerAttachments.autoscaling.minReplicas }} + maxReplicas: {{ .Values.sentry.ingestConsumerAttachments.autoscaling.maxReplicas }} + {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} + targetCPUUtilizationPercentage: {{ .Values.sentry.ingestConsumerAttachments.autoscaling.targetCPUUtilizationPercentage }} + {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} + metrics: + - type: ContainerResource + containerResource: + container: {{ .Chart.Name }}-ingest-consumer-attachments + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.ingestConsumerAttachments.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.ingestConsumerAttachments.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/sentry/templates/hpa-ingest-consumer-events.yaml b/sentry/templates/hpa-ingest-consumer-events.yaml new file mode 100644 index 000000000..95f6ab86d --- /dev/null +++ b/sentry/templates/hpa-ingest-consumer-events.yaml @@ -0,0 +1,33 @@ +{{- if and .Values.sentry.ingestConsumerEvents.enabled .Values.sentry.ingestConsumerEvents.autoscaling.enabled }} +apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "sentry.fullname" . }}-sentry-ingest-consumer-events +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "sentry.fullname" . }}-ingest-consumer-events + minReplicas: {{ .Values.sentry.ingestConsumerEvents.autoscaling.minReplicas }} + maxReplicas: {{ .Values.sentry.ingestConsumerEvents.autoscaling.maxReplicas }} + {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} + targetCPUUtilizationPercentage: {{ .Values.sentry.ingestConsumerEvents.autoscaling.targetCPUUtilizationPercentage }} + {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} + metrics: + - type: ContainerResource + containerResource: + container: {{ .Chart.Name }}-ingest-consumer-events + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.ingestConsumerEvents.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.ingestConsumerEvents.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/sentry/templates/hpa-ingest-consumer-transactions.yaml b/sentry/templates/hpa-ingest-consumer-transactions.yaml new file mode 100644 index 000000000..f854c3ea8 --- /dev/null +++ b/sentry/templates/hpa-ingest-consumer-transactions.yaml @@ -0,0 +1,33 @@ +{{- if and .Values.sentry.ingestConsumerTransactions.enabled .Values.sentry.ingestConsumerTransactions.autoscaling.enabled }} +apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "sentry.fullname" . }}-sentry-ingest-consumer-transactions +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "sentry.fullname" . }}-ingest-consumer-transactions + minReplicas: {{ .Values.sentry.ingestConsumerTransactions.autoscaling.minReplicas }} + maxReplicas: {{ .Values.sentry.ingestConsumerTransactions.autoscaling.maxReplicas }} + {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} + targetCPUUtilizationPercentage: {{ .Values.sentry.ingestConsumerTransactions.autoscaling.targetCPUUtilizationPercentage }} + {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} + metrics: + - type: ContainerResource + containerResource: + container: {{ .Chart.Name }}-ingest-consumer-transactions + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.ingestConsumerTransactions.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.ingestConsumerTransactions.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/sentry/templates/hpa-ingestConsumer.yaml b/sentry/templates/hpa-ingestConsumer.yaml deleted file mode 100644 index 25e40c6da..000000000 --- a/sentry/templates/hpa-ingestConsumer.yaml +++ /dev/null @@ -1,97 +0,0 @@ -{{- if and .Values.sentry.ingestConsumer.enabled .Values.sentry.ingestConsumer.autoscaling.enabled }} -apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} -kind: HorizontalPodAutoscaler -metadata: - name: {{ template "sentry.fullname" . }}-sentry-ingest-consumer-attachments -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ template "sentry.fullname" . }}-ingest-consumer-attachments - minReplicas: {{ .Values.sentry.ingestConsumer.autoscaling.minReplicas }} - maxReplicas: {{ .Values.sentry.ingestConsumer.autoscaling.maxReplicas }} - {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} - targetCPUUtilizationPercentage: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} - metrics: - - type: ContainerResource - containerResource: - container: {{ .Chart.Name }}-ingest-consumer-attachments - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- else }} - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} ---- -apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} -kind: HorizontalPodAutoscaler -metadata: - name: {{ template "sentry.fullname" . }}-sentry-ingest-consumer-events -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ template "sentry.fullname" . }}-ingest-consumer-events - minReplicas: {{ .Values.sentry.ingestConsumer.autoscaling.minReplicas }} - maxReplicas: {{ .Values.sentry.ingestConsumer.autoscaling.maxReplicas }} - {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} - targetCPUUtilizationPercentage: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} - metrics: - - type: ContainerResource - containerResource: - container: {{ .Chart.Name }}-ingest-consumer-events - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- else }} - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} ---- -apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} -kind: HorizontalPodAutoscaler -metadata: - name: {{ template "sentry.fullname" . }}-sentry-ingest-consumer-transactions -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ template "sentry.fullname" . }}-ingest-consumer-transactions - minReplicas: {{ .Values.sentry.ingestConsumer.autoscaling.minReplicas }} - maxReplicas: {{ .Values.sentry.ingestConsumer.autoscaling.maxReplicas }} - {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} - targetCPUUtilizationPercentage: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} - metrics: - - type: ContainerResource - containerResource: - container: {{ .Chart.Name }}-ingest-consumer-transactions - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- else }} - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.sentry.ingestConsumer.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/sentry/templates/hpa-worker-events.yaml b/sentry/templates/hpa-worker-events.yaml new file mode 100644 index 000000000..a8275238f --- /dev/null +++ b/sentry/templates/hpa-worker-events.yaml @@ -0,0 +1,33 @@ +{{- if and .Values.sentry.workerEvents.enabled .Values.sentry.workerEvents.autoscaling.enabled }} +apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "sentry.fullname" . }}-sentry-worker +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "sentry.fullname" . }}-worker + minReplicas: {{ .Values.sentry.workerEvents.autoscaling.minReplicas }} + maxReplicas: {{ .Values.sentry.workerEvents.autoscaling.maxReplicas }} + {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} + targetCPUUtilizationPercentage: {{ .Values.sentry.workerEvents.autoscaling.targetCPUUtilizationPercentage }} + {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} + metrics: + - type: ContainerResource + containerResource: + container: {{ .Chart.Name }}-worker + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.workerEvents.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.workerEvents.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/sentry/templates/hpa-worker-transactions.yaml b/sentry/templates/hpa-worker-transactions.yaml new file mode 100644 index 000000000..45772f128 --- /dev/null +++ b/sentry/templates/hpa-worker-transactions.yaml @@ -0,0 +1,33 @@ +{{- if and .Values.sentry.workerTransactions.enabled .Values.sentry.workerTransactions.autoscaling.enabled }} +apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "sentry.fullname" . }}-sentry-worker +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "sentry.fullname" . }}-worker + minReplicas: {{ .Values.sentry.workerTransactions.autoscaling.minReplicas }} + maxReplicas: {{ .Values.sentry.workerTransactions.autoscaling.maxReplicas }} + {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} + targetCPUUtilizationPercentage: {{ .Values.sentry.workerTransactions.autoscaling.targetCPUUtilizationPercentage }} + {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} + metrics: + - type: ContainerResource + containerResource: + container: {{ .Chart.Name }}-worker + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.workerTransactions.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.sentry.workerTransactions.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/sentry/templates/serviceaccount-sentry-ingest-consumer-attachments.yaml b/sentry/templates/serviceaccount-sentry-ingest-consumer-attachments.yaml index 09dbcf1b4..55632fc25 100644 --- a/sentry/templates/serviceaccount-sentry-ingest-consumer-attachments.yaml +++ b/sentry/templates/serviceaccount-sentry-ingest-consumer-attachments.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.serviceAccount.enabled .Values.sentry.ingestConsumer.enabled }} +{{- if and .Values.serviceAccount.enabled .Values.sentry.ingestConsumerAttachments.enabled }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/sentry/templates/serviceaccount-sentry-ingest-consumer-events.yaml b/sentry/templates/serviceaccount-sentry-ingest-consumer-events.yaml index 2cd5ef493..54925afca 100644 --- a/sentry/templates/serviceaccount-sentry-ingest-consumer-events.yaml +++ b/sentry/templates/serviceaccount-sentry-ingest-consumer-events.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.serviceAccount.enabled .Values.sentry.ingestConsumer.enabled }} +{{- if and .Values.serviceAccount.enabled .Values.sentry.ingestConsumerEvents.enabled }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/sentry/templates/serviceaccount-sentry-ingest-consumer-transactions.yaml b/sentry/templates/serviceaccount-sentry-ingest-consumer-transactions.yaml index e1579d549..57121995c 100644 --- a/sentry/templates/serviceaccount-sentry-ingest-consumer-transactions.yaml +++ b/sentry/templates/serviceaccount-sentry-ingest-consumer-transactions.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.serviceAccount.enabled .Values.sentry.ingestConsumer.enabled }} +{{- if and .Values.serviceAccount.enabled .Values.sentry.ingestConsumerTransactions.enabled }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/sentry/templates/serviceaccount-sentry-worker.yaml b/sentry/templates/serviceaccount-sentry-worker.yaml index e1e10a9f8..c92bd1bb3 100644 --- a/sentry/templates/serviceaccount-sentry-worker.yaml +++ b/sentry/templates/serviceaccount-sentry-worker.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.serviceAccount.enabled .Values.sentry.worker.enabled }} +{{- if and .Values.serviceAccount.enabled ( or .Values.sentry.worker.enabled .Values.sentry.workerEvents.enabled .Values.sentry.workerTransactions.enabled ) }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/sentry/values.yaml b/sentry/values.yaml index a8eaa1946..29ee060a4 100644 --- a/sentry/values.yaml +++ b/sentry/values.yaml @@ -211,7 +211,65 @@ sentry: volumes: [] volumeMounts: [] - ingestConsumer: + # allows to dedicate some workers to specific queues + workerEvents: + enabled: false + queues: "events.save_event,post_process_errors" + replicas: 1 + # concurrency: 4 + env: [] + resources: {} + affinity: {} + nodeSelector: {} + # tolerations: [] + # podLabels: [] + + # it's better to use prometheus adapter and scale based on + # the size of the rabbitmq queue + autoscaling: + enabled: false + minReplicas: 2 + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 + livenessProbe: + enabled: false + periodSeconds: 60 + timeoutSeconds: 10 + failureThreshold: 3 + sidecars: [] + volumes: [] + volumeMounts: [] + + # allows to dedicate some workers to specific queues + workerTransactions: + enabled: true + queues: "events.save_event_transaction,post_process_transactions" + replicas: 1 + # concurrency: 4 + env: [] + resources: {} + affinity: {} + nodeSelector: {} + # tolerations: [] + # podLabels: [] + + # it's better to use prometheus adapter and scale based on + # the size of the rabbitmq queue + autoscaling: + enabled: false + minReplicas: 2 + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 + livenessProbe: + enabled: false + periodSeconds: 60 + timeoutSeconds: 10 + failureThreshold: 3 + sidecars: [] + volumes: [] + volumeMounts: [] + + ingestConsumerAttachments: enabled: true replicas: 1 # concurrency: 4 @@ -244,6 +302,75 @@ sentry: # name: dshm # noStrictOffsetReset: false + + ingestConsumerEvents: + enabled: true + replicas: 1 + # concurrency: 4 + env: [] + resources: {} + affinity: {} + nodeSelector: {} + securityContext: {} + containerSecurityContext: {} + # tolerations: [] + # podLabels: [] + # maxBatchSize: "" + + # it's better to use prometheus adapter and scale based on + # the size of the rabbitmq queue + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 3 + targetCPUUtilizationPercentage: 50 + sidecars: [] + volumes: [] + + livenessProbe: + enabled: true + initialDelaySeconds: 5 + periodSeconds: 320 + # volumeMounts: + # - mountPath: /dev/shm + # name: dshm + + # noStrictOffsetReset: false + + ingestConsumerTransactions: + enabled: true + replicas: 1 + # concurrency: 4 + env: [] + resources: {} + affinity: {} + nodeSelector: {} + securityContext: {} + containerSecurityContext: {} + # tolerations: [] + # podLabels: [] + # maxBatchSize: "" + + # it's better to use prometheus adapter and scale based on + # the size of the rabbitmq queue + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 3 + targetCPUUtilizationPercentage: 50 + sidecars: [] + volumes: [] + + livenessProbe: + enabled: true + initialDelaySeconds: 5 + periodSeconds: 320 + # volumeMounts: + # - mountPath: /dev/shm + # name: dshm + + # noStrictOffsetReset: false + ingestReplayRecordings: enabled: true replicas: 1