Namespace Preparation: To keep resources isolated, create a dedicated namespace for this tutorial:
kubectl create ns demo
Expected Output:
namespace/demo created
Deploying the MySQL Semi-Synchronous Cluster
KubeBlocks uses a declarative approach for managing MySQL clusters. Below is an example configuration for deploying a MySQL cluster with 2 nodes (1 primary, 1 replicas) in semi-synchronous mode and a custom root password.
Step 1: Create a Secret for the Root Account
The custom root password is stored in a Kubernetes Secret. Create the Secret by applying the following YAML:
Created a Kubernetes Secret to securely store a custom MySQL root password.
Deployed a MySQL cluster in KubeBlocks with a custom root password.
Verified the deployment and connected to the cluster's primary node using the MySQL client.
Using Kubernetes Secrets ensures secure credential management for your MySQL clusters, while KubeBlocks simplifies the deployment and management process.