Skip to content

Commit

Permalink
Merge branch 'main' into useAutoMem
Browse files Browse the repository at this point in the history
  • Loading branch information
olapiv committed Dec 28, 2024
2 parents ff08b45 + 8b8ac99 commit 9423f52
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 12 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Helmchart RonDB
# RonDB Helm chart

## About RonDB

Expand All @@ -15,13 +15,15 @@ Being supported by the MySQL server, RonDB is inherently ACID compliant. In-memo

This Helmchart is hosted on [GitHub Pages](https://logicalclocks.github.io/rondb-helm/). See the `gh_pages` branch of this repository for the source code.

## Capabilities
## Helm chart's capabilities

- Create custom-size, cross-AZ cluster
This Helm chart supports:

- Creating custom-size, cross-AZ cluster
- Scaling data node replicas
- Horizontal auto-scaling of MySQLds & RDRS'
- Scale data node replicas
- Create backups & restore from backups
- Global Replication
- Backup & restore to and from object storage (e.g. S3)
- Global Replication (cross-cluster replication)

## Quickstart

Expand Down Expand Up @@ -53,9 +55,9 @@ kubectl create secret generic aws-credentials \
--from-literal "key_id=${AWS_ACCESS_KEY_ID}" \
--from-literal "access_key=${AWS_SECRET_ACCESS_KEY}"

# Run this if both:
# Run this if:
# - We want to use the cert-manager for TLS certificates
# - [RDRS Ingress is enabled] OR [Any TLS is enabled]
# - RDRS Ingress is enabled
source ./standalone_deps.sh
setup_deps $RONDB_NAMESPACE

Expand Down
2 changes: 2 additions & 0 deletions templates/mgmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ spec:
# Used to apply labels to all pods created by the Deployment
labels:
rondbService: {{ include "rondb.labels.rondbService.mgmd" $ }}
annotations:
configIniHash: {{ include "rondb.configIniHash" $ }}
spec:
{{- include "rondb.imagePullSecrets" . | indent 6 }}
{{- include "rondb.nodeSelector" (dict "nodeSelector" .Values.nodeSelector.mgmd) | indent 6 }}
Expand Down
2 changes: 2 additions & 0 deletions templates/mysqlds/binlog_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ spec:
# Used to apply labels to all pods created by the Deployment
labels:
rondbService: {{ include "rondb.labels.rondbService.binlog-servers" $ }}
annotations:
configIniHash: {{ include "rondb.configIniHash" $ }}
spec:
{{- include "rondb.imagePullSecrets" . | indent 6 }}
affinity:
Expand Down
2 changes: 2 additions & 0 deletions templates/mysqlds/mysqld.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
# Used to apply labels to all pods created by the Deployment
labels:
rondbService: {{ include "rondb.labels.rondbService.mysqld" $ }}
annotations:
configIniHash: {{ include "rondb.configIniHash" $ }}
spec:
{{- include "rondb.imagePullSecrets" . | indent 6 }}
{{- include "rondb.nodeSelector" (dict "nodeSelector" $.Values.nodeSelector.mysqld) | indent 6 }}
Expand Down
2 changes: 2 additions & 0 deletions templates/mysqlds/replica_appliers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ spec:
# Used to apply labels to all pods created by the Deployment
labels:
rondbService: {{ include "rondb.labels.rondbService.replica-appliers" $ }}
annotations:
configIniHash: {{ include "rondb.configIniHash" $ }}
spec:
{{- include "rondb.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "rondb.mysqldServiceAccountName" . }}
Expand Down
1 change: 1 addition & 0 deletions templates/ndbd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ spec:
nodeGroup: {{ $nodeGroup | quote }}
# This is an easy way to restart data nodes without changing specs.
annotations:
configIniHash: {{ include "rondb.configIniHash" $ }}
{{- range $k, $v := $.Values.meta.ndbmtd.statefulSet.podAnnotations }}
{{ $k | quote }}: {{ $v | quote }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions templates/rdrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ spec:
# Used to apply labels to all pods created by the Deployment
labels:
rondbService: {{ include "rondb.labels.rondbService.rdrs" $ }}
annotations:
configIniHash: {{ include "rondb.configIniHash" $ }}
spec:
{{- include "rondb.imagePullSecrets" . | indent 6 }}
{{- include "rondb.nodeSelector" (dict "nodeSelector" $.Values.nodeSelector.rdrs) | indent 6 }}
Expand Down
5 changes: 5 additions & 0 deletions templates/shared_templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,8 @@ spec:
---
{{ end }}
{{- end }}

# This is an easy way to trigger rolling restarts of all RonDB Pods
{{- define "rondb.configIniHash" -}}
{{ mustRegexReplaceAll "NodeActive *=.*" (tpl ($.Files.Get "files/configs/config.ini") $) "" | sha256sum }}
{{- end -}}
4 changes: 0 additions & 4 deletions test_scripts/active-passive-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ MYSQL_SECRET_NAME="mysql-passwords"
NUM_BINLOG_SERVERS=2
PRIMARY_CLUSTER_NUMBER=1

# TODO: Fix ingress.enabled after other PR
helm upgrade -i rondb-primary \
--namespace=$NAMESPACE \
--kubeconfig=$PRIMARY_KUBECONFIG . \
--set "meta.binlogServers.externalLoadBalancers.namePrefix=$BINLOG_SERVER_LOAD_BALANCER_PREFIX" \
--set "clusterSize.minNumRdrs=0" \
--set "mysql.credentialsSecretName=$MYSQL_SECRET_NAME" \
--set "mysql.supplyOwnSecret=false" \
--set "tls.ingress.enabled=false" \
--set "globalReplication.clusterNumber=$PRIMARY_CLUSTER_NUMBER" \
--set "globalReplication.primary.enabled=true" \
--set "globalReplication.primary.numBinlogServers=$NUM_BINLOG_SERVERS" \
Expand Down Expand Up @@ -58,14 +56,12 @@ kubectl get secret $MYSQL_SECRET_NAME --kubeconfig=$PRIMARY_KUBECONFIG --namespa
sed '/namespace/d; /creationTimestamp/d; /resourceVersion/d; /uid/d' |
kubectl apply --kubeconfig=$SECONDARY_KUBECONFIG --namespace=$NAMESPACE -f -

# TODO: Fix ingress.enabled after other PR
helm upgrade -i rondb-secondary \
--namespace=$NAMESPACE \
--kubeconfig=$SECONDARY_KUBECONFIG . \
--set "clusterSize.minNumRdrs=0" \
--set "mysql.credentialsSecretName=$MYSQL_SECRET_NAME" \
--set "mysql.supplyOwnSecret=true" \
--set "tls.ingress.enabled=false" \
--set "globalReplication.clusterNumber=$((PRIMARY_CLUSTER_NUMBER + 1))" \
--set "globalReplication.secondary.enabled=true" \
--set "globalReplication.secondary.replicateFrom.clusterNumber=$PRIMARY_CLUSTER_NUMBER" \
Expand Down

0 comments on commit 9423f52

Please sign in to comment.