Skip to content

Commit 9e1cc7a

Browse files
authored
feat: added redis worker (#10)
1 parent 686613a commit 9e1cc7a

File tree

3 files changed

+108
-2
lines changed

3 files changed

+108
-2
lines changed

sentry-db/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: sentry-db
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 0.5.0
5+
version: 0.6.0
66
appVersion: 10.0.0
77
dependencies:
88
- name: redis

sentry/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: sentry
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 0.5.0
5+
version: 0.6.0
66
appVersion: 10.0.0
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ template "sentry.prefix" . }}sentry-worker-redis
5+
labels:
6+
app: sentry
7+
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
8+
release: "{{ .Release.Name }}"
9+
heritage: "{{ .Release.Service }}"
10+
spec:
11+
selector:
12+
matchLabels:
13+
app: sentry
14+
release: "{{ .Release.Name }}"
15+
role: sentry-worker-redis
16+
replicas: {{ .Values.sentry.worker.replicas }}
17+
template:
18+
metadata:
19+
annotations:
20+
checksum/configYml: {{ .Values.config.yaml | sha256sum }}
21+
checksum/sentryConfPy: {{ .Values.config.py | sha256sum }}
22+
checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }}
23+
{{- if .Values.sentry.worker.annotations }}
24+
{{ toYaml .Values.sentry.worker.annotations | indent 8 }}
25+
{{- end }}
26+
labels:
27+
app: sentry
28+
release: "{{ .Release.Name }}"
29+
role: sentry-worker-redis
30+
{{- if .Values.sentry.worker.podLabels }}
31+
{{ toYaml .Values.sentry.worker.podLabels | indent 8 }}
32+
{{- end }}
33+
spec:
34+
affinity:
35+
{{- if .Values.sentry.worker.affinity }}
36+
{{ toYaml .Values.sentry.worker.affinity | indent 8 }}
37+
{{- end }}
38+
{{- if .Values.sentry.worker.nodeSelector }}
39+
nodeSelector:
40+
{{ toYaml .Values.sentry.worker.nodeSelector | indent 8 }}
41+
{{- end }}
42+
{{- if .Values.sentry.worker.tolerations }}
43+
tolerations:
44+
{{ toYaml .Values.sentry.worker.tolerations | indent 8 }}
45+
{{- end }}
46+
{{- if .Values.images.sentry.imagePullSecrets }}
47+
imagePullSecrets:
48+
{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }}
49+
{{- end }}
50+
containers:
51+
- name: {{ .Chart.Name }}-worker
52+
image: "{{ .Values.images.sentry.repository }}:{{ .Values.images.sentry.tag }}"
53+
imagePullPolicy: {{ .Values.images.sentry.pullPolicy }}
54+
command: ["sentry"]
55+
args:
56+
- "run"
57+
- "worker"
58+
{{- if .Values.sentry.worker.concurrency }}
59+
- "-c"
60+
- "{{ .Values.sentry.worker.concurrency }}"
61+
{{- end }}
62+
env:
63+
- name: SNUBA
64+
value: http://{{ template "sentry.prefix" . }}snuba
65+
- name: C_FORCE_ROOT
66+
value: "true"
67+
- name: BROKER_URL
68+
value: redis://redis-master:6379/0
69+
{{ if eq .Values.filestore.backend "gcs" }}
70+
- name: GOOGLE_APPLICATION_CREDENTIALS
71+
value: /var/run/secrets/google/{{ .Values.filestore.gcs.credentialsFile }}
72+
{{ end }}
73+
{{- if .Values.sentry.worker.env }}
74+
{{ toYaml .Values.sentry.worker.env | indent 8 }}
75+
{{- end }}
76+
volumeMounts:
77+
- mountPath: /etc/sentry
78+
name: config
79+
readOnly: true
80+
- mountPath: {{ .Values.filestore.filesystem.path }}
81+
name: sentry-data
82+
{{- if eq .Values.filestore.backend "gcs" }}
83+
- name: sentry-google-cloud-key
84+
mountPath: /var/run/secrets/google
85+
{{ end }}
86+
resources:
87+
{{ toYaml .Values.sentry.worker.resources | indent 12 }}
88+
volumes:
89+
- name: config
90+
configMap:
91+
name: {{ template "sentry.prefix" . }}sentry
92+
- name: sentry-data
93+
{{- if and (eq .Values.filestore.backend "filesystem") .Values.filestore.filesystem.persistence.enabled }}
94+
persistentVolumeClaim:
95+
claimName: {{ .Values.filestore.filesystem.persistence.existingClaim | default (include "sentry.fullname" .) }}
96+
{{- else }}
97+
emptyDir: {}
98+
{{ end }}
99+
{{- if eq .Values.filestore.backend "gcs" }}
100+
- name: sentry-google-cloud-key
101+
secret:
102+
secretName: {{ .Values.filestore.gcs.secretName }}
103+
{{ end }}
104+
{{- if .Values.sentry.worker.priorityClassName }}
105+
priorityClassName: "{{ .Values.sentry.worker.priorityClassName }}"
106+
{{- end }}

0 commit comments

Comments
 (0)