CSC/ECE 517 Fall 2023 - NTX-4 Expand NDB Operator capabilities to support Postgres HA

From Expertiza_Wiki
Jump to navigation Jump to search

Kubernetes


Nutanix Database Service


NDB Kubernetes Operator

The goal of NDB Operator, a Kubernetes operator, is to make the process of setting up and maintaining database clusters within Kubernetes clusters easier. An application with operational knowledge of another application is called a Kubernetes operator. After deployment within the Kubernetes Cluster, it can start monitoring the endpoints of interest and modifying the application under management. An NDB Cluster can be deployed, managed, and modified with the least amount of human intervention thanks to the NDB Operator.

Using their K8s cluster, developers can now provision PostgreSQL, MySQL, and MongoDB databases directly, saving them days or even weeks of work. They can take advantage of NDB's complete database lifecycle management while using the opensource NDB Operator on their preferred K8s platform.

Problem Statement

The problem statement requires us to extend NDB operator capabilities to support Postgres HA (High Availability). Currently NDB has support for Posgres High Availability databases but the NDB operator cannot manage them. Our task is to identify what additions need to be made to the project to support Postgres HA and implement these additions. Moreover, we will perform end-to-end testing of the provisioning and deprovisioning processes to ensure their smooth functionality.

Postgres HA involves implementation of measures that ensure that a PostgreSQL database system remains operational and accessible even in the face of hardware failures, software issues, or other types of disruptions. This includes measures like replication, failover, load balancing and more.

Approach

- To start a hardcoded file containing basic config for Postgres HA can be made.
- The hardcoded file will contain details such as databaseInstanceName, description, clusterId, credentialSecret, size.
- Starting from ndb_api changes can be made to integrate Postgres HA support.
- The flow of changes will be from ndb_api -> controller adapters -> controllers -> api.
- In ndb_api, another method appendRequest for Postgres HA needs to be added to db_helpers.go. Within this method, additional specifications for this specific database type shall be provided.
- Within api, the Instance struct needs to be updated to include parameters like copies of the instance, how often data will be copied from the primary and more.

References

Nutanix Database Service

PostgreSQL High Availability

Relevant Links

link to GitHub repository: https://github.com/rithvik2607/ndb-operator

Team

Mentor
Nandini Mundra

Student Team
Sai Rithvik Ayithapu (sayitha@ncsu.edu)
Sreehith Yachamaneni (syacham@ncsu.edu)
Rushil Patel (rdpate24@ncsu.edu)