Setting up MySQL replica on Kubernetes cluster using Helm chart | Step-by-step guide
ฝัง
- เผยแพร่เมื่อ 25 ส.ค. 2024
- @configjavatech
#mysql #kubernetes #helm
In this video, we will be walking through the process of setting up MySQL replica on a Kubernetes cluster using Helm chart. We will start by discussing the prerequisites required for this installation and then dive into the step-by-step process of configuring the master and slave nodes. This guide is ideal for anyone looking to set up MySQL replica on Kubernetes for better data redundancy and availability. With this tutorial, you will be able to set up a robust MySQL replica in no time!
MySQL configuration
----------------------------------
PV configuration
--------------------------
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-primary
spec:
capacity:
storage: 8Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: standard
hostPath:
path: /minikube-host/primary
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-secondary1
spec:
capacity:
storage: 8Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: standard
hostPath:
path: /minikube-host/secondary1
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-secondary2
spec:
capacity:
storage: 8Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: standard
hostPath:
path: /minikube-host/secondary2
Starting kubernetes cluster
--------------------------------------------
minikube start --profile mysqlreplica --driver docker --mount=true --mount-string=C:\DEVELOPMENT\mysqlkubernetes:/minikube-host
Helm Install Command
-------------------------------------
helm install mysql --set auth.rootPassword=admin12345$,auth.database=app_database,secondary.persistence.enabled=true,secondary.persistence.size=8Gi,primary.persistence.enabled=true,primary.persistence.size=8Gi,architecture=replication,auth.replicationPassword=admin12345$,secondary.replicaCount=2 oci://registry-1.docker.io/bitnamicharts/mysql
To listen to host port using kubectl
--------------------------------------------------------
kubectl port-forward --address "0.0.0.0" svc/mysql-primary 3306:3306
kubectl port-forward --address "0.0.0.0" svc/mysql-secondary 3307:3306
------------------
Please subscribe by clicking the below link to support my channel:
bit.ly/3gM6elC
TH-cam keywords
-------------------------------
mysql kubernetes helm, minikube docker dirver, Mysql replication, mysql workbench, Mysql master slave replication kubernetes, Mysql kubernetes deployment, Mysql bitnami helm, helm charts, helm, helm chart, helm charts kubernetes, kubernetes cluster setup, kubernetes helm