Skip to content

Commit

Permalink
enterprise: upgrade mysql chart
Browse files Browse the repository at this point in the history
The charts.helm.sh repo has reached EOL since 2020.
https://github.com/helm/charts/blob/master/stable/mysql/README.md

Switch to the bitnami chart which has the most stars on Artifact Hub.
https://artifacthub.io/packages/search?ts_query_web=mysql&sort=stars&page=1

This chart is licensed under Apache License 2.0 so it should be safe to
use.

Note that for a production-ready deployment of MySQL, users should
consider leveraging a cloud-hosted service, such as AWS RDS or GCP
CloudSQL. MySQL also provides an official Operator (1) which could be
installed as a helm-chart.

(1): https://dev.mysql.com/doc/mysql-operator/en/mysql-operator-introduction.html
  • Loading branch information
sluongng committed May 29, 2024
1 parent 7c8e7a9 commit eab6919
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
Binary file removed charts/buildbuddy-enterprise/charts/mysql-1.6.4.tgz
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions charts/buildbuddy-enterprise/requirements.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- name: mysql
repository: https://charts.helm.sh/stable
version: 1.6.4
repository: https://charts.bitnami.com/bitnami
version: 11.1.0
- name: buildbuddy-redis
repository: https://helm.buildbuddy.io
version: 0.0.11
Expand All @@ -26,5 +26,5 @@ dependencies:
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 6.6.2
digest: sha256:b6a06e3b2b111bd4696e7a74b0f13f6baf641fb6f95e98af0c5f6ae21d64b3c3
generated: "2024-05-28T20:58:49.054721851Z"
digest: sha256:9130dc21fe79e47451ce52b80ece2aefeca3cacfdfab57566b1163ccd645e06c
generated: "2024-05-29T15:34:20.310841+02:00"
4 changes: 2 additions & 2 deletions charts/buildbuddy-enterprise/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- name: mysql
version: 1.6.4
repository: https://charts.helm.sh/stable
version: 11.1.0
repository: https://charts.bitnami.com/bitnami
condition: mysql.enabled
- name: buildbuddy-redis
alias: redis
Expand Down
2 changes: 1 addition & 1 deletion charts/buildbuddy-enterprise/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ data:
{{- end }}

{{- if .Values.mysql.enabled }}
{{- $_ := set $c.database "data_source" (print "mysql://" .Values.mysql.mysqlUser ":" .Values.mysql.mysqlPassword "@tcp(" .Release.Name "-mysql:3306)/" .Values.mysql.mysqlDatabase) }}
{{- $_ := set $c.database "data_source" (print "mysql://" .Values.mysql.auth.user ":" .Values.mysql.auth.password "@tcp(" .Release.Name "-mysql:3306)/" .Values.mysql.auth.database) }}
{{- else if not .Values.config.database.data_source }}
{{- $_ := set $c.database "data_source" "sqlite3:///tmp/buildbuddy-enterprise.db" }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/buildbuddy-enterprise/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- name: "init-mysql"
image: "{{ .Values.initContainerImage.repository }}:{{ .Values.initContainerImage.tag }}"
imagePullPolicy: {{ .Values.initContainerImage.imagePullPolicy }}
command: ["sh", "-c", "until curl --max-time 10 http://{{ .Release.Name }}-mysql:3306; do echo waiting for {{ .Release.Name }}-mysql; sleep 5; done;"]
command: ["sh", "-c", "until curl --max-time 10 http://{{ .Release.Name }}-mysql-0:3306; do echo waiting for {{ .Release.Name }}-mysql-0; sleep 5; done;"]
{{- end }}
{{- if .Values.extraInitContainers }}
{{- .Values.extraInitContainers | toYaml | nindent 6 }}
Expand Down
32 changes: 12 additions & 20 deletions charts/buildbuddy-enterprise/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,28 +198,20 @@ certmanager:
## Either enable mysql here, or use your own data_source connection string
## in the config block below.
mysql:
enabled: false
mysqlRootPassword: ""
mysqlUser: ""
mysqlPassword: ""
mysqlDatabase: buildbuddy

resources:
requests:
cpu: "2"
memory: "4Gi"

configurationFiles:
mysql.cnf: |-
enabled: true
auth:
rootPassword: ""
username: ""
password: ""
database: buildbuddy
primary:
# See the preset values in https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
resourcesPreset: xlarge
configuration: |-
[mysqld]
max_connections=4000
repository: mysql
imageTag: "8.0.18"
# metrics:
# enabled: true
# annotations:
# prometheus.io/scrape: "true"
# prometheus.io/port: "9104"
secondary:
replicaCount: 0

redis:
enabled: false
Expand Down

0 comments on commit eab6919

Please sign in to comment.