Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Clusternaut:
Orchestrating Percona XtraDB Cluster
with Kubernetes.
Raghavendra Prabhu
FOSDEM ’16
rprabhu@yelp.com/me@rdpra...
Yelp’s Mission:
Connecting people with great
local businesses.
Yelp Stats:
As of Q3 2015
89M 3271%90M
Me
Raghavendra Prabhu
Software Engineer, Distributed Systems @ Yelp
rprabhu@yelp.com / me@rdprabhu.com
Galera - “The Oar boat”
κυβερνήτης “The Helmsman”
DCOS
➔ Mesosphere
➔ Paasta
➔ GCE
◆ Reference
➔ ECS
➔ Smartcloud
➔ Tectonic*
Rationale
➔ Nodes v/s Hosts
➔ Reusable components
◆ Monitoring
◆ DNS
◆ Logging
◆ Metrics
◆ Scheduler
➔ Agnostic
➔ Roles
The Fit
➔ Layered
◆ Client - Server
◆ Multi-layered
➔ Scaling
◆ Horizontal and Vertical
● Preferred?
➔ Statelessness in da...
Declarative vs Imperative
➔ Configurable mgmt
◆ Puppet, Nix, Terraform
➔ Microservices
◆ What runs on my laptop
● What run...
Containers
● Wth is a container and why should I care
○ Operating system virtualization
● Isolation
○ Hierarchies of isola...
Galera - really short intro!
➔ MySQL and WSREP api
➔ Galera plugin
➔ Group communication
➔ Synchronous replication
◆ ‘Virt...
Galera - really short intro!
➔ CAP theorem and Galera
◆ CP
➔ How does it fit
◆ Others
◆ Idempotency
➔ Stateless?
◆ Symmetr...
Orchestration
● SOA def
○ ‘Stitching’
○ ‘Composing’
● Automation?
● Choreography
● Best of both worlds
Kubernetes
➔ Constituents:
◆ Kubelet
◆ Pods
● Main service & helpers
◆ Services
● The gcomm:// URL.
◆ Replication Controll...
Kubernetes
➔ Others:
◆ Mesos
● Aurora, Chronos, Marathon
◆ Docker Swarm
◆ Fleet
➔ Key Differences
Pods
Pods
● Herd..
● What should they contain - containers!
● How is the grouping done
● Pods and nodes
○ Colocation
● Pod comm...
Services
Services
● Don’t commingle with `microservices`
● Think of endpoints.
● Layering architecture
○ Logical address of subset ...
Replication Controller
● “Herd Management”
● ASG
● Pod template
○ Pattern
○ Anti-pattern
● Role
○ Init for cluster
○ Rolli...
Networking
● Docker-style linking
● Proxy for Pods
● Types
○ Pod to Pod
○ Pod to Service
○ Intra-Pod
○ External to Service...
External components
● Flannel / Others
● Etcd
● Fluentd
● Skydns
● Container Registry
● Scheduler
● REST server
● Proxy
● ...
PAAS: PaaSTA
● Docker
● Mesos
○ Chronos
○ Marathon
● Sensu
● Smartstack
○ Zookeeper
● Jenkins
● Splunk / Signalfx
● Why
Deployment
● Declare and build individual Galera/PXC nodes.
○ Keep it minimal and simple
○ No assumptions
● Without Kubern...
Deployment
● Basic Steps:
○ Create a ‘flat’ network - 10.0.0.0/24
○ Create a ‘cluster’ - zone
○ Create a service endpoint....
Deployment
● Next:
○ Bootstrap a node Pod from a template.
■ Query existing with selector.
○ Start rest of nodes from temp...
Deployment - Implications
● Load balancing in state transfers
● Respawning of nodes on timeout
○ May not be same nodes.
● ...
Service Definition
Dockerfile
```
... | kubectl create -f -
kubectl expose service eclient --
port=3306 --target-port=3306 --
name=loadbl --type='LoadBa...
```
.. | kubectl create -f -
kubectl scale --replicas=8
replicationcontrollers
controller
```
```
kubectl get --no-headers...
Credits!
● https://www.pinterest.com/duanejohnson851/star-trek-tng/
● https://upload.wikimedia.org/wikipedia/commons/a/a5/...
Further reading!
● http://kubernetes.io
● https://open.mesosphere.com/frameworks/
● https://coreos.com/kubernetes/docs/lat...
Contact
Raghavendra Prabhu
rprabhu@yelp.com / me@rdprabhu.com
Twitter: @randomsurfer
Linkedin: rdprabhu
Github: ronin13
ht...
@YelpEngineering
YelpEngineers
engineeringblog.yelp.com
github.com/yelp
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
Upcoming SlideShare
Loading in …5
×

Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.

528 views

Published on

The talk presented at MySQL & Friends devroom at FOSDEM 2016 in Brussels: https://fosdem.org/2016/schedule/event/clusternaut/

Devroom: https://fosdem.org/2016/schedule/track/mysql_and_friends/

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.

  1. 1. Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes. Raghavendra Prabhu FOSDEM ’16 rprabhu@yelp.com/me@rdprabhu.com/@randomsurfer
  2. 2. Yelp’s Mission: Connecting people with great local businesses.
  3. 3. Yelp Stats: As of Q3 2015 89M 3271%90M
  4. 4. Me Raghavendra Prabhu Software Engineer, Distributed Systems @ Yelp rprabhu@yelp.com / me@rdprabhu.com
  5. 5. Galera - “The Oar boat”
  6. 6. κυβερνήτης “The Helmsman”
  7. 7. DCOS ➔ Mesosphere ➔ Paasta ➔ GCE ◆ Reference ➔ ECS ➔ Smartcloud ➔ Tectonic*
  8. 8. Rationale ➔ Nodes v/s Hosts ➔ Reusable components ◆ Monitoring ◆ DNS ◆ Logging ◆ Metrics ◆ Scheduler ➔ Agnostic ➔ Roles
  9. 9. The Fit ➔ Layered ◆ Client - Server ◆ Multi-layered ➔ Scaling ◆ Horizontal and Vertical ● Preferred? ➔ Statelessness in databases ◆ Planes of logic: Control/Data ➔ Elasticity ◆ Elastic Scalability
  10. 10. Declarative vs Imperative ➔ Configurable mgmt ◆ Puppet, Nix, Terraform ➔ Microservices ◆ What runs on my laptop ● What runs on server ● Reproducibility ➔ 12-factor app ➔ Composability ➔ Immutable deployment artifact
  11. 11. Containers ● Wth is a container and why should I care ○ Operating system virtualization ● Isolation ○ Hierarchies of isolation - application, cgroups, namespaces, seccomp… ● Unikernels and VMs ○ Role? ● Some - LXC, Docker*, Rocket*, runc, jails, solaris zones, lmcty, systemd-nspawn
  12. 12. Galera - really short intro! ➔ MySQL and WSREP api ➔ Galera plugin ➔ Group communication ➔ Synchronous replication ◆ ‘Virtually’ ➔ EVS ➔ Certification-based ◆ Optimistic Concurrency ➔ Automatic Node Provisioning
  13. 13. Galera - really short intro! ➔ CAP theorem and Galera ◆ CP ➔ How does it fit ◆ Others ◆ Idempotency ➔ Stateless? ◆ Symmetric ◆ Replicas - Cassandra et.al. ◆ MySQL Cluster ➔ Maintenance of Quorum
  14. 14. Orchestration ● SOA def ○ ‘Stitching’ ○ ‘Composing’ ● Automation? ● Choreography ● Best of both worlds
  15. 15. Kubernetes ➔ Constituents: ◆ Kubelet ◆ Pods ● Main service & helpers ◆ Services ● The gcomm:// URL. ◆ Replication Controller ◆ Labels and Selectors ● MCollective
  16. 16. Kubernetes ➔ Others: ◆ Mesos ● Aurora, Chronos, Marathon ◆ Docker Swarm ◆ Fleet ➔ Key Differences
  17. 17. Pods
  18. 18. Pods ● Herd.. ● What should they contain - containers! ● How is the grouping done ● Pods and nodes ○ Colocation ● Pod communication ● Labels
  19. 19. Services
  20. 20. Services ● Don’t commingle with `microservices` ● Think of endpoints. ● Layering architecture ○ Logical address of subset of pods ● Communication ○ Environment ■ Ordering requirement ■ Discovery ○ DNS ■ Issues with DNS
  21. 21. Replication Controller ● “Herd Management” ● ASG ● Pod template ○ Pattern ○ Anti-pattern ● Role ○ Init for cluster ○ Rolling updates ○ Multi-version
  22. 22. Networking ● Docker-style linking ● Proxy for Pods ● Types ○ Pod to Pod ○ Pod to Service ○ Intra-Pod ○ External to Service ● Providers: ○ OpenVSwitch / Flannel / Calico / Weave / Google
  23. 23. External components ● Flannel / Others ● Etcd ● Fluentd ● Skydns ● Container Registry ● Scheduler ● REST server ● Proxy ● cAdvisor
  24. 24. PAAS: PaaSTA ● Docker ● Mesos ○ Chronos ○ Marathon ● Sensu ● Smartstack ○ Zookeeper ● Jenkins ● Splunk / Signalfx ● Why
  25. 25. Deployment ● Declare and build individual Galera/PXC nodes. ○ Keep it minimal and simple ○ No assumptions ● Without Kubernetes ○ Docker-compose ■ Possible issues ● Galera node ⇔ Pod ○ Haproxy ○ xinetd
  26. 26. Deployment ● Basic Steps: ○ Create a ‘flat’ network - 10.0.0.0/24 ○ Create a ‘cluster’ - zone ○ Create a service endpoint. ■ Internal service - 3306/4567/4568. ■ External service - 3306/3306(?). ■ Expose the external. ■ Session affinities.
  27. 27. Deployment ● Next: ○ Bootstrap a node Pod from a template. ■ Query existing with selector. ○ Start rest of nodes from template. ■ Point to Service with selector. ■ Replication controller ○ Volumes
  28. 28. Deployment - Implications ● Load balancing in state transfers ● Respawning of nodes on timeout ○ May not be same nodes. ● kubectl to manage ● Separation of client and cluster traffic
  29. 29. Service Definition
  30. 30. Dockerfile
  31. 31. ``` ... | kubectl create -f - kubectl expose service eclient -- port=3306 --target-port=3306 -- name=loadbl --type='LoadBalancer’ ```
  32. 32. ``` .. | kubectl create -f - kubectl scale --replicas=8 replicationcontrollers controller ``` ``` kubectl get --no-headers pods -l 'name=pxc' | wc -l 2 kubectl stop … kubectl get --no-headers pods -l 'name=pxc' | wc -l 2 ```
  33. 33. Credits! ● https://www.pinterest.com/duanejohnson851/star-trek-tng/ ● https://upload.wikimedia.org/wikipedia/commons/a/a5/CubeSpace.jpg ● https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/IUB_Arboretum_-_lotus_pond_- _dry_seed_pod_-_P1100172.JPG/1280px-IUB_Arboretum_-_lotus_pond_-_dry_seed_pod_-_P1100172.JPG ● https://raw.githubusercontent.com/kubernetes/kubernetes/master/docs/design/architecture.png ● https://pbs.twimg.com/profile_images/511909265720614913/21_d3cvM.png ● https://camo.githubusercontent. com/96468330aba188dbd7d7eeae0caca32d9a6329df/687474703a2f2f656e67696e656572696e67626c6f67 2e79656c702e636f6d2f696d616765732f70726576696577732f7061617374615f707265766965772e706e67 ● http://galeracluster.com/documentation-webpages/_images/replicationapi.png
  34. 34. Further reading! ● http://kubernetes.io ● https://open.mesosphere.com/frameworks/ ● https://coreos.com/kubernetes/docs/latest/kubernetes-networking. html ● http://paasta.readthedocs.org/en/latest/about/paasta_principles.html ● http://12factor.net/ ● http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html
  35. 35. Contact Raghavendra Prabhu rprabhu@yelp.com / me@rdprabhu.com Twitter: @randomsurfer Linkedin: rdprabhu Github: ronin13 http://rdprabhu.com http://about.me/raghavendra.prabhu http://rprabhu.yelp.com
  36. 36. @YelpEngineering YelpEngineers engineeringblog.yelp.com github.com/yelp

×