Friday, May 17, 2024

Integrate your Autonomous database with Kubernetes

 

In the fast-changing world of tech, the fusion of databases with Kubernetes is an important topic. Oracle, worked already for quite some time at a cool solution to simplify this merge: the Oracle Database Operator for Kubernetes, also known as OraOperator. This tool is made to help developers, DBAs, DevOps, and GitOps teams cut down the time and complexity involved in deploying and managing Oracle Databases within Kubernetes environments.

The OraOperator is an example to Oracle's commitment to making the Oracle Database Kubernetes-native. This means that the database is observable and operable by Kubernetes, which simplifies many aspects of database administration and operation. The operator extends the Kubernetes API with custom resources and controllers, automating the lifecycle management of Oracle Databases and eliminating the need for a human operator or administrator for the majority of database operations.

One of the key features of the OraOperator is its support for a variety of database configurations and infrastructure. This includes the Oracle Autonomous Database—both shared and dedicated Cloud infrastructure—as well as containerized Single Instance databases and Sharded databases deployed in the Oracle Kubernetes Engine (OKE) and any Kubernetes where OraOperator is deployed. Additionally, it supports Oracle Multitenant Databases and the Oracle Base Database Cloud Service.

The latest release of OraOperator, version 1.1.0, brings several new features and enhancements. These include a namespace scope deployment option, support for Oracle Database 23ai Free with Single Instance Database, automatic storage expansion, user-defined sharding, TCPS support with customer-provided certificates, and the ability to execute custom scripts during database setup and startup. Moreover, it introduces patching for Single Instance Database Primary/Standby in Data Guard and long-term backup for Autonomous Databases.

Oracle's vision for OraOperator is not static; there are more plans to continue extending its capabilities to support additional Oracle Database configurations. This ongoing development reflects Oracle's dedication to innovation and its responsiveness to the needs of the Kubernetes community.

How does it work?

As the complexity of container applications grows, so does the need for more sophisticated management tools. This is where Kubernetes Operators come into play.

Operators extend the Kubernetes API, providing a way to configure and manage more complex instances that go beyond the capabilities of the basic Kubernetes components. They act as a bridge between the declarative configuration of Kubernetes and the imperative logic required to manage the lifecycle of certain applications.
So, why are Operators becoming an essential part of the Kubernetes ecosystem? The answer lies in their ability to manage non-Kubernetes components within a Kubernetes environment. They enable the automation of operational knowledge – the kind that is typically only possessed by experienced system administrators and DevOps professionals – and encode it into software that can efficiently manage the applications

The (OCI) DB Operator for Kubernetes)

The OCI Database Operator is essentially a Kubernetes Operator responsible for managing OCI services. It acts as a bridge between the Kubernetes API and OCI resources, enabling users to describe not only their containerized applications but also the OCI resources that are connected to those applications within the same framework.

This operator is a combination of one or more custom resources and controllers. Custom resources extend the Kubernetes API, providing a way for users to define their own "objects" that are managed by custom controllers. These controllers watch for changes to these custom resources and enact policies based on their configurations, effectively managing the lifecycle of OCI resources.




The benefits of using the OCI Database Operator are numerous. It simplifies the management of OCI services, automating tasks that would otherwise require manual intervention. For developers and operations teams, this means less time spent on database administration and more time focusing on building and improving applications.

One of the key features of the OCI Database Operator is its ability to manage different configurations and infrastructure setups. From Autonomous Databases to Containerized Single Instance databases deployed in the Oracle Kubernetes Engine (OKE), the operator provides a versatile toolset for database lifecycle management.
The key features of the operator are:
  • Creating and manage Oracle Databases in containers(k8s pods)
    • Containerized Single Instance databases (SIDB) deployed in  OKE and any k8s where OraOperator is deployed
    • Containerized Sharded databases (SHARDED) deployed in OKE or any k8s where OraOperator is deployed
  • Manage Oracle databases outside your k8s cluster:
    • Oracle Autonomous Database:
      • Oracle Autonomous Database shared Oracle Cloud Infrastructure (OCI) (ADB-S)
      • Oracle Autonomous Database on dedicated Cloud infrastructure (ADB-D)
      • Oracle Autonomous Container Database (ACD) (infrastructure)
    • Provision, bind, 
    • Scale
    • Stop/start/terminate
    • Change admin password
    • Download wallet for connection
    • Oracle Multitenant Databases (CDB/PDBs)
    • Oracle Base Database Cloud Service (BDBCS)
    • Oracle Data Guard (Preview status)
    • Oracle Database Observability (Preview status)
The latest release of the OCI Database Operator has introduced several enhancements, including namespace scope deployment options, support for Oracle Database 23ai Free, and automatic storage expansion for single instance and sharded databases. These features demonstrate Oracle's commitment to making the Oracle Database Kubernetes-native, observable, and operable by Kubernetes.

Some of the prerequisites

Before using the Operator, some of these actions and prerequisites are necessary to address:
  • Installing the Oracle Database Operator SDK on client machine, if you want to operate from there
  • Configure the appropriate OCI Identity (IAM) service policies 
    • Allow to manage OCI services in your tenancy.
  • Install the Operator Lifecycle Manager (OLM) bundle. 
    • The ORA DB bundle contains all the required details, such as CRDs, RBACs, configmaps, and deployments, which installs it in the Kubernetes cluster. 
To ensure a smooth setup and operation of the OCI Database Operator within a Kubernetes environment, it is important to meet the prerequisites and resource privileges outlined..

It's all about YAML

In any Kubernetes cluster where the OraOperator is installed, you can start by integrating existing or creating new databases in your Oracle Cloud. Below is a simple example of creating an Autonomous database with the OraOperator.

Create


Scale

Adding more CPU can be done very easily using this yaml applying:

Start-stop-terminate


In your Day 0, 1 and 2 operations you can integrate them in an automated way, or use the in scripts for lifecycle actions. The operator will take care of the operations in the background.

Conclusion (for now)

In conclusion, the Oracle Database Operator for Kubernetes represents a significant step forward in the integration of cloud database services with container orchestration platforms. By leveraging the power of Kubernetes, organizations can achieve greater agility, scalability, and efficiency in their cloud-native applications. The Oracle Database Operator for Kubernetes is a significant advancement in integrating traditional database systems with modern cloud-native technologies. It simplifies the deployment and management of Oracle Databases, paving the way for more agile and efficient operations. As the Kubernetes ecosystem continues to expand, tools like OraOperator will undoubtedly play a crucial role in bridging the gap between databases and Kubernetes, fostering a more seamless and productive environment for all stakeholders involved.

How organizations can boost their Cloud Native Adoption: The CNCF Maturity Model

Introduction Cloud Native has become important for building scalable and resilient applications in today's IT landscape. As organization...