Skip to content

Commit 8368102

Browse files
committed
feat!: add clickhouse Bitnami
1 parent 833c640 commit 8368102

15 files changed

+86
-115
lines changed

.github/workflows/lint-test.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- name: Add Helm Repositories
3232
run: |
3333
helm repo add sentry-kubernetes https://sentry-kubernetes.github.io/charts
34+
helm repo add bitnami https://charts.bitnami.com/bitnami
3435
helm repo update
3536
3637
- name: Run chart-testing (list-changed)
@@ -47,8 +48,8 @@ jobs:
4748

4849
- name: Create kind cluster
4950
if: steps.list-changed.outputs.changed == 'true'
50-
uses: helm/kind-action@v1.10.0
51+
uses: helm/kind-action@v1.12.0
5152

5253
- name: Run chart-testing (install)
5354
if: steps.list-changed.outputs.changed == 'true'
54-
run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-args "--timeout 1000s --set sentry.features.enableProfiling=true --set sentry.features.enableSessionReplay=true --set sentry.features.enableFeedback=true --set sentry.features.enableSpan=true"
55+
run: ct install --debug --target-branch ${{ github.event.repository.default_branch }} --helm-extra-args "--timeout 1000s"

charts/sentry/Chart.lock

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ dependencies:
99
repository: oci://registry-1.docker.io/bitnamicharts
1010
version: 29.3.14
1111
- name: clickhouse
12-
repository: https://sentry-kubernetes.github.io/charts
13-
version: 4.0.1
14-
- name: zookeeper
15-
repository: oci://registry-1.docker.io/bitnamicharts
16-
version: 11.4.11
12+
repository: https://charts.bitnami.com/bitnami
13+
version: 4.6.0
1714
- name: rabbitmq
1815
repository: oci://registry-1.docker.io/bitnamicharts
1916
version: 11.16.2
@@ -23,5 +20,5 @@ dependencies:
2320
- name: nginx
2421
repository: oci://registry-1.docker.io/bitnamicharts
2522
version: 18.2.5
26-
digest: sha256:f57f1f1f8d455729a7e04eb41c658530d710c9febe34844e062f084c17c1a382
27-
generated: "2025-07-21T06:40:24.054695705Z"
23+
digest: sha256:f2d82b26a693fed9ee3bd24fbcadafdacda7e525528bbbb347afceae607b2ecf
24+
generated: "2025-08-05T08:10:43.800821278+02:00"

charts/sentry/Chart.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@ dependencies:
1919
version: 29.3.14
2020
condition: kafka.enabled
2121
- name: clickhouse
22-
repository: https://sentry-kubernetes.github.io/charts
23-
version: 4.0.1
22+
repository: https://charts.bitnami.com/bitnami
23+
version: 4.6.0
2424
condition: clickhouse.enabled
25-
- name: zookeeper
26-
repository: oci://registry-1.docker.io/bitnamicharts
27-
version: 11.4.11
28-
condition: zookeeper.enabled
2925
- name: rabbitmq
3026
repository: oci://registry-1.docker.io/bitnamicharts
3127
version: 11.16.2

charts/sentry/ci/kind-values.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
profiles:
2+
- errors-only
3+
4+
kafka:
5+
enabled: true
6+
kraft:
7+
enabled: true
8+
provisioning:
9+
replicationFactor: 1
10+
controller:
11+
replicaCount: 1
12+
broker:
13+
replicaCount: 1
14+
15+
redis:
16+
enabled: true
17+
master.persistence.enabled: false
18+
replica.replicaCount: 0
19+
20+
rabbitmq:
21+
enabled: false
22+
23+
clickhouse:
24+
enabled: true
25+
replicaCount: 1
26+
shards: 1
27+
keeper:
28+
replicaCount: 1

