stackconf 2024 | Orchestrating Resilient Data: Harnessing the Strength of Kubernetes with Operators by Gregor Bauer

NETWAYS 45 views 24 slides Jul 08, 2024
Slide 1
Slide 1 of 24
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24

About This Presentation

Embark on a journey into the heart of Kubernetes orchestration as we explore the seamless integration of Couchbase, a leading NoSQL database, through its dedicated Kubernetes Operator. Discover how this powerful combination streamlines the deployment, scaling, and management of your Couchbase cluste...


Slide Content

Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
Orchestrating Resilient Data:
Harnessing the Strength of Kubernetes with
Couchbase Operator
Gregor Bauer
Manager Solutions Engineering CEUR
19th June 2024

2
Agenda
Kubernetes Challenges
Kubernetes Architecture
Couchbase Introduction
Couchbase Operator

3
Kubernetes Challenges

What’s driving Cloud-Native Architecture
adoption
(ICON)
Containers
Improve efficiency,
Speed and Resource
utilization by optimizing
use of hardware
(ICON)
Microservices
Shorten software
development cycle with
collection of small
independent services
Shipping small batches of
software to production
constantly, through
automation
Continuous Delivery Devops
Collaboration
between developers
and IT operations to deliver
high-quality software

Challenge 1: Eliminate database siloes
●Stateless microservices are deployed as
containers and orchestrated with
Kubernetes
●Managing state in a distributed application
is hard. When you throw multiple layers of
abstraction and elastic scaling into the mix,
it gets even harder.
●Kubernetes is great at managing compute
and memory resources but storage was not
something managed by Kubernetes directly.
●The typical pattern was to host your
database elsewhere.
Kubernetes

Challenge 2: Avoid cloud vendor lock-in
●Switching between cloud providers is
a major challenge because there is no
industry standardization.
●Increased data management
complexity and overhead become
even more complicated when data
sets are deployed across hybrid or
multiple cloud providers:
○Deployment over multiple clouds
○Upgrade multiple clusters
○Synchronization of data

Challenge 3: Lower operational costs
●A typical day in the life of an operations/DevOps engineer involves provisioning, scaling,
configuring, and upgrading 100's of distributed database systems.

8
Kubernetes Architecture

Confidential and Proprietary. Do not distribute without
Couchbase consent. © Couchbase 2021. All rights reserved. 9
Scaling out
Node failure
●Kubernetes works great to take much of the manual work out of maintaining
the runtime for stateless applications.
●If you have a database application running on several nodes and nodes go
down, you’ll need to reload the databasefrom a specific snapshot following
specific steps. Or think of scaling nodesup, or upgradingto a new version,
or disaster recoveryfor our stateful application.
●Using existing object types and controllers in Kubernetes, this would be
impossible to achieve. These kinds of operations often need very specific
steps, and typically require manual intervention.
Why extending
Kubernetes for
Stateful
Applications
Kubernetes needs to be extended to handle databases
Upgrade
version
Some of the operations needed to manage stateful applications
Scaling up
Database Cluster
New bucket
b1b2
v1
v2
New app node

Confidential and Proprietary. Do not distribute without
Couchbase consent. © Couchbase 2021. All rights reserved. 10
Kubernetes
Extensions
Extensions allows third parties to contribute to Kubernetes
1
2

Confidential and Proprietary. Do not distribute without
Couchbase consent. © Couchbase 2021. All rights reserved. 11
●A Custom Resource(CR) is an
object that extends the Kubernetes
API or allows you to introduce your
own API into a project or a cluster.
●A Custom Resource Definition
(CRD) file defines your own object
kinds and lets the API Server handle
the entire lifecycle.
●CRD is in JSON or YAML format.
●Custom Resources can appear and
disappear in a running cluster through
dynamic registration.
●Once a custom resource is installed,
users can create and accessits
objects using kubectl, just as they do
for built-in resources like Pods.
Custom Resources
Custom Resources extends the Kubernetes API
apiVersion: couchbase.com/v2
kind: CouchbaseCluster
metadata:
name: cb-example
spec:
image: couchbase/server:6.6.0
security:
adminSecret: cb-example-auth
networking:
exposeAdminConsole: true
adminConsoleServices:
-data
buckets:
managed: true
servers:
-size: 3
name: all_services
services:
-data
-index
-query
-search
-eventing
-analytics
Ex of CouchbaseCluster CRD

Confidential and Proprietary. Do not distribute without
Couchbase consent. © Couchbase 2021. All rights reserved. 12
●Operatorswatch your application and perform custom tasks based on its state.
○Operators are clients of the Kubernetes API that act as Custom Controllers
○The application you want to watch is defined as a Custom Resource
○Custom Controller monitor Custom Resource (CR) and reconciles against the
Custom Resource Definition
●The operator pattern was adopted by Couchbaseto make Kubernetes aware
of how to operate Couchbase with our best practices
Operator pattern
The Operator pattern aims to capture knowledge of a human operator
kubectl
Control Plane
API Server
Custom
Controller
Operator
Custom Resource
Definition
Kubernetes Cluster
Node 1
Node 2
Node 3
Custom
Resource
Custom
Resource
Custom
Resource

13
Couchbase Introduction

