This Helm Chart is designed to deploy the GreatSQL Operator. It simplifies the process of deploying and managing MySQL-based databases in Kubernetes clusters, supporting both single-instance and group replication (cluster) modes.
Kubernetes 1.22+
Helm 3.0+
A compatible StorageClass for PersistentVolumes (required for persistence)
Before installing the chart, add the official repository:
helm repo add greatsql-operator https://greatsql-sigs.github.io/greatsql-operator-helm
helm repo update
To install the chart, use the following command
helm install greatsql greatsql-operator/greatsql-operator
This will install the chart with default values. You can customize the installation by specifying parameters (see the Configuration
section below).
To uninstall the deployed chart, use the following command
helm delete greatsql
This command removes all resources associated with the chart but retains PersistentVolumeClaims (PVCs) by default to avoid accidental data loss.
You can customize the installation by modifying the default values.yaml file or passing custom values through the --set flag.
Parameter | Description | Default |
---|---|---|
replicaCount |
Number of replicas for single-instance deployments | 1 |
type |
Deployment type: SingleInstance or GroupReplicationCluster |
SingleInstance |
image.repository |
Image repository | registry.cn-chengdu.aliyuncs.com/greatsql/greatsql-operator |
image.tag |
Image tag | latest |
service.type |
Kubernetes service type | ClusterIP |
service.port |
MySQL service port | 3306 |
storage.enabled |
Enable persistent storage | true |
storage.size |
Requested storage size for PersistentVolumeClaim | 10Gi |
configFile.enabled |
Enable custom configuration file mounting | false |
configFile.configMapName |
Name of the ConfigMap for configuration | greatsql-config |
helm install greatsql greatsql-operator/greatsql-operator \
--set type=SingleInstance \
--set replicaCount=1 \
--set storage.size=20Gi
helm install greatsql-cluster greatsql-operator/greatsql-operator \
--set type=GroupReplicationCluster \
--set cluster.replicas=3 \
--set storage.size=50Gi \
--set configFile.enabled=true \
--set configFile.files.my.cnf="[mysqld]\nserver-id=1\nlog-bin=mysql-bin\nbinlog-format=ROW"
If you want to mount a custom my.cnf configuration, create a ConfigMap:
kubectl create configmap greatsql-config --from-literal=my.cnf="[mysqld]\nmax_connections=200"
Then install the chart with:
helm install greatsql greatsql-operator/greatsql-operator \
--set configFile.enabled=true \
--set configFile.configMapName=greatsql-config
By default, persistent storage is enabled. To disable it, set storage.enabled to false:
helm install greatsql greatsql-operator/greatsql-operator \
--set storage.enabled=false
When enabled, PersistentVolumeClaims are created to store MySQL data, ensuring data durability even if the Pod is deleted or restarted.
To upgrade the chart to a newer version or update values, use the following command:
helm upgrade greatsql greatsql-operator/greatsql-operator --set <parameters>
GreatSQL exposes basic liveness and readiness probes to ensure proper functioning. You can also integrate monitoring tools such as Prometheus and Grafana for advanced metrics.
For support, please visit the GreatSQL SIGs GitHub Repository or raise an issue in the repository.
By using this chart, you can easily deploy and manage MySQL instances in Kubernetes clusters, whether for development, testing, or production environments.