MySQL Forums
Forum List  »  MySQL & Kubernetes

What's wrong with this configuration?
Posted by: Raphy Stonehorse
Date: November 11, 2025 03:56AM

I defined Innodb cluster configuration file as follows :


# https://medium.com/edstem/postgres-deployment-to-kubernetes-using-nodeport-626a93d8a919

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: mysql-sc
#namespace: default
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

---

# https://dev.mysql.com/doc/mysql-operator/en/mysql-operator-backups.html

apiVersion: v1
kind: PersistentVolume
metadata:
name: innodb-volume
labels:
type: local
#app: mysql
spec:
storageClassName: mysql-sc
capacity:
storage: 40Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /var/lib/data/mysql # https://stackoverflow.com/questions/62577494/mkdir-mnt-data-read-only-file-system-back-off-restarting->;

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: innodb-volume-claim
#labels:
#app: mysql
spec:
storageClassName: mysql-sc
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 40Gi

---

# https://dev.mysql.com/doc/mysql-operator/en/mysql-operator-innodbcluster-common.html

apiVersion: mysql.oracle.com/v2
kind: InnoDBCluster
metadata:
name: mycluster
spec:
secretName: mypwds
tlsUseSelfSigned: true
instances: 3
version: 9.5.0
router:
instances: 1
version: 9.5.0
datadirVolumeClaimTemplate:
storageClassName: mysql-sc
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 40Gi
initDB:
clone:
donorUrl: mycluster-0.mycluster-instances.another.svc.cluster.local:3306
rootUser: root
secretKeyRef:
name: mypwds
mycnf: |
[mysqld]
max_connections=162

Applying this configuration :

(base) raphy@raohy:~/.talos/openmetadata/mysql$ kubectl apply -f mysqlcluster.yaml
storageclass.storage.k8s.io/mysql-sc unchanged
persistentvolume/innodb-volume created
persistentvolumeclaim/innodb-volume-claim created
innodbcluster.mysql.oracle.com/mycluster configured

I get :

(base) raphy@raohy:~/.talos/openmetadata/mysql$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
innodb-volume-claim Pending mysql-sc <unset> 11m

(base) raphy@raohy:~/.talos/openmetadata/mysql$ kubectl -n default get pods
NAME READY STATUS RESTARTS AGE
omd-os-cluster-dashboards-5b9fbdfd45-rzhsn 1/1 Running 0 63m
omd-os-cluster-masters-0 1/1 Running 0 63m
omd-os-cluster-masters-1 1/1 Running 0 60m
omd-os-cluster-masters-2 1/1 Running 0 58m
omd-os-cluster-securityconfig-update-cj7bh 0/1 Completed 0 63m
opensearch-operator-controller-manager-7448949c9b-6kzlm 2/2 Running 47 (65m ago) 18h


How to make the InnoDB Cluster working?

Options: Reply• Quote


Subject
Written By
Posted
What's wrong with this configuration?
November 11, 2025 03:56AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.