charts/sentry/templates/_helper.tpl

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Set ClickHouse host
333333
*/}}
334334
{{- define "sentry.clickhouse.host" -}}
335335
{{- if .Values.clickhouse.enabled -}}
336-
{{- template "sentry.clickhouse.fullname" . -}}
336+
{{- include "clickhouse.headlessServiceName" $.Subcharts.clickhouse -}}
337337
{{- else -}}
338338
{{ required "A valid .Values.externalClickhouse.host is required" .Values.externalClickhouse.host }}
339339
{{- end -}}
@@ -344,7 +344,7 @@ Set ClickHouse port
344344
*/}}
345345
{{- define "sentry.clickhouse.port" -}}
346346
{{- if .Values.clickhouse.enabled -}}
347-
{{- default 9000 .Values.clickhouse.clickhouse.tcp_port }}
347+
{{- default 9000 .Values.clickhouse.service.ports.tcp }}
348348
{{- else -}}
349349
{{ required "A valid .Values.externalClickhouse.tcpPort is required" .Values.externalClickhouse.tcpPort }}
350350
{{- end -}}
@@ -355,7 +355,7 @@ Set ClickHouse HTTP port
355355
*/}}
356356
{{- define "sentry.clickhouse.http_port" -}}
357357
{{- if .Values.clickhouse.enabled -}}
358-
{{- default 8123 .Values.clickhouse.clickhouse.http_port }}
358+
{{- default 8123 .Values.clickhouse.service.ports.http }}
359359
{{- else -}}
360360
{{ required "A valid .Values.externalClickhouse.httpPort is required" .Values.externalClickhouse.httpPort }}
361361
{{- end -}}
@@ -377,11 +377,7 @@ Set ClickHouse User
377377
*/}}
378378
{{- define "sentry.clickhouse.username" -}}
379379
{{- if .Values.clickhouse.enabled -}}
380-
{{- if .Values.clickhouse.clickhouse.configmap.users.enabled -}}
381-
{{ (index .Values.clickhouse.clickhouse.configmap.users.user 0).name }}
382-
{{- else -}}
383-
default
384-
{{- end -}}
380+
{{ default "default" .Values.clickhouse.auth.username }}
385381
{{- else -}}
386382
{{ required "A valid .Values.externalClickhouse.username is required" .Values.externalClickhouse.username }}
387383
{{- end -}}
@@ -391,38 +387,22 @@ default
391387
Set ClickHouse Password
392388
*/}}
393389
{{- define "sentry.clickhouse.password" -}}
394-
{{- if .Values.clickhouse.enabled -}}
395-
{{- if .Values.clickhouse.clickhouse.configmap.users.enabled -}}
396-
{{ (index .Values.clickhouse.clickhouse.configmap.users.user 0).config.password }}
397-
{{- else -}}
398-
{{- end -}}
399-
{{- else -}}
390+
{{- if not .Values.clickhouse.enabled -}}
400391
{{ .Values.externalClickhouse.password }}
401-
{{- end -}}
392+
{{- end -}}F
402393
{{- end -}}
403394

404395
{{/*
405396
Set ClickHouse cluster name
406397
*/}}
407398
{{- define "sentry.clickhouse.cluster.name" -}}
408399
{{- if .Values.clickhouse.enabled -}}
409-
{{ .Release.Name | printf "%s-clickhouse" }}
400+
{{ include "clickhouse.headlessServiceName" $.Subcharts.clickhouse }}
410401
{{- else -}}
411402
{{ required "A valid .Values.externalClickhouse.clusterName is required" .Values.externalClickhouse.clusterName }}
412403
{{- end -}}
413404
{{- end -}}
414405

415-
{{/*
416-
Set ClickHouse distributed cluster name
417-
*/}}
418-
{{- define "sentry.clickhouse.distributed.cluster.name" -}}
419-
{{- if .Values.clickhouse.enabled -}}
420-
{{ .Release.Name | printf "%s-clickhouse" }}
421-
{{- else -}}
422-
{{ default .Values.externalClickhouse.clusterName .Values.externalClickhouse.distributedClusterName }}
423-
{{- end -}}
424-
{{- end -}}
425-
426406
{{/*
427407
Set ClickHouse secure setting
428408
*/}}
@@ -667,6 +647,15 @@ Set external Clickhouse password from existingSecret
667647
name: {{ .Values.externalClickhouse.existingSecret }}
668648
key: {{ default "clickhouse-password" .Values.externalClickhouse.existingSecretKey }}
669649
{{- end }}
650+
{{- if not .Values.externalClickhouse.existingSecret }}
651+
- name: CLICKHOUSE_PASSWORD
652+
valueFrom:
653+
secretKeyRef:
654+
name: {{ include "clickhouse.secretName" $.Subcharts.clickhouse | quote }}
655+
key: {{ include "clickhouse.secretKey" $.Subcharts.clickhouse | quote }}
656+
{{- end }}
657+
- name: CLICKHOUSE_HOST
658+
value: {{ include "sentry.clickhouse.host" . | quote }}
670659
- name: CLICKHOUSE_MAX_CONNECTIONS
671660
value: {{ .Values.snuba.clickhouse.maxConnections | quote }}
672661
{{- if .Values.ipv6 }}

