Skip to content

Commit

Permalink
feat: added redis worker (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mokto authored Feb 5, 2020
1 parent 686613a commit 9e1cc7a
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sentry-db/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sentry-db
description: A Helm chart for Kubernetes
type: application
version: 0.5.0
version: 0.6.0
appVersion: 10.0.0
dependencies:
- name: redis
Expand Down
2 changes: 1 addition & 1 deletion sentry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: sentry
description: A Helm chart for Kubernetes
type: application
version: 0.5.0
version: 0.6.0
appVersion: 10.0.0
106 changes: 106 additions & 0 deletions sentry/templates/deployment-sentry-worker-redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "sentry.prefix" . }}sentry-worker-redis
labels:
app: sentry
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: sentry
release: "{{ .Release.Name }}"
role: sentry-worker-redis
replicas: {{ .Values.sentry.worker.replicas }}
template:
metadata:
annotations:
checksum/configYml: {{ .Values.config.yaml | sha256sum }}
checksum/sentryConfPy: {{ .Values.config.py | sha256sum }}
checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }}
{{- if .Values.sentry.worker.annotations }}
{{ toYaml .Values.sentry.worker.annotations | indent 8 }}
{{- end }}
labels:
app: sentry
release: "{{ .Release.Name }}"
role: sentry-worker-redis
{{- if .Values.sentry.worker.podLabels }}
{{ toYaml .Values.sentry.worker.podLabels | indent 8 }}
{{- end }}
spec:
affinity:
{{- if .Values.sentry.worker.affinity }}
{{ toYaml .Values.sentry.worker.affinity | indent 8 }}
{{- end }}
{{- if .Values.sentry.worker.nodeSelector }}
nodeSelector:
{{ toYaml .Values.sentry.worker.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.sentry.worker.tolerations }}
tolerations:
{{ toYaml .Values.sentry.worker.tolerations | indent 8 }}
{{- end }}
{{- if .Values.images.sentry.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-worker
image: "{{ .Values.images.sentry.repository }}:{{ .Values.images.sentry.tag }}"
imagePullPolicy: {{ .Values.images.sentry.pullPolicy }}
command: ["sentry"]
args:
- "run"
- "worker"
{{- if .Values.sentry.worker.concurrency }}
- "-c"
- "{{ .Values.sentry.worker.concurrency }}"
{{- end }}
env:
- name: SNUBA
value: http://{{ template "sentry.prefix" . }}snuba
- name: C_FORCE_ROOT
value: "true"
- name: BROKER_URL
value: redis://redis-master:6379/0
{{ if eq .Values.filestore.backend "gcs" }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/run/secrets/google/{{ .Values.filestore.gcs.credentialsFile }}
{{ end }}
{{- if .Values.sentry.worker.env }}
{{ toYaml .Values.sentry.worker.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.worker.resources | indent 12 }}
volumes:
- name: config
configMap:
name: {{ template "sentry.prefix" . }}sentry
- name: sentry-data
{{- if and (eq .Values.filestore.backend "filesystem") .Values.filestore.filesystem.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.filestore.filesystem.persistence.existingClaim | default (include "sentry.fullname" .) }}
{{- else }}
emptyDir: {}
{{ end }}
{{- if eq .Values.filestore.backend "gcs" }}
- name: sentry-google-cloud-key
secret:
secretName: {{ .Values.filestore.gcs.secretName }}
{{ end }}
{{- if .Values.sentry.worker.priorityClassName }}
priorityClassName: "{{ .Values.sentry.worker.priorityClassName }}"
{{- end }}

0 comments on commit 9e1cc7a

Please sign in to comment.