Share
Embed
Transcript
43 slides
-
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. DATABASES ON KUBERNETES Denis Rosa | Developer Advocate @deniswsrosa @deniswsrosa WHY YOU SHOULD CARE -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. • +15 years as a dev • NoSQL & Java specialist • OSS contributor Denis Rosa deniswsrosa @deniswsrosa [email protected] -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 3 2016 -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa 2016 Containers are designed to be stateless -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa Fast forward to 2020… -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 6 2020 -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa What have changed? -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa • Production-Grade Images • Easier to setup and configure • Separate storage from compute • Kubernetes and StatefulSets … -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 9 Simple MySQL Deployment -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa Databases typically have numerous tuning parameters, a new immutable container image for every possible database configuration can quickly result in image sprawl. -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa Where should I store my database config files? Problem 1: -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. DEMO1 – A K8S TODO LIST -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 13 K8 CRDs -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 14 Let’s go back to the MySQL Deployment -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 MySQL Volume MYSQL DEPLOYMENT -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 MySQL Volume FAILURE SCENARIOS -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 MySQL Volume MySQL Volume FAILURE SCENARIOS -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 MySQL Volume MySQL Volume FAILURE SCENARIOS -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 MySQL Volume K8S Worker2 MySQL Volume FAILURE SCENARIOS -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 MySQL Volume K8S Worker2 MySQL Volume FAILURE SCENARIOS -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 MySQL Volume K8S Worker3 MySQL Volume (empty) FAILURE SCENARIOS ? -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa Looks like something is missing… -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa How to manage state in containers? Problem 2: -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 24 K8 CRDs Events -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 25 CRDs + K8s Operators -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 26 Java Operator - Example Source: https://developers.redhat.com/blog/2019/10/07/write-a-simple-kubernetes-operator-in-java-using-the-fabric8-kubernetes-client/ -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. @deniswsrosa K8S Worker1 Couchbase Volume K8S Worker2 Couchbase Volume OPERATORS + KUBERNETES Operator (stateless) -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 28 Quick Operator Revision Operator Knowledge from app experts Deployments Autoscaling StatefulSets Configs -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 29 K8s Database Operators Provide a cloud agnostic Database-as-a-Service solution -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. DEMO 2 – LET’S PLAY WITH A DATABASE ON KUBERNETES -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 31 Other Possibilities Automated Backup XDCR Prometheus Metrics -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 32 DBaaS vs Databases on K8S • Easy; • Low TCO for small/medium workloads*; • Lacks flexibility*; • Average performance; DBaaS DB on K8S • Still requires some K8s knowledge; • Same flexibility as bare metal; • Operators can automate most of the hard work; • One of the best options for databases with large number of nodes; • Potentially the default option in the near future; -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 33 DBaaS -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 34 Kubernetes Storage https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads Ephemeral Remote Persistent Local Persistent Easiest one, but you lose all data if the pod gets killed. Latency limits the performance of applications with intensive read/write profiles or distributed datastores Not a general-purpose storage solution -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 35 Local Persistent Storage https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 36 Local vs Remote Persistent Storage -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 37 Bare Metal Vs Containers https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads Yahoo! Cloud Serving Benchmark YCSB includes a set of core workloads that define a basic benchmark for cloud systems -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 38 Workload A https://blog.couchbase.com/performance-certification-of-couchbase-server-5-5-on-kubernetes-platform/ Workload A Update heavy workload: Mix of 50/50 reads and writes Workload E Short ranges: Short ranges of records are queried, instead of individual records. ~0% No substantial difference <10% Performance penalty * These test where made ~1/5 years ago, since then, many improvements have been added to docker -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 39 Workload A https://blog.couchbase.com/performance-certification-of-couchbase-server-5-5-on-kubernetes-platform/ -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 40 Workload E https://blog.couchbase.com/performance-certification-of-couchbase-server-5-5-on-kubernetes-platform/ -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 41 Key Takeaways https://blog.couchbase.com/performance-certification-of-couchbase-server-5-5-on-kubernetes-platform/ • DBaaS vs Databases on K8s; • Pick a good operator first before running your database on Kubernetes; • Add extra memory/cpu while running on containers; • Local over Remote persistent storage; -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. 42 Other Operators @deniswsrosa -
Confidential and Proprietary. Do not distribute without Couchbase consent. ©
Couchbase 2017. All rights reserved. THANKS! @DENISWSROSA