Couchbase: The Database for AI-powered
Applications
A distributed, multi-model, ACID SQL++ database-as-a-service for global applications
Started 2011
More than 30% of
Fortune 100
CA (HQ), N. America,
EMEA & Asia
~800 Employees NASDAQ: BASE
AWS, GCP, Azure,
Infosys, Red Hat
Founded Offices
Customers
Team Public Partners
that need high-performance storage, clustering, replication andsynchronization
of application data from the cloud, through the edge, to offline-first mobiledevices.

Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2021. All rights reserved.
Proven, Mission Critical Applications by Industry Leaders
Retail & E-
Commerce
Travel &
Hospitality Telecom Gaming
Financial
Services Healthcare
Media &
Entertainment Industrial IoT
3 of the Top 10
eCommerce
Companies
6 of the Top 10
Broadcast Companies
3 of the Top 3
GDS
Companies
6 of the Top 10
Online Casino
Gaming Companies
3 of the Top 3
Credit Reporting
Companies
3 Fortune 500
Healthcare
Companies
2 of the Top 2
IoT
Platforms

Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved. 16
Modern Data Technologies for Real-Time
Adaptive Apps
Artificial Intelligence LLM APIs & HOSTING
Cloud
Providers
OBJECT STORES, LOGS,
API, APPS
WEB, MOBILE, IoT
CLIENTS
DATA SOURCES
OLAP
LAKE HOUSE
Real-time Adaptive Applications (web/mobile)
operational, analytical, generative and predictive
EMBEDDING
MODELS
Proprietary
APIs
Opinionated
Clouds
Open APIs
DASHBOARDS,
VISUALIZATIONS
BI APPS
JSON
Docs
JSON
SQL query with
AI assist
Eventing
& Streaming
Mobile
Database
Time
Series
Mobile/Edge AppsApplication Microservices and SDKs
Real-time
Analytics
Key-Value
Access
K ey
JSON iQ
Full-Text
& Vector Search
Integrated
Cache
ACID
Transactions
JSON
JSON JSON
Workload
Tuning (MDS)
Geo-Replication
& Sync
Active-Active
Clustering
Columnar
Storage
Magma
Storage
Cluster
Map
Customer-Managed
Enterprise-grade Security
Public Cloud On PremCloud EdgePublic Cloud IoT edge, devices
Couchbase Managed
Graph
Traversal

17
Couchbase Operator

Couchbase Cloud Native Architecture

Couchbase Autonomous Operator
Architecture
POD 11
Kubernetes Cluster
API Server Scheduler
Controller
Manager Etcd
DNS
Couchbase Admission Controller
Mutating Configuration Validating Configuration
Couchbase Autonomous Operator
Control Plane
Services Config Maps
Resources
Persistent
Volume Claim
Bucket
Resources
Backup
Resources
User
Resources
Replication
Resources
PERSISTENT STORAGEPERSISTENT STORAGE
PV01 PV02 PV03 PV06 PV07
POD 1 POD 2 POD 3 POD 4 POD 5 POD 6 POD 7 POD 8 POD 9
DATA SERVICE QUERY SERVICE
PERSISTENT STORAGE
PV08 PV09
SEARCH SERVICE
PERSISTENT STORAGE
PV04 PV05
INDEX SERVICE
POD 10
Pods
EVENTING SERVICE
Controller
Webhook
Cluster
Resources
Secret
namespace –kube-system
Couchbase Cluster
PERSISTENT STORAGE
–BACKUP
PVPV
PV
namespace –monitoring
Prometheus
Alert Manager
Grafana
namespace –user-defined

Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2021. All rights reserved. 20
Couchbase Operator
Capabilities
Automated cluster configuration and provisioning
Clusterlife-
cycle
Auto-scaling of Couchbase services
Automated cluster upgrade
Auto-recovery of Couchbase services
Cluster hibernation
Certified persistent volumes
Cluster
configuration
Automated Couchbase server groups
Automated cross data center replication (XDCR)
TLS and certificate rotation
User and group management
Automated Backup and Restore Management
Centralized logging with FluentBit
Centralized Monitoring using Prometheus & Grafana

Deploying Couchbase Autonomous
Operator on Kubernetes
●The Site Reliability Engineer first needs to:
○Deploythe operator
○Create or update a Couchbase Cluster
configuration
●The Operator reacts to creation events by
provisioningnew resources and initializing
the Couchbase cluster.
●During the lifetime of the Couchbase cluster
the Operator continually:
○Comparesthe state of Kubernetes
resources with what is requested in the
CouchbaseCluster resource
○Reconcilesas necessary to make reality
match what was requested.
Couchbase
Autonomous
Operator
Config
YAML
Config
YAML
Config
YAML
Couchbase Cluster
configuration
Couchbase
Cluster 1
Kubernetes Cluster
Couchbase
Cluster 2
Couchbase
Cluster 3
Deploy Create & Update
Observe, Analyze, Act

Benefits
•Avoid database silos
•Deploy, run, and manage the
Couchbase database next to
microservices applications on the
same Kubernetes platform.
•Cloud-agnostic application
deployment platform that enables
to migrate freely between clouds.
•Allows users to easily manage
growth with on-demand scaling.
Autonomously run
stateful applications
Hybrid Cloud and Multi-
Cloud Strategy
•Reduces DevOps workloads by
running Couchbase as an
autonomous, fully managed
stateful database application
•Reduces operational complexity
up to 95%
Automated operational
best practices

23
Couchbase Operator Download
●https://www.couchbase.com/downloads
●https://artifacthub.io/packages/helm/couchbase/couchbase-operator
●https://hub.docker.com/r/couchbase/operator/
Couchbase Operator Documentation
●https://www.couchbase.com/products/operator/
●https://docs.couchbase.com/operator/current/overview.html
Resources

Thank you!
m: [email protected]
p: +4917661944830
li: in/gregor-bauer