MySQL on Kubernetes with
Percona Kubernetes Operators
Dinh Tuan Phong
Support Engineer @ Percona
Agenda
1. Introduction
2. Cloud-native Applications and Kubernetes
3. Running MySQL on Kubernetes
4. About Percona Kubernetes Operators for MySQL
5. Deploy MySQL with Percona Kubernetes Operators
Introduction
• We build open source database strategies and software to help Customer reduce the
complexity, costs, and effort when managing the database environments.
• Our Products and Solutions
About Percona
Distribu(on for PostgreSQL
• Support Engineer at Percona
• APAC Support Team
• Based in Hanoi, Vietnam
• Worked as Infra engineer and DevOps Engineer before joined Percona
About me
Cloud Native Application and Kubernetes
“ Cloud native is an approach to building and running applications that fully exploit the advantages of
the cloud computing model. When companies build and operate applications using a cloud native
architecture, they bring new ideas to market faster and respond sooner to customer demands”
Source: Pivotal (VmWare)
Cloud native application
“ Cloud native computing uses an open source software stack to be:
• Containerized: Each part (applications, processes, etc.) is packaged it its own container. This
facilitates reproducibility, transparency, and resource isolation.
• Dynamically orchestrated: Containers are actively scheduled and managed to optimize resource
utilization
• Microservices-oriented: Applications are segmented into microservices. This significantly increases
the overall agility and maintainability of applications.
Source: CNCF
Cloud native application
Cloud native application
Microservices Cloud-based
Kubernetes Data store per service
How Kubernetes works
Cloud native application
About Percona Kubernetes Operators for MySQL
MySQL database in the cloud
Two options
DBaaS K8S with application
Cloud-vendor provided
• AWS RDS (Aurora) MySQL
• Google CloudSQL MySQL
• Azure Database for MySQL
• Oracle MySQL Database service
Need to consider the database pods
are transient, so the likelihood of
database restarts or failovers is
higher, DB tasks like backup,
replication are different due to added
abstractions from containerization
MySQL on Kubernetes
• One platform for everything
• No vendor lock-in, portability
• Cost-efficient
• Challenges and problems
• Complexity of Kubernetes
• Stateful set for Primary/Replicas
• DB replication
• High availabity and failover
• Storage (PVC/Hostpath)
• Services: Read/write and Read Only
• Load balancing and Proxy
• Configuration
• Monitoring agents
• Backups
• Updates
• DR
• SSL
• ….
Operators is the key
• Operator is a pod and customer resource
definition
• Reconcile loop checks K8S API for Customer
Resource (CR)
• K8S controller are aware of CR creation or
changes
• Opreator’s code provisions and manages
v K8S privities
v DB and componets configurations
MySQL on Kubernetes
• One platform for everything
• No vendor lock-in, portability
• Cost-efficient
• It is easier with the operators
Kubernetes operators
• MySQL Operator for Kubernetes (Oracle)
• KubeDB
• PressLabs Operator
• Percona Operator for MySQL
Operator maturity model (source Redhat)
Percona Kubernetes Operators
Percona Kubernetes Operators
• 100% open source, compatible with various Kubernetes flavors
• Support MySQL, MongoDB and PostgreSQL
• Support, maintain and develop continuously by Percona
Percona Kubernetes Operators for MySQL based on PXC
• Free and Open Source with easy scaling, smart update and backups with PITR
• Why PXC
v PXC= Galera + MySQL
v Ready-to-use HA solution
v Synchronous replication equals to data consistency
Architecture
How to deploy
Prerequisites
• Kubernetes cluster
• kubectl configured
• Namespace created
Connectivity
How to deploy
How to deploy
High Availability
Scalability
Monitor and alert with PMM in K8S
Percona Monitoring and Management can
be deployed in the same K8S cluster to
help monitor your DBs
Thank you!
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easier with Percona Kubernetes Operators

Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easier with Percona Kubernetes Operators

  • 1.
    MySQL on Kuberneteswith Percona Kubernetes Operators Dinh Tuan Phong Support Engineer @ Percona
  • 2.
    Agenda 1. Introduction 2. Cloud-nativeApplications and Kubernetes 3. Running MySQL on Kubernetes 4. About Percona Kubernetes Operators for MySQL 5. Deploy MySQL with Percona Kubernetes Operators
  • 3.
  • 4.
    • We buildopen source database strategies and software to help Customer reduce the complexity, costs, and effort when managing the database environments. • Our Products and Solutions About Percona Distribu(on for PostgreSQL
  • 5.
    • Support Engineerat Percona • APAC Support Team • Based in Hanoi, Vietnam • Worked as Infra engineer and DevOps Engineer before joined Percona About me
  • 6.
  • 7.
    “ Cloud nativeis an approach to building and running applications that fully exploit the advantages of the cloud computing model. When companies build and operate applications using a cloud native architecture, they bring new ideas to market faster and respond sooner to customer demands” Source: Pivotal (VmWare) Cloud native application
  • 8.
    “ Cloud nativecomputing uses an open source software stack to be: • Containerized: Each part (applications, processes, etc.) is packaged it its own container. This facilitates reproducibility, transparency, and resource isolation. • Dynamically orchestrated: Containers are actively scheduled and managed to optimize resource utilization • Microservices-oriented: Applications are segmented into microservices. This significantly increases the overall agility and maintainability of applications. Source: CNCF Cloud native application
  • 9.
    Cloud native application MicroservicesCloud-based Kubernetes Data store per service
  • 10.
  • 11.
  • 12.
    About Percona KubernetesOperators for MySQL
  • 13.
    MySQL database inthe cloud Two options DBaaS K8S with application Cloud-vendor provided • AWS RDS (Aurora) MySQL • Google CloudSQL MySQL • Azure Database for MySQL • Oracle MySQL Database service Need to consider the database pods are transient, so the likelihood of database restarts or failovers is higher, DB tasks like backup, replication are different due to added abstractions from containerization
  • 14.
    MySQL on Kubernetes •One platform for everything • No vendor lock-in, portability • Cost-efficient • Challenges and problems • Complexity of Kubernetes • Stateful set for Primary/Replicas • DB replication • High availabity and failover • Storage (PVC/Hostpath) • Services: Read/write and Read Only • Load balancing and Proxy • Configuration • Monitoring agents • Backups • Updates • DR • SSL • ….
  • 15.
    Operators is thekey • Operator is a pod and customer resource definition • Reconcile loop checks K8S API for Customer Resource (CR) • K8S controller are aware of CR creation or changes • Opreator’s code provisions and manages v K8S privities v DB and componets configurations
  • 16.
    MySQL on Kubernetes •One platform for everything • No vendor lock-in, portability • Cost-efficient • It is easier with the operators
  • 17.
    Kubernetes operators • MySQLOperator for Kubernetes (Oracle) • KubeDB • PressLabs Operator • Percona Operator for MySQL Operator maturity model (source Redhat)
  • 18.
  • 19.
    Percona Kubernetes Operators •100% open source, compatible with various Kubernetes flavors • Support MySQL, MongoDB and PostgreSQL • Support, maintain and develop continuously by Percona
  • 20.
    Percona Kubernetes Operatorsfor MySQL based on PXC • Free and Open Source with easy scaling, smart update and backups with PITR • Why PXC v PXC= Galera + MySQL v Ready-to-use HA solution v Synchronous replication equals to data consistency
  • 21.
  • 22.
    How to deploy Prerequisites •Kubernetes cluster • kubectl configured • Namespace created
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
    Monitor and alertwith PMM in K8S Percona Monitoring and Management can be deployed in the same K8S cluster to help monitor your DBs
  • 29.