The MySQL Helm chart provides an easy way to deploy and manage MySQL instances in your Kubernetes environment. This chart includes configurations for persistence, resource management, and scalability to suit various use cases.


Add Helm Repository

Before installing the MySQL chart, add the repository to your Helm installation and update the repository index:


See Helm Repository Documentation for more details.


Install Helm Chart

To install the MySQL Helm chart, run the following command:

helm install [RELEASE_NAME]

Replace [RELEASE_NAME] with your desired release name.

For example:

You can customize the installation by providing a custom values.yaml file or overriding values via the command line.

See Helm Install Documentation for further details.


Uninstall Helm Chart

To uninstall the MySQL Helm chart and remove all associated Kubernetes resources, run:

helm uninstall [RELEASE_NAME]

For example:

See Helm Uninstall Documentation for more information.


Configuration

The following table describes the configurable parameters of the MySQL Helm chart and their default values:

Input

Type

Description

Default

mysqlRootPassword

string

Root password for the MySQL instance. Leave unset for default random generation.

None

updateStrategy.type

string

Update strategy for the deployment. Options: RollingUpdate or Recreate.

RollingUpdate

diskSize

string

Size of the persistent volume claim (PVC) for storing MySQL data.

"10Gi"

image

string

Docker image and tag for the MySQL container.

mysql:8.0

resources.requests.cpu

string

Minimum CPU resources required by the MySQL container.

"500m"

resources.requests.memory

string

Minimum memory resources required by the MySQL container.

"256M"

resources.limits.cpu

string

Maximum CPU resources the MySQL container can use.

"1500m"

resources.limits.memory

string

Maximum memory resources the MySQL container can use.

"1Gi"

customMyCnf

string

Custom MySQL configuration to be layered on top of the default config. Provided as a full INI file.

""

You can override these values in your values.yaml file or pass them as flags when installing the chart.


Example values.yaml File


To use this configuration, save it in a values.yaml file and pass it to the Helm install command:


Example: Providing Custom MySQL Configuration

To override or add to the default MySQL configuration, provide your own my.cnf content using the customMyCnf value. This will be mounted as /etc/mysql/conf.d/custom.cnf in the container and layered on top of the default config.

Example values.yaml:

customMyCnf: |
  [mysqld]

This allows you to specify any MySQL configuration options you need, without losing the chart's defaults.


Features

  • Persistence: The chart supports persistent volume claims to store MySQL data across pod restarts.

  • Customizable Resources: Define resource requests and limits to optimize performance and manage costs.

  • Scalable: Use the updateStrategy configuration to handle updates with zero downtime.

  • Pre-configured Settings: Defaults are optimized for a variety of workloads.


Advanced Usage

Custom Secrets for Root Password

You can provide a pre-existing Kubernetes secret for the MySQL root password. To enable this, modify the values.yaml file with the secret name:


Ensure the secret is created before deploying the chart:


Contributing

We welcome contributions to improve this Helm chart. Please refer to the CONTRIBUTING.md file for guidelines.


Code of Conduct

To ensure a respectful and collaborative community, please adhere to our Code of Conduct.


License

This project is licensed under the LICENSE. Please review it for terms of use.

Prerequisites

Kubernetes 1.19+

Helm 3+

Build By

Zop.dev

Category

See Helm Install Documentation for more information.

Need Help with This Integration?

We’re here to make setup smooth. Let us know what’s confusing—or which tools you'd like to see integrated next.

Need technical support or have product questions?

Tell us how we can help