Charmed MySQL K8s
- By Canonical Data Platform
|8.0/stable||75||20 Apr 2023|
|8.0/candidate||75||20 Apr 2023|
|8.0/beta||75||20 Apr 2023|
|8.0/edge||83||26 May 2023|
juju deploy mysql-k8s --channel 8.0/stable
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Charmed MySQL K8s supports modern
mysql_client and legacy
mysql interfaces (in a backward compatible mode).
Note: do NOT relate both modern and legacy interfaces simultaneously!
This charm provides modern ‘mysql_client’ interface. Applications can easily connect MySQL using ‘data_interfaces’ library from ‘data-platform-libs’.
mysql_client interface (
Adding a relation is accomplished with
juju relate (or
juju integrate for Juju 3.x) via endpoint
database. Read more about Juju relations (integrations). Example:
# Deploy Charmed MySQL cluster with 3 nodes juju deploy mysql-k8s -n 3 --trust --channel 8.0 # Deploy the relevant charms, e.g. mysql-test-app juju deploy mysql-test-app # Relate MySQL with your application juju relate mysql-k8s:database mysql-test-app:database # Check established relation (using mysql_client interface): juju status --relations # Example of the properly established relation: # > Relation provider Requirer Interface Type # > mysql-k8s:database mysql-test-app:database mysql_client regular
Note: In order to relate with this charm, every table created by the related application must have a primary key. This is required by the group replication plugin enabled in this charm.
Note: Legacy relations are deprecated and will be discontinued on future releases. Usage should be avoided.
mysql interface (
This charm supports legacy interface
mysql-root). It was a popular interface used by some legacy charms (e.g. “MariaDB”, “OSM MariaDB”, “Percona Cluster” and “Mysql Innodb Cluster”), often in cross-model relations:
juju deploy mysql-k8s --trust --channel 8.0 juju config mysql-k8s mysql-interface-database=wordpress mysql-interface-user=wordpress juju deploy wordpress-k8s juju relate mysql-k8s:mysql wordpress-k8s:db
Note: The endpoint
mysql-root provides the same legacy interface
mysql with MySQL root-level privileges. It is NOT recommended to use it from security point of view.
Help us improve this documentation
Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.