Minimum Viable Product - MariaDB Kubernetes Operator for traditional replication (MDBF-299)

[MDBF-374] Statefulset part M/S - create initcontainers Created: 2022-03-29  Updated: 2022-06-19  Resolved: 2022-06-19

Status: Closed
Project: MariaDB Foundation Development
Component/s: Kubernetes
Affects Version/s: None
Fix Version/s: N/A

Type: Technical task Priority: Major
Reporter: Anel Husakovic Assignee: Anel Husakovic
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 6.75d
Time Spent: 0.25d
Original Estimate: 7d


 Description   

initcontainers should be used to :
1. initialize MariaDB configuration files (for each server set server-id.cnf and copy the predefined scripts to primary/secondary),
2. initialize MariaDB datadir, create root account, etc?
3. clone-mariadb (check unique name of a server and if is replica/secondary, clone data from previous server (1.replica will get data from primary, all other will get from previous peer).



 Comments   
Comment by Anel Husakovic [ 2022-04-06 ]

Example of initContainer

spec:
  containers:
  - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep 3600']
  initContainers:
  - name: init-myservice
    image: busybox:1.28
    command: ['sh', '-c', "until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
  - name: init-mydb
    image: busybox:1.28
    command: ['sh', '-c', "until nslookup mydb.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for mydb; sleep 2; done"]

https://kubernetes.io/docs/concepts/workloads/pods/init-containers/

Generated at Thu Feb 08 03:37:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.