charts/sentry/templates/hooks/sentry-db-check.job.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ metadata:
1313
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
1414
release: "{{ .Release.Name }}"
1515
heritage: "{{ .Release.Service }}"
16+
{{- if .Values.asHook }}
1617
annotations:
1718
# This is what defines this resource as a hook. Without this line, the
1819
# job is considered part of the release.
1920
"helm.sh/hook": "post-install,{{ if .Values.hooks.preUpgrade }}pre-upgrade{{ else }}post-upgrade{{ end }}"
2021
"helm.sh/hook-delete-policy": "{{ if .Values.hooks.removeOnSuccess }}hook-succeeded,{{ end }}before-hook-creation"
2122
"helm.sh/hook-weight": "-1"
23+
{{- end }}
2224
spec:
2325
{{- if .Values.hooks.activeDeadlineSeconds }}
2426
activeDeadlineSeconds: {{ .Values.hooks.activeDeadlineSeconds }}
@@ -87,26 +89,15 @@ spec:
8789
CLICKHOUSE_STATUS=0
8890
while [ $CLICKHOUSE_STATUS -eq 0 ]; do
8991
CLICKHOUSE_STATUS=1
90-
CLICKHOUSE_REPLICAS={{ .Values.clickhouse.enabled | ternary .Values.clickhouse.clickhouse.replicas "1" }}
91-
i=0; while [ $i -lt $CLICKHOUSE_REPLICAS ]; do
9292
{{- if .Values.clickhouse.enabled }}
93-
CLICKHOUSE_HOST={{ $clickhouseHost }}-$i.{{ $clickhouseHost }}-headless
93+
CLICKHOUSE_HOST={{ include "clickhouse.headlessServiceName" $.Subcharts.clickhouse }}
9494
{{- else }}
9595
CLICKHOUSE_HOST={{ .Values.externalClickhouse.host }}
9696
{{- end }}
9797
if ! nc -z "$CLICKHOUSE_HOST" {{ $clickhousePort }}; then
9898
CLICKHOUSE_STATUS=0
9999
echo "$CLICKHOUSE_HOST is not available yet"
100100
fi
101-
{{- if and .Values.clickhouse.enabled .Values.clickhouse.clickhouse.configmap.remote_servers.replica.backup.enabled }}
102-
CLICKHOUSE_HOST={{ $clickhouseHost }}-replica-$i.{{ $clickhouseHost }}-replica-headless
103-
if ! nc -z "$CLICKHOUSE_HOST" {{ $clickhousePort }}; then
104-
CLICKHOUSE_STATUS=0
105-
echo "$CLICKHOUSE_HOST is not available yet"
106-
fi
107-
{{- end }}
108-
i=$((i+1))
109-
done
110101
if [ "$CLICKHOUSE_STATUS" -eq 0 ]; then
111102
echo "Clickhouse not ready. Sleeping for 10s before trying again"
112103
sleep 10;

charts/sentry/templates/hooks/sentry-db-init.job.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ metadata:
88
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
99
release: "{{ .Release.Name }}"
1010
heritage: "{{ .Release.Service }}"
11+
{{- if .Values.asHook }}
1112
annotations:
1213
# This is what defines this resource as a hook. Without this line, the
1314
# job is considered part of the release.
1415
"helm.sh/hook": "post-install,{{ if .Values.hooks.preUpgrade }}pre-upgrade{{ else }}post-upgrade{{ end }}"
1516
"helm.sh/hook-delete-policy": "{{ if .Values.hooks.removeOnSuccess }}hook-succeeded,{{ end }}before-hook-creation"
1617
"helm.sh/hook-weight": "6"
18+
{{- end }}
1719
spec:
1820
{{- if .Values.hooks.activeDeadlineSeconds }}
1921
activeDeadlineSeconds: {{ .Values.hooks.activeDeadlineSeconds }}

charts/sentry/templates/hooks/sentry-secret-create.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ metadata:
88
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
99
release: "{{ .Release.Name }}"
1010
heritage: "{{ .Release.Service }}"
11+
{{- if .Values.asHook }}
1112
annotations:
1213
"helm.sh/hook": "pre-install"
1314
"helm.sh/hook-weight": "3"
15+
{{- end }}
1416
type: Opaque
1517
data:
1618
key: {{ randAlphaNum 50 | b64enc | quote }}

charts/sentry/templates/hooks/snuba-db-init.job.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ metadata:
99
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
1010
release: "{{ .Release.Name }}"
1111
heritage: "{{ .Release.Service }}"
12+
{{- if .Values.asHook }}
1213
annotations:
1314
# This is what defines this resource as a hook. Without this line, the
1415
# job is considered part of the release.
1516
"helm.sh/hook": "post-install,{{ if .Values.hooks.preUpgrade }}pre-upgrade{{ else }}post-upgrade{{ end }}"
1617
"helm.sh/hook-delete-policy": "{{ if .Values.hooks.removeOnSuccess }}hook-succeeded,{{ end }}before-hook-creation"
1718
"helm.sh/hook-weight": "3"
19+
{{- end }}
1820
spec:
1921
{{- if .Values.hooks.activeDeadlineSeconds }}
2022
activeDeadlineSeconds: {{ .Values.hooks.activeDeadlineSeconds }}

charts/sentry/templates/hooks/snuba-migrate.job.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ metadata:
99
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
1010
release: "{{ .Release.Name }}"
1111
heritage: "{{ .Release.Service }}"
12+
{{- if .Values.asHook }}
1213
annotations:
1314
# This is what defines this resource as a hook. Without this line, the
1415
# job is considered part of the release.
1516
"helm.sh/hook": "post-install,{{ if .Values.hooks.preUpgrade }}pre-upgrade{{ else }}post-upgrade{{ end }}"
1617
"helm.sh/hook-delete-policy": "{{ if .Values.hooks.removeOnSuccess }}hook-succeeded,{{ end }}before-hook-creation"
1718
"helm.sh/hook-weight": "5"
19+
{{- end }}
1820
spec:
1921
{{- if .Values.hooks.activeDeadlineSeconds }}
2022
activeDeadlineSeconds: {{ .Values.hooks.activeDeadlineSeconds }}

0 commit comments

Comments
 (0)