diff --git a/charts/sentry/templates/_helper.tpl b/charts/sentry/templates/_helper.tpl index cc1ab85ce..73f5efc2a 100644 --- a/charts/sentry/templates/_helper.tpl +++ b/charts/sentry/templates/_helper.tpl @@ -52,6 +52,13 @@ {{- default .Chart.AppVersion .Values.images.vroom.tag -}} {{- end -}} + +{{- define "taskbroker.image" -}} +{{- default "getsentry/taskbroker" .Values.images.taskbroker.repository -}} +: +{{- default .Chart.AppVersion .Values.images.taskbroker.tag -}} +{{- end -}} + {{/* Expand the name of the chart. */}} @@ -688,6 +695,22 @@ Set external Clickhouse password from existingSecret value: http://{{ template "sentry.fullname" . }}-snuba:{{ template "snuba.port" . }} {{- end -}} +{{- define "taskbroker.env" -}} +- name: TASKBROKER_KAFKA_CLUSTER + value: {{ include "sentry.kafka.bootstrap_servers_string" . | quote }} +- name: TASKBROKER_KAFKA_DEADLETTER_CLUSTER + value: {{ include "sentry.kafka.bootstrap_servers_string" . | quote }} +- name: TASKBROKER_DB_PATH + value: "/opt/sqlite/taskbroker-activations.sqlite" +{{- end -}} + +{{/* +Return the taskbroker service host name +*/}} +{{- define "taskbroker.host" -}} +{{- template "sentry.fullname" . }}-taskbroker +{{- end -}} + {{/* Common Sentry environment variables */}} @@ -700,6 +723,10 @@ Common Sentry environment variables value: http://{{ template "sentry.fullname" . }}-snuba:{{ template "snuba.port" . }} - name: VROOM value: http://{{ template "sentry.fullname" . }}-vroom:{{ template "vroom.port" . }} +- name: SENTRY_REDIS_HOST + value: {{ $redisHost | quote }} +- name: SENTRY_REDIS_PORT + value: {{ $redisPort | quote }} {{- if .Values.sentry.existingSecret }} - name: SENTRY_SECRET_KEY valueFrom: diff --git a/charts/sentry/templates/sentry/_helper-sentry.tpl b/charts/sentry/templates/sentry/_helper-sentry.tpl index 08014200e..515474529 100644 --- a/charts/sentry/templates/sentry/_helper-sentry.tpl +++ b/charts/sentry/templates/sentry/_helper-sentry.tpl @@ -405,182 +405,344 @@ sentry.conf.py: |- { feature: True for feature in ( - {{- if not .Values.sentry.singleOrganization }} - "organizations:create", - {{ end -}} - - {{- if .Values.sentry.features.orgSubdomains }} - "organizations:org-subdomains", - {{ end -}} - - "organizations:advanced-search", - "organizations:android-mappings", - "organizations:api-keys", - "organizations:boolean-search", - "organizations:related-events", - "organizations:alert-filters", - "organizations:custom-symbol-sources", - "organizations:dashboards-basic", - "organizations:dashboards-edit", - "organizations:data-forwarding", - "organizations:discover", - "organizations:discover-basic", - "organizations:discover-query", - "organizations:discover-frontend-use-events-endpoint", - "organizations:enterprise-perf", - "organizations:event-attachments", - "organizations:events", - "organizations:global-views", - "organizations:incidents", - "organizations:metric-alert-builder-aggregate", - "organizations:metric-alert-gui-filters", - "organizations:integrations-event-hooks", - "organizations:integrations-issue-basic", - "organizations:integrations-issue-sync", - "organizations:integrations-alert-rule", - "organizations:integrations-chat-unfurl", - "organizations:integrations-incident-management", - "organizations:integrations-ticket-rules", - - {{- if .Values.sentry.features.vstsLimitedScopes }} - "organizations:integrations-vsts-limited-scopes", - {{ end -}} - - "organizations:integrations-stacktrace-link", - "organizations:internal-catchall", - "organizations:invite-members", - "organizations:large-debug-files", - "organizations:monitors", - "organizations:onboarding", - "organizations:org-saved-searches", - "organizations:performance-view", - "organizations:performance-frontend-use-events-endpoint", - "organizations:project-detail", - "organizations:relay", - "organizations:release-performance-views", - "organizations:rule-page", - "organizations:set-grouping-config", - "organizations:custom-event-title", - "organizations:slack-migration", - "organizations:sso-basic", - "organizations:sso-rippling", - "organizations:sso-saml2", - "organizations:sso-migration", - "organizations:stacktrace-hover-preview", - "organizations:symbol-sources", - "organizations:transaction-comparison", - "organizations:usage-stats-graph", - "organizations:inbox", - "organizations:unhandled-issue-flag", - "organizations:invite-members-rate-limits", - "organizations:dashboards-v2", - "organizations:reprocessing-v2", - "organizations:metrics", - "organizations:metrics-extraction", - "organizations:transaction-metrics-extraction", - - {{- if .Values.sentry.features.enableSessionReplay}} - "organizations:session-replay", - "organizations:session-replay-ui", - "organizations:session-replay-sdk", - "organizations:session-replay-count-query-optimize", - "organizations:session-replay-sdk-errors-only", - "organizations:session-replay-recording-scrubbing", - "organizations:session-replay-a11y-tab", - "organizations:session-replay-slack-new-issue", - "organizations:session-replay-issue-emails", - "organizations:session-replay-event-linking", - "organizations:session-replay-enable-canvas", - "organizations:session-replay-enable-canvas-replayer", - "organizations:session-replay-weekly-email", - "organizations:session-replay-trace-table", - "organizations:session-replay-rage-dead-selectors", - "organizations:session-replay-new-event-counts", - "organizations:session-replay-new-timeline", - "organizations:issue-details-replay-event", - {{ end -}} - - "organizations:issue-platform", - - {{- if .Values.sentry.features.enableProfiling }} - "organizations:profiling", - "organizations:profiling-ui-frames", - "organizations:profiling-using-transactions", - "organizations:profiling-beta", - "organizations:profiling-stacktrace-links", - "organizations:profiling-cpu-chart", - "organizations:profiling-memory-chart", - "organizations:profiling-view", - {{ end -}} - - {{- if .Values.sentry.features.enableFeedback }} - "organizations:user-feedback-ui", - "organizations:user-feedback-ingest", - "organizations:user-feedback-replay-clip", - "organizations:feedback-ingest", - "organizations:feedback-post-process-group", - "organizations:feedback-visible", - {{ end -}} - - {{- if .Values.sentry.features.enableSpan }} - # Trace View -- make sure this is all set - "organizations:trace-view-v1", # This one is required - "organizations:trace-view-load-more", # Optional - "organizations:trace-tabs-ui", # Optional - "organizations:trace-view-linked-traces", # Optional - "organizations:replay-trace-view-v1", # Optional - "organizations:trace-drawer-action", # Optional - "organizations:trace-spans-format", # Optional - # Performance Trace Explorer - "organizations:performance-trace-explorer", # Required - "organizations:performance-trace-details", # Required - "organizations:performance-trace-explorer-sorting", - "organizations:performance-tracing-without-performance", - "organizations:performance-use-metrics", - # Span-based Metrics - "projects:span-metrics-extraction", - "projects:span-metrics-extraction-addons", - "organizations:span-stats", - "organizations:performance-issues-spans", - "organizations:transaction-metrics-extraction", # Extraction metrics for transactions during ingestion. - "organizations:indexed-spans-extraction", # Starfish: extract metrics from the spans - "organizations:visibility-explore-view", # Enable the new explore page - "organizations:visibility-explore-admin", # Enable admin features on the new explore page - "organizations:visibility-explore-equations", # Enable equations feature on the new explore page - "organizations:visibility-explore-progressive-loading", - "organizations:visibility-explore-skip-preflight", - "organizations:visibility-explore-tabs", # Enable merging all the modes into tabs - "organizations:visibility-explore-range-high", # Enable high date range options on new explore page - "organizations:explore-multi-query", # Enable explore multi query page - {{ end -}} - - "organizations:dashboards-mep", - "organizations:mep-rollout-flag", - "organizations:dashboards-rh-widget", - "organizations:metrics-extraction", - "organizations:transaction-metrics-extraction", - - "projects:alert-filters", - "projects:custom-inbound-filters", - "projects:data-forwarding", - "projects:discard-groups", - "projects:issue-alerts-targeting", - "projects:minidump", - "projects:rate-limits", - "projects:sample-events", - "projects:servicehooks", - "projects:similarity-view", - "projects:similarity-indexing", - "projects:similarity-view-v2", - "projects:similarity-indexing-v2", - - "projects:plugins", - {{- if .Values.sentry.customFeatures }} - {{- range $CustomFeature := .Values.sentry.customFeatures }} - "{{ $CustomFeature}}", - {{- end }} - {{- end }} + "organizations:advanced-search", + "organizations:anomaly-detection-alerts", + "organizations:app-store-connect-multiple", + "organizations:change-alerts", + "organizations:codecov-integration", + "organizations:crash-rate-alerts", + "organizations:custom-symbol-sources", + "organizations:dashboards-basic", + "organizations:dashboards-edit", + "organizations:data-forwarding", + "organizations:discover-basic", + "organizations:discover-query", + "organizations:dynamic-sampling", + "organizations:event-attachments", + "organizations:incidents", + "organizations:integrations-alert-rule", + "organizations:integrations-chat-unfurl", + "organizations:integrations-codeowners", + "organizations:integrations-event-hooks", + "organizations:integrations-enterprise-alert-rule", + "organizations:integrations-enterprise-incident-management", + "organizations:integrations-incident-management", + "organizations:integrations-issue-basic", + "organizations:integrations-issue-sync", + "organizations:integrations-stacktrace-link", + "organizations:integrations-ticket-rules", + "organizations:metric-alert-chartcuterie", + "organizations:performance-view", + "organizations:profiling-view", + "organizations:relay", + "organizations:remote-config", + "organizations:session-replay", + "organizations:spans-usage-tracking", + "organizations:sso-basic", + "organizations:sso-saml2", + "organizations:span-stats", + "organizations:team-insights", + "organizations:team-roles", + "organizations:uptime", + "organizations:continuous-profiling-billing", + "organizations:on-demand-metrics-prefill", + "organizations:custom-metrics", + "organizations:sentry-pride-logo-footer", + "organizations:seer-based-priority", + "organizations:integrations-vercel", + "organizations:integrations-scm-multi-org", + "organizations:issue-views", + "projects:data-forwarding", + "projects:rate-limits", + "projects:custom-inbound-filters", + "projects:discard-groups", + "projects:servicehooks" ) + + {{- if .Values.sentry.features.orgSubdomains }} + + ("organizations:org-ingest-subdomains") + {{ end -}} + + + ( + "auth:register", + "organizations:create", + "relocation:enabled", + "organizations:alert-allow-indexed", + "organizations:alert-crash-free-metrics", + "organizations:anomaly-detection-eap", + "organizations:anr-analyze-frames", + "organizations:api-organization_events-rate-limit-reduced-rollout", + "organizations:auth-v2-merge-users", + "organizations:auto-enable-codecov", + "organizations:detailed-data-for-seer", + "organizations:autofix-seer-preferences", + "organizations:chonk-ui", + "organizations:chonk-ui-feedback", + "organizations:codecov-ui", + "organizations:command-menu-v2", + "organizations:csharp-open-pr-comments", + "organizations:go-open-pr-comments", + "organizations:continuous-profiling", + "organizations:continuous-profiling-beta", + "organizations:continuous-profiling-beta-ui", + "organizations:continuous-profiling-stats", + "projects:continuous-profiling-vroomrs-processing", + "projects:transaction-profiling-vroomrs-processing", + "organizations:profiling-flamegraph-use-increased-chunks-query-strategy", + "organizations:daily-summary", + "organizations:dashboards-import", + "organizations:dashboards-mep", + "organizations:dashboards-metrics-transition", + "organizations:dashboards-starred-reordering", + "organizations:dashboards-widget-builder-redesign", + "organizations:dashboards-use-widget-table-visualization", + "organizations:data-secrecy", + "organizations:data-secrecy-v2", + "organizations:device-class-synthesis", + "organizations:device-classification", + "organizations:discover", + "organizations:discover-saved-queries-deprecation", + "organizations:discover-cell-actions-v2", + "organizations:ds-org-recalibration", + "organizations:dynamic-sampling-custom", + "organizations:dynamic-sampling-minimum-sample-rate", + "organizations:escalating-issues-v2", + "organizations:escalating-metrics-backend", + "organizations:expose-migrated-discover-queries", + "organizations:gen-ai-features", + "organizations:gen-ai-explore-traces", + "organizations:gen-ai-explore-traces-consent-ui", + "organizations:gen-ai-consent", + "organizations:gitlab-disable-on-broken", + "organizations:global-views", + "organizations:increased-issue-owners-rate-limit", + "organizations:indexed-spans-extraction", + "organizations:integrations-deployment", + "organizations:integrations-feature-flag-integration", + "organizations:invite-billing", + "organizations:invite-members", + "organizations:invite-members-rate-limits", + "organizations:issue-details-lifetime-stats", + "organizations:issue-details-streamline-enforce", + "organizations:issue-detection-sort-spans", + "organizations:issue-search-allow-postgres-only-search", + "organizations:issue-taxonomy", + "organizations:metric-issue-poc", + "projects:metric-issue-creation", + "organizations:issue-open-periods", + "organizations:mep-rollout-flag", + "organizations:mep-use-default-tags", + "organizations:disable-clustering-setting", + "organizations:migrate-azure-devops-integration", + "organizations:minute-resolution-sessions", + "organizations:mobile-cpu-memory-in-transactions", + "organizations:mobile-vitals", + "organizations:more-fast-alerts", + "organizations:more-slow-alerts", + "organizations:more-workflows", + "organizations:navigation-sidebar-v2", + "organizations:new-page-filter", + "organizations:agents-insights", + "organizations:mcp-insights", + "organizations:on-demand-metrics-extraction", + "organizations:on-demand-metrics-extraction-experimental", + "organizations:on-demand-metrics-extraction-widgets", + "organizations:on-demand-metrics-query-spec-version-two", + "organizations:new-organization-member-invite", + "organizations:on-demand-metrics-ui", + "organizations:on-demand-metrics-ui-widgets", + "organizations:onboarding", + "organizations:ownership-size-limit-large", + "organizations:ownership-size-limit-xlarge", + "organizations:project-creation-games-tab", + "organizations:performance-calculate-mobile-perf-score-relay", + "organizations:performance-change-explorer", + "organizations:performance-chart-interpolation", + "organizations:performance-discover-dataset-selector", + "organizations:deprecate-discover-widget-type", + "organizations:performance-discover-widget-split-override-save", + "organizations:performance-discover-widget-split-ui", + "organizations:performance-discover-get-custom-measurements-reduced-range", + "organizations:performance-issues-all-events-tab", + "organizations:performance-issues-search", + "organizations:performance-issues-spans", + "organizations:performance-mep-bannerless-ui", + "organizations:performance-mep-reintroduce-histograms", + "organizations:performance-metrics-backed-transaction-summary", + "organizations:performance-new-trends", + "organizations:performance-new-widget-designs", + "organizations:performance-onboarding-checklist", + "organizations:performance-queries-mongodb-extraction", + "organizations:performance-remove-metrics-compatibility-fallback", + "organizations:performance-span-histogram-view", + "organizations:performance-trace-details", + "organizations:performance-trace-explorer", + "organizations:performance-sentry-conventions-fields", + "organizations:performance-spans-fields-stats", + "organizations:performance-tracing-without-performance", + "organizations:performance-transaction-name-only-search", + "organizations:performance-transaction-name-only-search-indexed", + "organizations:performance-transaction-summary-cleanup", + "organizations:performance-transaction-summary-eap", + "organizations:performance-otel-friendly-ui", + "organizations:performance-spans-new-ui", + "organizations:performance-use-metrics", + "organizations:performance-vitals-standalone-cls-lcp", + "organizations:performance-web-vitals-issues", + "organizations:performance-default-explore-queries", + "organizations:performance-spans-suspect-attributes", + "organizations:performance-transaction-deprecation-alerts", + "organizations:preprod-artifact-assemble", + "organizations:preprod-frontend-routes", + "organizations:relay-playstation-ingestion", + "organizations:prevent-flows-poc", + "organizations:profiling", + "organizations:profiling-beta", + "organizations:profiling-sdks", + "organizations:profiling-deprecate-sdks", + "organizations:profiling-browser", + "organizations:profiling-differential-flamegraph-page", + "organizations:profiling-flamegraph-always-use-direct-chunks", + "organizations:profiling-global-suspect-functions", + "organizations:profiling-function-trends", + "organizations:profiling-summary-redesign", + "organizations:project-event-date-limit", + "organizations:project-templates", + "organizations:related-events", + "organizations:release-comparison-performance", + "organizations:replay-ai-summaries", + "organizations:replay-list-select", + "organizations:reprocessing-v2", + "organizations:resolve-in-upcoming-release", + "organizations:revoke-org-auth-on-slug-rename", + "organizations:sdk-crash-detection", + "organizations:seer-explorer", + "organizations:search-query-builder-raw-search-replacement", + "organizations:search-query-builder-wildcard-operators", + "organizations:session-replay-issue-emails", + "organizations:session-replay-video-disabled", + "organizations:session-replay-recording-scrubbing", + "organizations:session-replay-slack-new-issue", + "organizations:session-replay-ui", + "organizations:init-sentry-toolbar", + "organizations:sentry-toolbar-ui", + "organizations:feature-flag-cta", + "organizations:feature-flag-distribution-flyout", + "organizations:feature-flag-suspect-flags", + "organizations:issues-suspect-tags", + "organizations:suspect-scores-sandbox-ui", + "organizations:insights-session-health-tab-ui", + "organizations:set-grouping-config", + "organizations:sso-saml2-slo", + "organizations:insights-entry-points", + "organizations:insights-initial-modules", + "organizations:insights-addon-modules", + "organizations:insights-query-date-range-limit", + "organizations:insights-use-eap", + "organizations:insights-modules-use-eap", + "organizations:insights-overview-use-eap", + "organizations:insights-chart-actions", + "organizations:insights-alerts", + "organizations:insights-related-issues-table", + "organizations:insights-mobile-screens-module", + "organizations:insights-performance-landing-removal", + "organizations:sentry-app-webhook-requests", + "organizations:standalone-span-ingestion", + "organizations:starfish-mobile-appstart", + "organizations:starfish-mobile-ui-module", + "organizations:starfish-view", + "organizations:statistical-detectors-rca-spans-only", + "organizations:symbol-sources", + "organizations:grouptombstones-hit-counter", + "organizations:tag-key-sample-n", + "organizations:team-workflow-notifications", + "organizations:trace-view-load-more", + "organizations:trace-view-v1", + "organizations:trace-view-linked-traces", + "organizations:tracing-onboarding-new-ui", + "organizations:trace-view-quota-exceeded-banner", + "organizations:trace-spans-format", + "organizations:trace-view-admin-ui", + "organizations:trace-view-span-links", + "organizations:trace-tabs-ui", + "organizations:traces-onboarding-guide", + "organizations:traces-schema-hints", + "organizations:transaction-metrics-extraction", + "organizations:transaction-name-mark-scrubbed-as-sanitized", + "organizations:transaction-name-normalize", + "organizations:trigger-autofix-on-issue-summary", + "organizations:unlimited-auto-triggered-autofix-runs", + "organizations:uptime-automatic-hostname-detection", + "organizations:uptime-automatic-subscription-creation", + "organizations:view-hierarchy-scrubbing", + "organizations:uptime-create-issues", + "organizations:uptime-detailed-logging", + "organizations:uptime-detector-handler", + "organizations:uptime-detector-create-issues", + "organizations:uptime-eap-results", + "organizations:uptime-eap-uptime-results-query", + "organizations:use-metrics-layer", + "organizations:user-feedback-ai-summaries", + "organizations:user-feedback-spam-ingest", + "organizations:user-feedback-ui", + "organizations:view-hierarchies-options-dev", + "organizations:visibility-explore-aggregate-editor", + "organizations:visibility-explore-equations", + "organizations:visibility-dashboards-equations", + "organizations:visibility-explore-view", + "organizations:visibility-explore-range-high", + "organizations:visibility-explore-range-medium", + "organizations:enforce-stacked-navigation", + "organizations:workflow-engine-process-activity", + "organizations:workflow-engine-issue-alert-dual-write", + "organizations:workflow-engine-process-metric-issue-workflows", + "organizations:workflow-engine-process-workflows", + "organizations:workflow-engine-single-process-workflows", + "organizations:workflow-engine-process-workflows-logs", + "organizations:workflow-engine-trigger-actions", + "organizations:workflow-engine-metric-alert-dual-processing-logs", + "organizations:workflow-engine-metric-alert-dual-write", + "organizations:workflow-engine-metric-alert-processing", + "organizations:ingest-through-trusted-relays-only", + "organizations:workflow-engine-ui", + "organizations:workflow-engine-ui-links", + "organizations:workflow-engine-rule-serializers", + "organizations:event-unique-user-frequency-condition-with-conditions", + "organizations:dynamic-sampling-spans", + "organizations:ourlogs-enabled", + "organizations:ourlogs-ingestion", + "organizations:ourlogs-calculated-byte-count", + "organizations:ourlogs-meta-attributes", + "organizations:ourlogs-stats", + "organizations:ourlogs-visualize-sidebar", + "organizations:ourlogs-dashboards", + "organizations:ourlogs-alerts", + "organizations:ourlogs-live-refresh", + "organizations:ourlogs-infinite-scroll", + "organizations:ourlogs-replay-ui", + "organizations:jira-per-project-statuses", + "organizations:jira-paginated-projects", + "organizations:single-trace-summary", + "organizations:github-multi-org", + "organizations:github-multi-org-upsell-modal", + "projects:transaction-name-clustering-disabled", + "projects:alert-filters", + "projects:discard-transaction", + "projects:error-upsampling", + "projects:first-event-severity-calculation", + "projects:similarity-embeddings", + "projects:similarity-indexing", + "projects:similarity-view", + "projects:span-metrics-extraction", + "projects:span-metrics-extraction-addons", + "projects:relay-otel-endpoint", + "projects:use-eap-spans-for-metrics-explorer", + "projects:num-events-issue-debugging", + "projects:plugins", + "projects:profiling-ingest-unsampled-profiles", + "projects:project-detail-apple-app-hang-rate", + "organizations:scoped-partner-oauth", + "organizations:tempest-access" ) } ) diff --git a/charts/sentry/templates/sentry/taskbroker/deployment-taskbroker.yaml b/charts/sentry/templates/sentry/taskbroker/deployment-taskbroker.yaml new file mode 100644 index 000000000..13e28afe0 --- /dev/null +++ b/charts/sentry/templates/sentry/taskbroker/deployment-taskbroker.yaml @@ -0,0 +1,124 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sentry.fullname" . }}-taskbroker + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + app.kubernetes.io/managed-by: "Helm" + {{- if .Values.asHook }} + {{- /* Add the Helm annotations so that deployment after asHook from true to false works */}} + annotations: + meta.helm.sh/release-name: "{{ .Release.Name }}" + meta.helm.sh/release-namespace: "{{ .Release.Namespace }}" + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "25" + {{- end }} +spec: + selector: + matchLabels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: taskbroker +{{- if not .Values.taskbroker.autoscaling.enabled }} + replicas: {{ .Values.taskbroker.replicas }} +{{- end }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + template: + metadata: + annotations: + {{- if .Values.taskbroker.annotations }} +{{ toYaml .Values.taskbroker.annotations | indent 8 }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: taskbroker + {{- if .Values.taskbroker.podLabels }} +{{ toYaml .Values.taskbroker.podLabels | indent 8 }} + {{- end }} + spec: + affinity: + {{- if .Values.taskbroker.affinity }} +{{ toYaml .Values.taskbroker.affinity | indent 8 }} + {{- end }} + {{- if .Values.taskbroker.nodeSelector }} + nodeSelector: +{{ toYaml .Values.taskbroker.nodeSelector | indent 8 }} + {{- else if .Values.global.nodeSelector }} + nodeSelector: +{{ toYaml .Values.global.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.taskbroker.tolerations }} + tolerations: +{{ toYaml .Values.taskbroker.tolerations | indent 8 }} + {{- else if .Values.global.tolerations }} + tolerations: +{{ toYaml .Values.global.tolerations | indent 8 }} + {{- end }} + {{- if .Values.taskbroker.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml .Values.taskbroker.topologySpreadConstraints | indent 8 }} + {{- end }} + {{- if .Values.images.taskbroker.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.images.taskbroker.imagePullSecrets | indent 8 }} + {{- end }} + {{- if .Values.taskbroker.securityContext }} + securityContext: +{{ toYaml .Values.taskbroker.securityContext | indent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-taskbroker +{{- if .Values.taskbroker.args }} + args: +{{ toYaml .Values.taskbroker.args | indent 10 }} +{{- end }} + image: "{{ template "taskbroker.image" . }}" + imagePullPolicy: {{ default "IfNotPresent" .Values.images.taskbroker.pullPolicy }} + env: +{{- include "taskbroker.env" . | nindent 8 }} +{{- if .Values.taskbroker.env }} +{{ toYaml .Values.taskbroker.env | indent 8 }} +{{- end }} + volumeMounts: + - name: taskbroker-storage + mountPath: /opt/sqlite +{{- if .Values.taskbroker.volumeMounts }} +{{ toYaml .Values.taskbroker.volumeMounts | indent 10 }} +{{- end }} + resources: +{{ toYaml .Values.taskbroker.resources | indent 12 }} +{{- if .Values.taskbroker.containerSecurityContext }} + securityContext: +{{ toYaml .Values.taskbroker.containerSecurityContext | indent 12 }} +{{- end }} +{{- if .Values.taskbroker.sidecars }} +{{ toYaml .Values.taskbroker.sidecars | indent 6 }} +{{- end }} +{{- if .Values.global.sidecars }} +{{ toYaml .Values.global.sidecars | indent 6 }} +{{- end }} + {{- if .Values.serviceAccount.enabled }} + serviceAccountName: {{ .Values.serviceAccount.name }}-taskbroker + {{- end }} + volumes: + {{- if .Values.taskbroker.persistence.enabled }} + - name: taskbroker-storage + persistentVolumeClaim: + claimName: sentry-taskbroker-pvc + {{- else }} + - name: taskbroker-storage + emptyDir: {} + {{- end }} +{{- if .Values.taskbroker.volumes }} +{{ toYaml .Values.taskbroker.volumes | indent 6 }} +{{- end }} +{{- if .Values.global.volumes }} +{{ toYaml .Values.global.volumes | indent 6 }} +{{- end }} + {{- if .Values.taskbroker.priorityClassName }} + priorityClassName: "{{ .Values.taskbroker.priorityClassName }}" + {{- end }} diff --git a/charts/sentry/templates/sentry/taskbroker/deployment-taskscheduler.yaml b/charts/sentry/templates/sentry/taskbroker/deployment-taskscheduler.yaml new file mode 100644 index 000000000..02e753797 --- /dev/null +++ b/charts/sentry/templates/sentry/taskbroker/deployment-taskscheduler.yaml @@ -0,0 +1,110 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sentry.fullname" . }}-taskscheduler + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + app.kubernetes.io/managed-by: "Helm" + {{- if .Values.asHook }} + {{- /* Add the Helm annotations so that deployment after asHook from true to false works */}} + annotations: + meta.helm.sh/release-name: "{{ .Release.Name }}" + meta.helm.sh/release-namespace: "{{ .Release.Namespace }}" + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "25" + {{- end }} +spec: + selector: + matchLabels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: sentry + replicas: {{ .Values.sentry.replicas }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + template: + metadata: + annotations: + checksum/configmap.yaml: {{ include "sentry.config" . | sha256sum }} + {{- if .Values.sentry.annotations }} +{{ toYaml .Values.sentry.annotations | indent 8 }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: sentry + {{- if .Values.sentry.podLabels }} +{{ toYaml .Values.sentry.podLabels | indent 8 }} + {{- end }} + spec: + affinity: + {{- if .Values.sentry.affinity }} +{{ toYaml .Values.sentry.affinity | indent 8 }} + {{- end }} + {{- if .Values.sentry.nodeSelector }} + nodeSelector: +{{ toYaml .Values.sentry.nodeSelector | indent 8 }} + {{- else if .Values.global.nodeSelector }} + nodeSelector: +{{ toYaml .Values.global.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.sentry.tolerations }} + tolerations: +{{ toYaml .Values.sentry.tolerations | indent 8 }} + {{- else if .Values.global.tolerations }} + tolerations: +{{ toYaml .Values.global.tolerations | indent 8 }} + {{- end }} + {{- if .Values.sentry.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml .Values.sentry.topologySpreadConstraints | indent 8 }} + {{- end }} + {{- if .Values.images.sentry.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }} + {{- end }} + {{- if .Values.sentry.securityContext }} + securityContext: +{{ toYaml .Values.sentry.securityContext | indent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-sentry +{{- if .Values.sentry.args }} + args: +{{ toYaml .Values.sentry.args | indent 10 }} +{{- end }} + command: ["sentry"] + args: + - run + - taskworker-scheduler + image: "{{ template "sentry.image" . }}" + imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }} + env: +{{- include "sentry.env" . | nindent 8 }} +{{- if .Values.sentry.env }} +{{ toYaml .Values.sentry.env | indent 8 }} +{{- end }} + resources: +{{ toYaml .Values.sentry.resources | indent 12 }} +{{- if .Values.sentry.containerSecurityContext }} + securityContext: +{{ toYaml .Values.sentry.containerSecurityContext | indent 12 }} +{{- end }} +{{- if .Values.sentry.sidecars }} +{{ toYaml .Values.sentry.sidecars | indent 6 }} +{{- end }} +{{- if .Values.global.sidecars }} +{{ toYaml .Values.global.sidecars | indent 6 }} +{{- end }} + {{- if .Values.serviceAccount.enabled }} + serviceAccountName: {{ .Values.serviceAccount.name }}-sentry + {{- end }} + {{- if .Values.sentry.priorityClassName }} + priorityClassName: "{{ .Values.sentry.priorityClassName }}" + {{- end }} + volumes: + - name: config + configMap: + name: {{ template "sentry.fullname" . }}-sentry diff --git a/charts/sentry/templates/sentry/taskbroker/deployment-taskworker.yaml b/charts/sentry/templates/sentry/taskbroker/deployment-taskworker.yaml new file mode 100644 index 000000000..ae3dd3055 --- /dev/null +++ b/charts/sentry/templates/sentry/taskbroker/deployment-taskworker.yaml @@ -0,0 +1,112 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sentry.fullname" . }}-taskworker + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + app.kubernetes.io/managed-by: "Helm" + {{- if .Values.asHook }} + {{- /* Add the Helm annotations so that deployment after asHook from true to false works */}} + annotations: + meta.helm.sh/release-name: "{{ .Release.Name }}" + meta.helm.sh/release-namespace: "{{ .Release.Namespace }}" + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "25" + {{- end }} +spec: + selector: + matchLabels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: taskworker + replicas: {{ .Values.sentry.replicas }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + template: + metadata: + annotations: + checksum/configmap.yaml: {{ include "sentry.config" . | sha256sum }} + {{- if .Values.sentry.annotations }} +{{ toYaml .Values.sentry.annotations | indent 8 }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + release: "{{ .Release.Name }}" + role: taskworker + {{- if .Values.sentry.podLabels }} +{{ toYaml .Values.sentry.podLabels | indent 8 }} + {{- end }} + spec: + affinity: + {{- if .Values.sentry.affinity }} +{{ toYaml .Values.sentry.affinity | indent 8 }} + {{- end }} + {{- if .Values.sentry.nodeSelector }} + nodeSelector: +{{ toYaml .Values.sentry.nodeSelector | indent 8 }} + {{- else if .Values.global.nodeSelector }} + nodeSelector: +{{ toYaml .Values.global.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.sentry.tolerations }} + tolerations: +{{ toYaml .Values.sentry.tolerations | indent 8 }} + {{- else if .Values.global.tolerations }} + tolerations: +{{ toYaml .Values.global.tolerations | indent 8 }} + {{- end }} + {{- if .Values.sentry.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml .Values.sentry.topologySpreadConstraints | indent 8 }} + {{- end }} + {{- if .Values.images.sentry.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.images.sentry.imagePullSecrets | indent 8 }} + {{- end }} + {{- if .Values.sentry.securityContext }} + securityContext: +{{ toYaml .Values.sentry.securityContext | indent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }}-taskworker +{{- if .Values.sentry.args }} + args: +{{ toYaml .Values.sentry.args | indent 10 }} +{{- end }} + command: ["sentry"] + args: + - run + - taskworker + - --concurrency=4 + - --rpc-host={{ include "taskbroker.host" . }}:50051 + image: "{{ template "sentry.image" . }}" + imagePullPolicy: {{ default "IfNotPresent" .Values.images.sentry.pullPolicy }} + env: +{{- include "sentry.env" . | nindent 8 }} +{{- if .Values.sentry.env }} +{{ toYaml .Values.sentry.env | indent 8 }} +{{- end }} + resources: +{{ toYaml .Values.sentry.resources | indent 12 }} +{{- if .Values.sentry.containerSecurityContext }} + securityContext: +{{ toYaml .Values.sentry.containerSecurityContext | indent 12 }} +{{- end }} +{{- if .Values.sentry.sidecars }} +{{ toYaml .Values.sentry.sidecars | indent 6 }} +{{- end }} +{{- if .Values.global.sidecars }} +{{ toYaml .Values.global.sidecars | indent 6 }} +{{- end }} + {{- if .Values.serviceAccount.enabled }} + serviceAccountName: {{ .Values.serviceAccount.name }}-taskworker + {{- end }} + {{- if .Values.sentry.priorityClassName }} + priorityClassName: "{{ .Values.sentry.priorityClassName }}" + {{- end }} + volumes: + - name: config + configMap: + name: {{ template "sentry.fullname" . }}-sentry diff --git a/charts/sentry/templates/sentry/taskbroker/hpa-taskbroker.yaml b/charts/sentry/templates/sentry/taskbroker/hpa-taskbroker.yaml new file mode 100644 index 000000000..a99526790 --- /dev/null +++ b/charts/sentry/templates/sentry/taskbroker/hpa-taskbroker.yaml @@ -0,0 +1,33 @@ +{{- if .Values.vroom.autoscaling.enabled }} +apiVersion: {{ template "sentry.autoscaling.apiVersion" . }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "sentry.fullname" . }}-taskbroker +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "sentry.fullname" . }}-taskbroker + minReplicas: {{ .Values.taskbroker.autoscaling.minReplicas }} + maxReplicas: {{ .Values.taskbroker.autoscaling.maxReplicas }} + {{- if eq (include "sentry.autoscaling.apiVersion" .) "autoscaling/v1" }} + targetCPUUtilizationPercentage: {{ .Values.taskbroker.autoscaling.targetCPUUtilizationPercentage }} + {{- else if semverCompare ">=1.27-0" .Capabilities.KubeVersion.GitVersion }} + metrics: + - type: ContainerResource + containerResource: + container: {{ .Chart.Name }}-taskbroker + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.taskbroker.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.taskbroker.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/sentry/templates/sentry/taskbroker/pvc-taskbroker.yaml b/charts/sentry/templates/sentry/taskbroker/pvc-taskbroker.yaml new file mode 100644 index 000000000..d6bd31bd6 --- /dev/null +++ b/charts/sentry/templates/sentry/taskbroker/pvc-taskbroker.yaml @@ -0,0 +1,24 @@ +{{- if .Values.taskbroker.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: sentry-taskbroker-pvc + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + component: taskbroker +spec: + accessModes: +{{- range .Values.taskbroker.persistence.accessModes }} + - {{ . | quote }} +{{- end }} + resources: + requests: + storage: {{ .Values.taskbroker.persistence.size | quote }} + {{- if .Values.taskbroker.persistence.storageClassName }} + storageClassName: {{ .Values.taskbroker.persistence.storageClassName | quote }} + {{- end }} +{{- end }} diff --git a/charts/sentry/templates/sentry/taskbroker/service-taskbroker.yaml b/charts/sentry/templates/sentry/taskbroker/service-taskbroker.yaml new file mode 100644 index 000000000..69e3373aa --- /dev/null +++ b/charts/sentry/templates/sentry/taskbroker/service-taskbroker.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "sentry.fullname" . }}-taskbroker + annotations: + {{- range $key, $value := .Values.taskbroker.service.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + labels: + app: {{ template "sentry.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + clusterIP: None + ports: + - name: rpc + port: 50051 + targetPort: 50051 + protocol: TCP + selector: + app: {{ template "sentry.fullname" . }} + role: taskbroker diff --git a/charts/sentry/templates/sentry/taskbroker/serviceaccount-sentry-taskbroker.yaml b/charts/sentry/templates/sentry/taskbroker/serviceaccount-sentry-taskbroker.yaml new file mode 100644 index 000000000..95943b4f9 --- /dev/null +++ b/charts/sentry/templates/sentry/taskbroker/serviceaccount-sentry-taskbroker.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name }}-taskbroker +{{- if .Values.serviceAccount.annotations }} + annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }} +{{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} diff --git a/charts/sentry/values.yaml b/charts/sentry/values.yaml index 9883d389e..db85605d0 100644 --- a/charts/sentry/values.yaml +++ b/charts/sentry/values.yaml @@ -63,6 +63,11 @@ images: # tag: Chart.AppVersion # pullPolicy: IfNotPresent imagePullSecrets: [] + taskbroker: + # repository: getsentry/taskbroker + # tag: Chart.AppVersion + # pullPolicy: IfNotPresent + imagePullSecrets: [] serviceAccount: # serviceAccount.annotations -- Additional Service Account annotations. @@ -114,6 +119,46 @@ vroom: volumes: [] volumeMounts: [] +taskbroker: + # annotations: {} + # args: [] + replicas: 1 + env: [] + probeFailureThreshold: 5 + probeInitialDelaySeconds: 10 + probePeriodSeconds: 10 + probeSuccessThreshold: 1 + probeTimeoutSeconds: 2 + resources: {} + # requests: + # cpu: 100m + # memory: 700Mi + affinity: {} + nodeSelector: {} + securityContext: {} + containerSecurityContext: {} + # priorityClassName: "" + service: + annotations: {} + # tolerations: [] + # podLabels: {} + persistence: + enabled: true # Set true for using PersistentVolumeClaim, false for emptyDir + accessModes: + - ReadWriteMany + # storageClassName: standard + size: "10Gi" + + autoscaling: + enabled: false + minReplicas: 2 + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 + sidecars: [] + # topologySpreadConstraints: [] + volumes: [] + volumeMounts: [] + relay: enabled: true # annotations: {}