From 8732e2bfd0d3236a7306e22805de8654caec597e Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Fri, 7 Aug 2020 16:07:34 +0200 Subject: [PATCH 1/8] feat(sentry): enable sentry ingest consumer Signed-off-by: Yoan Blanc --- sentry/Chart.yaml | 2 +- .../deployment-sentry-ingest-consumer.yaml | 114 ++++++++++++++++++ sentry/values.yaml | 18 +++ 3 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 sentry/templates/deployment-sentry-ingest-consumer.yaml diff --git a/sentry/Chart.yaml b/sentry/Chart.yaml index c5c038acc..09005dd5f 100644 --- a/sentry/Chart.yaml +++ b/sentry/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: sentry description: A Helm chart for Kubernetes type: application -version: 4.8.0 +version: 4.8.1 appVersion: 20.7.0 dependencies: - name: redis diff --git a/sentry/templates/deployment-sentry-ingest-consumer.yaml b/sentry/templates/deployment-sentry-ingest-consumer.yaml new file mode 100644 index 000000000..b9e7cb5c7 --- /dev/null +++ b/sentry/templates/deployment-sentry-ingest-consumer.yaml @@ -0,0 +1,114 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sentry.fullname" . }}-ingest-consumer + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: ingest-consumer +{{- if not .Values.sentry.ingestConsumer.autoscaling.enabled }} + replicas: {{ .Values.sentry.ingestConsumer.replicas }} +{{- end }} + template: + metadata: + annotations: + checksum/configYml: {{ .Values.config.configYml | sha256sum }} + checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} + checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + {{- if .Values.sentry.ingestConsumer.annotations }} +{{ toYaml .Values.sentry.ingestConsumer.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 }} + {{- end }} + spec: + affinity: + {{- if .Values.sentry.ingestConsumer.affinity }} +{{ toYaml .Values.sentry.ingestConsumer.affinity | indent 8 }} + {{- end }} + {{- if .Values.sentry.ingestConsumer.nodeSelector }} + nodeSelector: +{{ toYaml .Values.sentry.ingestConsumer.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.sentry.ingestConsumer.tolerations }} + tolerations: +{{ toYaml .Values.sentry.ingestConsumer.tolerations | indent 8 }} + {{- end }} + {{- if .Values.images.sentry.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-ingest-consumer + image: "{{ .Values.images.sentry.repository }}:{{ .Values.images.sentry.tag }}" + imagePullPolicy: {{ .Values.images.sentry.pullPolicy }} + command: ["sentry"] + args: + - "run" + - "ingest-consumer" + - "--all-consumer-types" + {{- if .Values.sentry.ingestConsumer.concurrency }} + - "-c" + - "{{ .Values.sentry.ingestConsumer.concurrency }}" + {{- end }} + env: + - name: SNUBA + value: http://{{ template "sentry.fullname" . }}-snuba:{{ template "snuba.port" }} + - name: C_FORCE_ROOT + value: "true" + {{- if .Values.postgresql.enabled }} + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "sentry.postgresql.fullname" . }} + key: postgresql-password + {{- end }} + {{ if eq .Values.filestore.backend "gcs" }} + - name: GOOGLE_APPLICATION_CREDENTIALS + value: /var/run/secrets/google/{{ .Values.filestore.gcs.credentialsFile }} + {{ end }} +{{- if .Values.sentry.ingestConsumer.env }} +{{ toYaml .Values.sentry.ingestConsumer.env | indent 8 }} +{{- end }} + volumeMounts: + - mountPath: /etc/sentry + name: config + readOnly: true + - mountPath: {{ .Values.filestore.filesystem.path }} + name: sentry-data + {{- if eq .Values.filestore.backend "gcs" }} + - name: sentry-google-cloud-key + mountPath: /var/run/secrets/google + {{ end }} + resources: +{{ toYaml .Values.sentry.ingestConsumer.resources | indent 12 }} + 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) }} + persistentVolumeClaim: + claimName: {{ template "sentry.fullname" . }}-data + {{- else }} + emptyDir: {} + {{ end }} + {{- if eq .Values.filestore.backend "gcs" }} + - name: sentry-google-cloud-key + secret: + secretName: {{ .Values.filestore.gcs.secretName }} + {{ end }} + {{- if .Values.sentry.ingestConsumer.priorityClassName }} + priorityClassName: "{{ .Values.sentry.ingestConsumer.priorityClassName }}" + {{- end }} diff --git a/sentry/values.yaml b/sentry/values.yaml index 772fbca4d..e7e2e64ea 100644 --- a/sentry/values.yaml +++ b/sentry/values.yaml @@ -52,6 +52,24 @@ sentry: maxReplicas: 5 targetCPUUtilizationPercentage: 50 + ingestConsumer: + 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: 1 + maxReplicas: 3 + targetCPUUtilizationPercentage: 50 + cron: env: [] resources: {} From 999a68599d14e0c1954d436454cb048c9d354c27 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Mon, 10 Aug 2020 11:10:15 +0200 Subject: [PATCH 2/8] feat(sentry): add nginx Signed-off-by: Yoan Blanc --- sentry/Chart.lock | 7 +++++-- sentry/Chart.yaml | 4 ++++ sentry/charts/nginx-6.0.5.tgz | Bin 0 -> 15107 bytes sentry/templates/_helper.tpl | 4 +++- sentry/templates/configmap-nginx.yaml | 17 +++++++++++++++++ sentry/values.yaml | 8 ++++++++ 6 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 sentry/charts/nginx-6.0.5.tgz create mode 100644 sentry/templates/configmap-nginx.yaml diff --git a/sentry/Chart.lock b/sentry/Chart.lock index cd19623d3..21da05b1c 100644 --- a/sentry/Chart.lock +++ b/sentry/Chart.lock @@ -14,5 +14,8 @@ dependencies: - name: postgresql repository: https://kubernetes-charts.storage.googleapis.com/ version: 8.2.1 -digest: sha256:b0c03af78854426fbb32803b55427b4c6aadb98a753f1163f8ed906ade6e69d9 -generated: "2020-07-23T08:54:02.125539557+02:00" +- name: nginx + repository: https://charts.bitnami.com/bitnami + version: 6.0.5 +digest: sha256:95a04a0fd6722f2f1b2d1750355060369a7d8e1cee6fd0e26974a4c402aff998 +generated: "2020-08-10T10:58:35.648936347+02:00" diff --git a/sentry/Chart.yaml b/sentry/Chart.yaml index 09005dd5f..ce5ef4d35 100644 --- a/sentry/Chart.yaml +++ b/sentry/Chart.yaml @@ -26,3 +26,7 @@ dependencies: repository: https://kubernetes-charts.storage.googleapis.com/ version: 8.2.1 condition: postgresql.enabled + - name: nginx + repository: https://charts.bitnami.com/bitnami + version: 6.0.5 + condition: nginx.enabled diff --git a/sentry/charts/nginx-6.0.5.tgz b/sentry/charts/nginx-6.0.5.tgz new file mode 100644 index 0000000000000000000000000000000000000000..31729473bcd221daa04714fc202af85e82045c71 GIT binary patch literal 15107 zcmV+eJN(2SiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PMYeSKK(VFn<5`r>LjNeFC%C-9VDb_HOq42w^guNeBl>=FTrO zC#Y?8w-&eMv1AAvxS#zwDoM8Nw)+K|%w!ku*$i##rAn$Ql}e?mWWkd|Lyg9_5b#sJ$?FLTRY!x?QEHHTiZL^-~Si%?gNPtEDvR#QIDkT1I+~ENgpn@Jd&ox&#hqV zufdiVQ4wY=mG}+`3WhubIi`R_27+c6H1nwXMf)(~GL5}4pU^&xrA+(X?&alWfMo-o zjXV~rme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0kp{EWdRHZ3r1$X9IW5!IFZ?*b+4xA?Cx@qSNYFjaq zB=iFOU;laUc~2)*kGY|&t|=!rLU{FB^PH!>f*rj4icq;qtSP> zShY~}D4BwctFI|Hg}JOmXvdK^%M23`De*nHQq9OhY|f75_*f$sOyG5EA4_S zto+LDMHyleLAJH&2iBl$y3e$*}bEQV-8F-(LGNP6X&0kN0XF<=~jnqEFEDY}T zH$~wJ^1znv1wGGuNy76>l0~8rVM^`3vT|*dlZ+&i(g^Y-R$PWWS}NPdQj1!)Ngjc6 z`>}AgDI)MJHD2=UoMb##iW^0`<&YyDRI7?cZx^Kykz4~CKsA|y6~ROZG_)9rR7<>} z5K)9sRS6zpKE6=KHd%zTr^4dk`ymk_iRcS7zS_O6g;f`7%&@bjmcXrVX?VBpZ+KH8 z!*SE-%Bz&V_^03r`00zsAHQ^X+UY|_C+6sELMJ71tlo4L`*rQnK-bBBs3qO>Oi5C-(*{8m ziub~?%-R4-)i$Cs#h>wQ?L}jcdgrf_umsbc&8{%04><94)8{ zOgXe9rav|!H)c^plUhdr9h4oNKH%nkv--{MEDicyJ26hF8?XMC{;$EZw`5B69?84j)}xUln$< z4&9kY8?5j5%C6;r>4T4k{_UCVOdj2{=O)F?l`?~c8}M0U zHe=l8j@`WRYjLNZZli4|YdVVLATtu47ZancuMIs;chMrNV1__~IYJ3s!DK*c5=>AL lPW4}{VhdHkn}^Nw!}IVwJb(J<{{;X5|Nk}t5Xb;n0RXJVeq{gv literal 0 HcmV?d00001 diff --git a/sentry/templates/_helper.tpl b/sentry/templates/_helper.tpl index 2c03e32d0..d68c543af 100644 --- a/sentry/templates/_helper.tpl +++ b/sentry/templates/_helper.tpl @@ -1,3 +1,5 @@ +{{/* vim: set filetype=mustache: */}} + {{- define "sentry.prefix" -}} {{- if .Values.prefix -}} {{.Values.prefix}}- @@ -5,10 +7,10 @@ {{- end -}} {{- end -}} +{{- define "nginx.port" -}}{{ default "8080" .Values.nginx.containerPort }}{{- end -}} {{- define "sentry.port" -}}9000{{- end -}} {{- define "snuba.port" -}}1218{{- end -}} -{{/* vim: set filetype=mustache: */}} {{/* Expand the name of the chart. */}} diff --git a/sentry/templates/configmap-nginx.yaml b/sentry/templates/configmap-nginx.yaml new file mode 100644 index 000000000..bee7fda4c --- /dev/null +++ b/sentry/templates/configmap-nginx.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "sentry.fullname" . }}-nginx +data: + server-block.conf: | + upstream sentry { + server {{ template "sentry.fullname" . }}-web:{{ template "sentry.port" }}; + } + + server { + listen {{ template "nginx.port" }}; + + location / { + proxy_pass http://sentry; + } + } diff --git a/sentry/values.yaml b/sentry/values.yaml index e7e2e64ea..04f2df2d2 100644 --- a/sentry/values.yaml +++ b/sentry/values.yaml @@ -220,6 +220,14 @@ slack: {} # # ref : https://github.com/getsentry/sentry/pull/19446 # legacyApp: +nginx: + enabled: true + containerPort: 8080 + existingServerBlockConfigmap: sentry-nginx + resources: {} + service: + type: ClusterIP + ingress: enabled: false # annotations: From 50b6c47cf91054395137c4df93c9dba4a419d816 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Mon, 10 Aug 2020 12:32:27 +0200 Subject: [PATCH 3/8] feat(sentry): add relay Signed-off-by: Yoan Blanc --- sentry/templates/_helper.tpl | 1 + sentry/templates/configmap-nginx.yaml | 12 +++ sentry/templates/configmap-relay.yaml | 29 ++++++ sentry/templates/configmap-sentry.yaml | 9 +- sentry/templates/deployment-relay.yaml | 117 +++++++++++++++++++++++++ sentry/templates/hpa-relay.yaml | 14 +++ sentry/templates/service-relay.yaml | 27 ++++++ sentry/values.yaml | 24 ++++- 8 files changed, 231 insertions(+), 2 deletions(-) create mode 100644 sentry/templates/configmap-relay.yaml create mode 100644 sentry/templates/deployment-relay.yaml create mode 100644 sentry/templates/hpa-relay.yaml create mode 100644 sentry/templates/service-relay.yaml diff --git a/sentry/templates/_helper.tpl b/sentry/templates/_helper.tpl index d68c543af..aa75a3384 100644 --- a/sentry/templates/_helper.tpl +++ b/sentry/templates/_helper.tpl @@ -8,6 +8,7 @@ {{- end -}} {{- define "nginx.port" -}}{{ default "8080" .Values.nginx.containerPort }}{{- end -}} +{{- define "relay.port" -}}3000{{- end -}} {{- define "sentry.port" -}}9000{{- end -}} {{- define "snuba.port" -}}1218{{- end -}} diff --git a/sentry/templates/configmap-nginx.yaml b/sentry/templates/configmap-nginx.yaml index bee7fda4c..1939a39c9 100644 --- a/sentry/templates/configmap-nginx.yaml +++ b/sentry/templates/configmap-nginx.yaml @@ -4,6 +4,10 @@ metadata: name: {{ template "sentry.fullname" . }}-nginx data: server-block.conf: | + upstream relay { + server {{ template "sentry.fullname" . }}-relay:{{ template "relay.port" }}; + } + upstream sentry { server {{ template "sentry.fullname" . }}-web:{{ template "sentry.port" }}; } @@ -11,6 +15,14 @@ data: server { listen {{ template "nginx.port" }}; + location /api/store/ { + proxy_pass http://relay; + } + + location ~ ^/api/[1-9]\d*/ { + proxy_pass http://relay; + } + location / { proxy_pass http://sentry; } diff --git a/sentry/templates/configmap-relay.yaml b/sentry/templates/configmap-relay.yaml new file mode 100644 index 000000000..7829fae2f --- /dev/null +++ b/sentry/templates/configmap-relay.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "sentry.fullname" . }}-relay + labels: + app: sentry + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: + config.yml: |- + relay: + mode: managed + upstream: "http://{{ template "sentry.fullname" . }}-web:{{ template "sentry.port" }}/" + host: 0.0.0.0 + port: {{ template "relay.port" }} + + processing: + enabled: true + + kafka_config: + - name: "bootstrap.servers" + value: {{ template "sentry.fullname" . }}-kafka:9092 + - name: "message.max.bytes" + value: 50000000 # 50MB or bust + + redis: "redis://{{ template "sentry.fullname" . }}-sentry-redis-master:6379" + +{{ .Values.config.relay | indent 4 }} diff --git a/sentry/templates/configmap-sentry.yaml b/sentry/templates/configmap-sentry.yaml index a79591091..cafe24b02 100644 --- a/sentry/templates/configmap-sentry.yaml +++ b/sentry/templates/configmap-sentry.yaml @@ -295,6 +295,7 @@ data: "organizations:performance-view", "organizations:repos", "organizations:require-2fa", + "organizations:relay", "organizations:sentry10", "organizations:sso-basic", "organizations:sso-rippling", @@ -333,7 +334,13 @@ data: ######################## # BITBUCKET_CONSUMER_KEY = 'YOUR_BITBUCKET_CONSUMER_KEY' - # BITBUCKET_CONSUMER_SECRET = 'YOUR_BITBUCKET_CONSUMER_SECRET' + # BITBUCKET_CONSUMER_SECRET = 'YOUR_BITBUCKET_CONSUMER_SECRET + + ######### + # Relay # + ######### + SENTRY_RELAY_WHITELIST_PK = [] + SENTRY_RELAY_OPEN_REGISTRATION = True {{- if .Values.metrics.enabled }} SENTRY_METRICS_BACKEND = 'sentry.metrics.statsd.StatsdMetricsBackend' diff --git a/sentry/templates/deployment-relay.yaml b/sentry/templates/deployment-relay.yaml new file mode 100644 index 000000000..3261cb6fc --- /dev/null +++ b/sentry/templates/deployment-relay.yaml @@ -0,0 +1,117 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sentry.fullname" . }}-relay + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: relay +{{- if not .Values.relay.autoscaling.enabled }} + replicas: {{ .Values.relay.replicas }} +{{- end }} + template: + metadata: + annotations: + checksum/relay: {{ .Values.config.relay | sha256sum }} + checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-relay.yaml") . | sha256sum }} + {{- if .Values.relay.annotations }} +{{ toYaml .Values.relay.annotations | indent 8 }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: relay + {{- if .Values.relay.podLabels }} +{{ toYaml .Values.relay.podLabels | indent 8 }} + {{- end }} + spec: + affinity: + {{- if .Values.relay.affinity }} +{{ toYaml .Values.relay.affinity | indent 8 }} + {{- end }} + {{- if .Values.relay.nodeSelector }} + nodeSelector: +{{ toYaml .Values.relay.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.relay.tolerations }} + tolerations: +{{ toYaml .Values.relay.tolerations | indent 8 }} + {{- end }} + {{- if .Values.images.relay.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.images.relay.imagePullSecrets | indent 8 }} + {{- end }} + initContainers: + - name: {{ .Chart.Name }}-relay-init + image: {{ .Values.images.relay.repository }}:{{ .Values.images.relay.tag }} + args: + - "credentials" + - "generate" + env: + - name: RELAY_PORT + value: '{{ template "relay.port" }}' + volumeMounts: + - name: credentials + mountPath: /work/.relay + - name: config + mountPath: /work/.relay/config.yml + subPath: config.yml + readOnly: true + containers: + - name: {{ .Chart.Name }}-relay + image: "{{ .Values.images.relay.repository }}:{{ .Values.images.relay.tag }}" + imagePullPolicy: {{ .Values.images.relay.pullPolicy }} + ports: + - containerPort: {{ template "relay.port" }} + env: + - name: RELAY_PORT + value: '{{ template "relay.port" }}' +{{- if .Values.relay.env }} +{{ toYaml .Values.relay.env | indent 8 }} +{{- end }} + volumeMounts: + - name: credentials + mountPath: /work/.relay + - name: config + mountPath: /work/.relay/config.yml + subPath: config.yml + readOnly: true + livenessProbe: + failureThreshold: 5 + httpGet: + path: /api/relay/healthcheck/ready/ + port: {{ template "relay.port" }} + scheme: HTTP + initialDelaySeconds: {{ .Values.relay.probeInitialDelaySeconds }} + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 2 + readinessProbe: + failureThreshold: 10 + httpGet: + path: /api/relay/healthcheck/ready/ + port: {{ template "relay.port" }} + scheme: HTTP + initialDelaySeconds: {{ .Values.relay.probeInitialDelaySeconds }} + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 2 + resources: +{{ toYaml .Values.relay.resources | indent 12 }} + volumes: + - name: config + configMap: + name: {{ template "sentry.fullname" . }}-relay + defaultMode: 0644 + - name: credentials + emptyDir: {} + {{- if .Values.relay.priorityClassName }} + priorityClassName: "{{ .Values.relay.priorityClassName }}" + {{- end }} diff --git a/sentry/templates/hpa-relay.yaml b/sentry/templates/hpa-relay.yaml new file mode 100644 index 000000000..6b3403feb --- /dev/null +++ b/sentry/templates/hpa-relay.yaml @@ -0,0 +1,14 @@ +{{- if .Values.relay.autoscaling.enabled }} +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "sentry.fullname" . }}-relay +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "sentry.fullname" . }}-relay + minReplicas: {{ .Values.relay.autoscaling.minReplicas }} + maxReplicas: {{ .Values.relay.autoscaling.maxReplicas }} + targetCPUUtilizationPercentage: {{ .Values.relay.autoscaling.targetCPUUtilizationPercentage }} +{{- end }} diff --git a/sentry/templates/service-relay.yaml b/sentry/templates/service-relay.yaml new file mode 100644 index 000000000..4ff82d1dd --- /dev/null +++ b/sentry/templates/service-relay.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "sentry.fullname" . }}-relay + annotations: + {{- range $key, $value := .Values.service.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- if .Values.service.annotations }} + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} +{{- end }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ template "relay.port" . }} + targetPort: {{ template "relay.port" }} + protocol: TCP + name: {{ .Values.service.name }}-relay + selector: + app: {{ template "sentry.fullname" . }} + role: relay diff --git a/sentry/values.yaml b/sentry/values.yaml index 04f2df2d2..ff3b56e10 100644 --- a/sentry/values.yaml +++ b/sentry/values.yaml @@ -16,6 +16,27 @@ images: tag: e944bc414bfc97c9836febbfb2f310a3237f91cf pullPolicy: IfNotPresent # imagePullSecrets: [] + relay: + repository: getsentry/relay + tag: 20.7.0 + pullPolicy: IfNotPresent + # imagePullSecrets: [] + +relay: + replicas: 1 + env: [] + probeInitialDelaySeconds: 10 + resources: {} + affinity: {} + nodeSelector: {} + # tolerations: [] + # podLabels: [] + + autoscaling: + enabled: false + minReplicas: 2 + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 sentry: web: @@ -298,7 +319,8 @@ config: # No Python Extension Config Given snubaSettingsPy: | # No Python Extension Config Given - + relay: | + # No YAML relay config given clickhouse: enabled: true From 9be03b1ccfe3757264b3e6c8d372c313d01a1a57 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Mon, 10 Aug 2020 13:56:48 +0200 Subject: [PATCH 4/8] feat(sentry): ingress or nginx Signed-off-by: Yoan Blanc --- sentry/templates/ingress.yaml | 15 +++++++++++++++ sentry/values.yaml | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/sentry/templates/ingress.yaml b/sentry/templates/ingress.yaml index 9cc484341..d6800d06d 100644 --- a/sentry/templates/ingress.yaml +++ b/sentry/templates/ingress.yaml @@ -17,10 +17,25 @@ spec: - host: {{ .Values.ingress.hostname }} http: paths: + {{- if .Values.nginx.enabled }} + - path: {{ default "/" .Values.ingress.path | quote }} + backend: + serviceName: {{ template "sentry.fullname" . }}-nginx + servicePort: {{ .Values.nginx.service.port }} + {{- else }} + - path: {{ default "/" .Values.ingress.path }}api/store + backend: + serviceName: {{ template "sentry.fullname" . }}-relay + servicePort: {{ template "relay.port" . }} + - path: {{ default "/" .Values.ingress.path }}api/[1-9][0-9]*/(.*) + backend: + serviceName: {{ template "sentry.fullname" . }}-relay + servicePort: {{ template "relay.port" . }} - path: {{ default "/" .Values.ingress.path | quote }} backend: serviceName: {{ template "sentry.fullname" . }}-web servicePort: {{ .Values.service.externalPort }} + {{- end }} {{- if .Values.ingress.tls }} tls: {{ toYaml .Values.ingress.tls | indent 4 }} diff --git a/sentry/values.yaml b/sentry/values.yaml index ff3b56e10..3b8efd886 100644 --- a/sentry/values.yaml +++ b/sentry/values.yaml @@ -248,13 +248,21 @@ nginx: resources: {} service: type: ClusterIP + port: 80 ingress: enabled: false # annotations: # kubernetes.io/tls-acme: # certmanager.k8s.io/issuer: + # # nginx.ingress.kubernetes.io/proxy-body-size: + # nginx.ingress.kubernetes.io/use-regex: "true" + # + # nginx.ingress.kubernetes.io/enable-cors: "true" + # nginx.ingress.kubernetes.io/cors-allow-methods: "PUT,GET,POST,OPTIONS" + # nginx.ingress.kubernetes.io/cors-allow-origin: "*" + # nginx.ingress.kubernetes.io/cors-allow-credentials: "true" # # hostname: # From 76b9f051d4542c8731932d8642857aaf98f96f07 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Mon, 10 Aug 2020 14:36:41 +0200 Subject: [PATCH 5/8] fix(sentry): ignore nginx config when disabled Signed-off-by: Yoan Blanc --- sentry/templates/configmap-nginx.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sentry/templates/configmap-nginx.yaml b/sentry/templates/configmap-nginx.yaml index 1939a39c9..821a6f9cc 100644 --- a/sentry/templates/configmap-nginx.yaml +++ b/sentry/templates/configmap-nginx.yaml @@ -1,3 +1,4 @@ +{{- if .Values.nginx.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -27,3 +28,4 @@ data: proxy_pass http://sentry; } } +{{- end }} From d2107bba44e38a618424767b1935f91881d9d612 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Mon, 10 Aug 2020 15:09:55 +0200 Subject: [PATCH 6/8] feat(sentry): bump sentry version Signed-off-by: Yoan Blanc --- sentry/Chart.yaml | 4 ++-- sentry/templates/configmap-sentry.yaml | 2 +- sentry/values.yaml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sentry/Chart.yaml b/sentry/Chart.yaml index ce5ef4d35..76f4b4082 100644 --- a/sentry/Chart.yaml +++ b/sentry/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: sentry description: A Helm chart for Kubernetes type: application -version: 4.8.1 -appVersion: 20.7.0 +version: 4.9.99 +appVersion: 20.7.2 dependencies: - name: redis repository: https://charts.bitnami.com/bitnami diff --git a/sentry/templates/configmap-sentry.yaml b/sentry/templates/configmap-sentry.yaml index cafe24b02..6b441cfa7 100644 --- a/sentry/templates/configmap-sentry.yaml +++ b/sentry/templates/configmap-sentry.yaml @@ -334,7 +334,7 @@ data: ######################## # BITBUCKET_CONSUMER_KEY = 'YOUR_BITBUCKET_CONSUMER_KEY' - # BITBUCKET_CONSUMER_SECRET = 'YOUR_BITBUCKET_CONSUMER_SECRET + # BITBUCKET_CONSUMER_SECRET = 'YOUR_BITBUCKET_CONSUMER_SECRET' ######### # Relay # diff --git a/sentry/values.yaml b/sentry/values.yaml index 3b8efd886..c355a17bb 100644 --- a/sentry/values.yaml +++ b/sentry/values.yaml @@ -8,17 +8,17 @@ user: images: sentry: repository: getsentry/sentry - tag: cc9f7d1 + tag: 20.7.2 pullPolicy: IfNotPresent # imagePullSecrets: [] snuba: repository: getsentry/snuba - tag: e944bc414bfc97c9836febbfb2f310a3237f91cf + tag: 20.7.2 pullPolicy: IfNotPresent # imagePullSecrets: [] relay: repository: getsentry/relay - tag: 20.7.0 + tag: 20.7.2 pullPolicy: IfNotPresent # imagePullSecrets: [] From 6dc8e8d307827b0517cb00bfa62b6c1037c58fd4 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Tue, 11 Aug 2020 06:33:46 +0200 Subject: [PATCH 7/8] chore(sentry): explain ingress vs nginx Signed-off-by: Yoan Blanc --- sentry/Chart.yaml | 2 +- sentry/README.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sentry/Chart.yaml b/sentry/Chart.yaml index 76f4b4082..04986fcfd 100644 --- a/sentry/Chart.yaml +++ b/sentry/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: sentry description: A Helm chart for Kubernetes type: application -version: 4.9.99 +version: 5.0.0 appVersion: 20.7.2 dependencies: - name: redis diff --git a/sentry/README.md b/sentry/README.md index ab40bc32c..5d68c6c87 100644 --- a/sentry/README.md +++ b/sentry/README.md @@ -7,6 +7,7 @@ From the previous upgrade, make sure to get the following from your previous ins Both should be in the `secrets` of your original 9.0 release. Make a note of both of these values. #### Upgrade Steps + Due to an issue where transferring from Helm 2 to 3. Statefulsets that use the following: `heritage: {{ .Release.Service }}` in the metadata field will error out with a `Forbidden` error during the upgrade. The only workaround is to delete the existing statefulsets (Don't worry, PVC will be retained): > kubectl delete --all sts -n @@ -33,6 +34,8 @@ Parameter | Description `user.create` | if `true`, creates a default admin user defined from `email` and `password` | `true` `user.email` | Admin user email | `admin@sentry.local` `user.password` | Admin user password| `aaaa` +`ingess.enabled` | Enabling Ingress | `false` +`nginx.enabled` | Enabling NGINX | `true` `metrics.enabled`| if `true`, enable Prometheus metrics | `false` `metrics.image.repository` | Metrics exporter image repository | `prom/statsd-exporter` `metrics.image.tag` | Metrics exporter image tag | `v0.10.5` @@ -57,6 +60,10 @@ Parameter | Description `metrics.serviceMonitor.scrapeInterval` | interval between Prometheus scraping | `30s` `system.secretKey` | secret key for the session cookie ([documentation](https://develop.sentry.dev/config/#general)) | `nil` +## NGINX and/or Ingress + +By default, NGINX is enabled to allow sending the incoming requests to [Sentry Relay](https://getsentry.github.io/relay/) or the Django backend depending on the path. When Sentry is meant to be exposed outside of the Kubernetes cluster, it is recommended to disable NGINX and let the Ingress do the same. It's recommended to go with the go to Ingress Controller, [NGINX Ingress](https://kubernetes.github.io/ingress-nginx/) but others should work as well. + ## Sentry secret key For your security, the [`system.secret-key`](https://develop.sentry.dev/config/#general) is generated for you on the first installation. Another one will be regenerated on each upgrade invalidating all the current sessions unless it's been provided. The value is stored in the `sentry-sentry` configmap. From 28a1328ed5ffea57a9f6ac9a1956d19f285897fe Mon Sep 17 00:00:00 2001 From: Theo Mathieu Date: Tue, 11 Aug 2020 09:34:00 +0200 Subject: [PATCH 8/8] feat: finalize pr --- README.md | 12 ++++++++++++ sentry/README.md | 2 +- sentry/templates/configmap-relay.yaml | 11 +++++++++-- sentry/values.yaml | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e77da7c86..d2a28f41d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,18 @@ 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 4.x.x version of this Chart to 5.0.0 + +As Relay is now part of this chart your need to make sure you enable either Nginx or the Ingress. Please read the next paragraph for more informations. + +If you are using an ingress gateway (like istio), you have to change your inbound path from sentry-web to nginx. + +## NGINX and/or Ingress + +By default, NGINX is enabled to allow sending the incoming requests to [Sentry Relay](https://getsentry.github.io/relay/) or the Django backend depending on the path. When Sentry is meant to be exposed outside of the Kubernetes cluster, it is recommended to disable NGINX and let the Ingress do the same. It's recommended to go with the go to Ingress Controller, [NGINX Ingress](https://kubernetes.github.io/ingress-nginx/) but others should work as well. + + ## Upgrading from 3.1.0 version of this Chart to 4.0.0 Following Helm Chart best practices the new version introduces some breaking changes, all configuration for external diff --git a/sentry/README.md b/sentry/README.md index 5d68c6c87..f79649d11 100644 --- a/sentry/README.md +++ b/sentry/README.md @@ -34,7 +34,7 @@ Parameter | Description `user.create` | if `true`, creates a default admin user defined from `email` and `password` | `true` `user.email` | Admin user email | `admin@sentry.local` `user.password` | Admin user password| `aaaa` -`ingess.enabled` | Enabling Ingress | `false` +`ingress.enabled` | Enabling Ingress | `false` `nginx.enabled` | Enabling NGINX | `true` `metrics.enabled`| if `true`, enable Prometheus metrics | `false` `metrics.image.repository` | Metrics exporter image repository | `prom/statsd-exporter` diff --git a/sentry/templates/configmap-relay.yaml b/sentry/templates/configmap-relay.yaml index 7829fae2f..275a49042 100644 --- a/sentry/templates/configmap-relay.yaml +++ b/sentry/templates/configmap-relay.yaml @@ -1,3 +1,6 @@ +{{- $redisHost := include "sentry.redis.host" . -}} +{{- $redisPort := include "sentry.redis.port" . -}} +{{- $redisPass := include "sentry.redis.password" . -}} apiVersion: v1 kind: ConfigMap metadata: @@ -20,10 +23,14 @@ data: kafka_config: - name: "bootstrap.servers" - value: {{ template "sentry.fullname" . }}-kafka:9092 + value: {{ printf "%s:%s" (include "sentry.kafka.host" .) (include "sentry.kafka.port" .) }} - name: "message.max.bytes" value: 50000000 # 50MB or bust - redis: "redis://{{ template "sentry.fullname" . }}-sentry-redis-master:6379" + {{- if $redisPass }} + redis: "redis://:{{ $redisPass }}@{{ $redisHost }}:{{ $redisPort }}" + {{- else }} + redis: "redis://{{ $redisHost }}:{{ $redisPort }}" + {{- end }} {{ .Values.config.relay | indent 4 }} diff --git a/sentry/values.yaml b/sentry/values.yaml index c355a17bb..8bebd189d 100644 --- a/sentry/values.yaml +++ b/sentry/values.yaml @@ -246,6 +246,7 @@ nginx: containerPort: 8080 existingServerBlockConfigmap: sentry-nginx resources: {} + replicaCount: 1 service: type: ClusterIP port: 80