GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DiptoChakrabarty/MySQLInstanceController: MySQLInstance Controller is a Kubernetes Operator designed to automate the deployment and management of MySQL instances in a Kubernetes cluster.

BranchesTags
Open more actions menu

Latest commit

 

History

80 Commits
80 Commits

Folders and files

NameName
Last commit message
Last commit date
api/v1alpha1
api/v1alpha1
 
 
bin
bin
 
 
config
config
 
 
controllers
controllers
 
 
hack
hack
 
 
images
images
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
Contributing.md
Contributing.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
PROJECT
PROJECT
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
main.go
main.go
 
 
mysql_instance_example.yaml
mysql_instance_example.yaml
 
 
mysql_v1alpha1_mysqlinstance_crd.yaml.yaml
mysql_v1alpha1_mysqlinstance_crd.yaml.yaml
 
 

Repository files navigation

MySQLInstanceController

Architecture Image

Project Description

The MySQLInstance Controller is a Kubernetes Operator designed to automate the deployment and management of MySQL instances in a Kubernetes cluster. It simplifies the process of setting up and maintaining MySQL databases with backups , providing a seamless experience for developers and administrators.

Flow of how controller works

show

- Custom Resource Definition (CRD):
The project defines a new custom resource named MySQLInstance. This custom resource allows users to specify the configuration details of their MySQL instances, such as version, storage requirements, and backup preferences.

- Reconciliation Logic:
The core of the Operator is the reconciliation loop, which continuously ensures that the actual state of the system matches the desired state defined in the MySQLInstance custom resource's spec. In each iteration, the Operator compares the current state of the resources with the desired state and takes corrective actions as needed.

- StatefulSet Creation:
When a new MySQLInstance custom resource is created, the Operator generates a StatefulSet manifest based on the specifications provided in the resource's spec. The StatefulSet defines the MySQL pods and their persistent storage.

- Service Creation:
The Operator creates a Service to expose the MySQL pods within the Kubernetes cluster. The Service allows other applications to interact with the MySQL database using the appropriate endpoint and port.

- Secrets Management:
For secure communication with MySQL pods, the Operator creates and manages Kubernetes Secrets containing credentials, such as the MySQL root password. These Secrets are used by the MySQL pods for authentication.

- Backup Scheduler:
The MySQLInstance custom resource allows users to specify whether backups are required for their MySQL instances. If backups are enabled, the Operator sets up a backup schedule using Kubernetes CronJobs.

- Backup Logic:
When the backup schedule is triggered, the Operator orchestrates the backup process for the MySQL instances. It interacts with the MySQL pods, using the credentials from the Secrets, and performs a backup using either mysqldump or a custom backup tool.

What was done on this project

show

- Custom Resource Definition:
A new CRD named MySQLInstance was defined to represent MySQL instances and their configuration, including backup preferences.

- Operator Implementation:
The Operator implementation includes the main reconciliation loop to manage the MySQLInstance resources and create the associated resources (StatefulSet, Service, Secrets, and CronJobs) based on the provided specifications.

- Backup and Secrets Management:
The Operator was designed to interact with MySQL instances and manage backup jobs using Kubernetes CronJobs. It also created and managed Kubernetes Secrets for credentials.

- RBAC and Permissions:
Appropriate RBAC permissions were added to the Operator to ensure it has the required access to manage the necessary resources.

Development of the project

Please view Contributing.md to know the steps required to make your changes

About

MySQLInstance Controller is a Kubernetes Operator designed to automate the deployment and management of MySQL instances in a Kubernetes cluster.

Topics

controllerscustomresourcedefinitiondatabasedeveloperdevopskubernetesmysqloperator

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.