Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(symbolicator): implement deployment and statefulset selection #1453

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.symbolicator.enabled }}
{{- if .Values.symbolicator.api.usedeployment }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -139,3 +140,4 @@ spec:
priorityClassName: "{{ .Values.symbolicator.api.priorityClassName }}"
{{- end }}
{{- end }}
{{- end }}
161 changes: 161 additions & 0 deletions charts/sentry/templates/symbolicator/statefulset-symbolicator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{{- if .Values.symbolicator.enabled }}
{{- if not .Values.symbolicator.api.usedeployment }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "sentry.fullname" . }}-symbolicator-api
labels:
app: {{ template "sentry.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
serviceName: {{ template "sentry.fullname" . }}-symbolicator-api
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
app: {{ template "sentry.fullname" . }}
release: "{{ .Release.Name }}"
role: symbolicator-api
{{- if not .Values.symbolicator.api.autoscaling.enabled }}
replicas: {{ .Values.symbolicator.api.replicas }}
{{- end }}
template:
metadata:
annotations:
checksum/config.yaml: {{ include "sentry.symbolicator.config" . | sha256sum }}
{{- if .Values.symbolicator.api.annotations }}
{{ toYaml .Values.symbolicator.api.annotations | indent 8 }}
{{- end }}
labels:
app: {{ template "sentry.fullname" . }}
release: "{{ .Release.Name }}"
role: symbolicator-api
{{- if .Values.symbolicator.api.podLabels }}
{{ toYaml .Values.symbolicator.api.podLabels | indent 8 }}
{{- end }}
spec:
{{- if .Values.symbolicator.api.affinity }}
affinity:
{{ toYaml .Values.symbolicator.api.affinity | indent 8 }}
{{- end }}
{{- if .Values.symbolicator.api.nodeSelector }}
nodeSelector:
{{ toYaml .Values.symbolicator.api.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.symbolicator.api.tolerations }}
tolerations:
{{ toYaml .Values.symbolicator.api.tolerations | indent 8 }}
{{- end }}
{{- if .Values.symbolicator.api.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.symbolicator.api.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.images.symbolicator.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.images.symbolicator.imagePullSecrets | indent 8 }}
{{- end }}
{{- if .Values.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy | quote }}
{{- end }}
{{- if .Values.dnsConfig }}
dnsConfig:
{{ toYaml .Values.dnsConfig | indent 8 }}
{{- end }}
{{- if .Values.symbolicator.api.securityContext }}
securityContext:
{{ toYaml .Values.symbolicator.api.securityContext | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-symbolicator
image: "{{ template "symbolicator.image" . }}"
imagePullPolicy: {{ default "IfNotPresent" .Values.images.symbolicator.pullPolicy }}
args: ["run", "-c", "/etc/symbolicator/config.yml"]
ports:
- containerPort: {{ template "symbolicator.port" }}
env:
{{ if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/run/secrets/google/{{ .Values.filestore.gcs.credentialsFile }}
{{ end }}
{{- if .Values.symbolicator.api.env }}
{{ toYaml .Values.symbolicator.api.env | indent 8 }}
{{- end }}
volumeMounts:
- mountPath: /etc/symbolicator
name: config
readOnly: true
- mountPath: /data
name: symbolicator-data
{{- if and (eq .Values.filestore.backend "gcs") .Values.filestore.gcs.secretName }}
- name: sentry-google-cloud-key
mountPath: /var/run/secrets/google
{{ end }}
{{- if .Values.symbolicator.api.volumeMounts }}
{{ toYaml .Values.symbolicator.api.volumeMounts | indent 8 }}
{{- end }}
livenessProbe:
failureThreshold: 5
httpGet:
path: /healthcheck
port: {{ template "symbolicator.port" }}
scheme: HTTP
initialDelaySeconds: {{ .Values.symbolicator.api.probeInitialDelaySeconds }}
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
readinessProbe:
failureThreshold: 10
httpGet:
path: /healthcheck
port: {{ template "symbolicator.port" }}
scheme: HTTP
initialDelaySeconds: {{ .Values.symbolicator.api.probeInitialDelaySeconds }}
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
resources:
{{ toYaml .Values.symbolicator.api.resources | indent 12 }}
{{- if .Values.symbolicator.api.containerSecurityContext }}
securityContext:
{{ toYaml .Values.symbolicator.api.containerSecurityContext | indent 12 }}
{{- end }}
{{- if .Values.serviceAccount.enabled }}
serviceAccountName: {{ .Values.serviceAccount.name }}-symbolicator-api
{{- end }}
volumes:
- name: config
configMap:
name: {{ template "sentry.fullname" . }}-symbolicator
{{- if not .Values.symbolicator.api.persistence.enabled }}
- name: symbolicator-data
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.symbolicator.api.volumes }}
{{ toYaml .Values.symbolicator.api.volumes | indent 6 }}
{{- end }}
{{- if .Values.symbolicator.api.priorityClassName }}
priorityClassName: "{{ .Values.symbolicator.api.priorityClassName }}"
{{- end }}
{{- if .Values.symbolicator.api.persistence.enabled }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: symbolicator-data
spec:
accessModes: {{ .Values.symbolicator.api.persistence.accessModes }}
{{- if hasKey .Values.symbolicator.api.persistence "storageClass" }}
storageClassName: {{ .Values.symbolicator.api.persistence.storageClassName | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.symbolicator.api.persistence.size }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,12 @@ mail:
symbolicator:
enabled: false
api:
usedeployment: true # Set true to use Deployment, false for StatefulSet
persistence:
enabled: true # Set true for using PersistentVolumeClaim, false for emptyDir
accessModes: ["ReadWriteOnce"]
# storageClassName: standard
size: "10Gi"
replicas: 1
env: []
probeInitialDelaySeconds: 10
Expand Down