go-sql-proxy
This project implements a SQL proxy server in Golang that acts as an intermediary between a client and a MySQL server. The proxy server can handle protocol decoding and data transfer while measuring and updating metrics for monitoring purposes.
About this chart
go-sql-proxy Helm Chart
This Helm chart deploys the go-sql-proxy MySQL proxy server on Kubernetes.
Installation
helm install my-proxy ./charts/go-sql-proxy
Configuration
The following table lists the configurable parameters of the go-sql-proxy chart and their default values.
| Parameter | Description | Default |
|---|---|---|
settings.bind.host | Bind address for proxy | 0.0.0.0 |
settings.bind.port | Bind port for proxy | 3306 |
settings.debug | Enable debug logging | false |
settings.metrics.enabled | Enable metrics endpoint | true |
settings.metrics.port | Metrics port | 9090 |
settings.source.host | Target MySQL server hostname | example.db.ondigitalocean.com |
settings.source.port | Target MySQL server port | 25060 |
settings.source.user | MySQL username | doadmin |
settings.source.password | MySQL password | password |
settings.source.database | Default database name | defaultdb |
settings.ssl.enabled | Enable SSL/TLS connection | false |
settings.ssl.skipVerify | Skip SSL certificate verification | false |
settings.ssl.caFile | Path to CA certificate file | "" |
settings.ssl.certFile | Path to client certificate file | "" |
settings.ssl.keyFile | Path to client key file | "" |
SSL/TLS Configuration
To connect to SSL-enabled MySQL servers (like PlanetScale), enable SSL:
settings:
source:
host: your-database.planetscale.com
port: 3306
ssl:
enabled: true
skipVerify: true # For self-signed certificates
For proper certificate verification, provide CA certificate:
settings:
ssl:
enabled: true
skipVerify: false
caFile: /path/to/ca.pem
For mutual TLS authentication:
settings:
ssl:
enabled: true
certFile: /path/to/client-cert.pem
keyFile: /path/to/client-key.pem
Monitoring
The proxy exposes Prometheus metrics on the configured metrics port:
/metrics- Prometheus metrics/healthz- Liveness probe/readyz- Readiness probe/version- Version information
Deploy go-sql-proxy with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has go-sql-proxy on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartgo-sql-proxy is pinned at v0.3.21 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply