Next Gen Microservices On kubernetes
agenda Who are we? Our unique take on microservices How we leveraged K8S evaluation methods running in production some problems we ran into (to save you some pain)
(or who are we?)
5,000 120 325,000 19,000 192 980,000 4,800+ STORIES A DAY IN MORE THAN COUNTRIES Bloomberg News 325,000 SUBSCRIPTIONS GLOBALLY Bloomberg Professional Service 19,000 EMPLOYEES IN 192 LOCATIONS AROUND THE WORLD 980,000 GLOBAL CIRCULATION IN 150 COUNTRIES Bloomberg Businessweek 4,800+ TECHNOLOGISTS & COMPUTER ENGINEERS Technology @ Bloomberg
Collect real-time financial data from: 370+ exchanges 4,000+ FIX feeds 60 billion ticks 80,000+ news wires from around the world Our subscribers exchange daily: 300 million messages 17 million chats
Now that’s BIG DATA
Our team Mikhail Kartashov Mikolaj Pawlikowski Paul McLoughlin Sachin Kamboj
(This presentation will self-destruct in 32.5 minutes) Our mission build infrastructure that allows non-programmers (and programmers) to deploy code effortlessly (This presentation will self-destruct in 32.5 minutes)
Data Technologies Pipeline (DTP)
microservices do one thing do it well
single-click™ deployment next generation testing in production single-click™ deployment
testing in production All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal. Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists. But however the selection process works, the result is indisputable: 'This time it will surely run,' or 'I just found the last bug'. - Frederick Brooks, Jr. (The Mythical Man Month)
Unit + Integration Testing typical release cycle Development Staging Production Code Deploy Deploy Unit + Integration Testing Testing Testing All tests pass? Working? Working? Oops
typical release cycle Release Cycle Code Deploy Watch-it-break Rollback
why oh God, why? env(development) != env(staging) != env(production) environment env(development) != env(staging) != env(production) data data(development) != data(staging) != data(production)
our new workflow Production Deploy Release 1 Release 1 Code View (In/Out)put NO! Happy? Promote to publish
our new workflow Production Deploy Release 1 Release 1 Release 2 Code View (In/Out)put Release 3 Release 3 NO! Happy? Promote to publish
But when I do I do it in production I don’t always test my code But when I do I do it in production
requirements microservices must be pure no alterations to any external state
single-click deployment Code Push code to github Release Tag a release Configure Set environment variables/secrets Deploy Select active versions/tags Select production version
How we built our platfoRm the nuts and bolts How we built our platfoRm
our shopping list Isolation Orchestration Easy deployment Self-healing Stability Reliability High availability
kubernetes Image credit: https://www.flickr.com/photos/55198508@N00/3772734583/
our shopping list Docker Isolation Kubernetes Orchestration Easy deployments Auto-scaling Self-healing ??? Stability Reliability High-availability
our architecture Load Balancer Datacenter - 1 Master 1 Master 2 Worker 1 Worker 2 Worker 3 Worker 4 Worker 5 Worker 6 Worker 7 Worker 8 Worker 9 Datacenter - 2 Master 1 Master 2 Master 3 Master 4 Master 5 Worker 1 Worker 2 Worker 3 Worker 4 Worker 5 Worker 6 Worker 7 Worker 8 Worker 9
our architecture Master Worker reverse proxy etcd K8s api-server µsvc pod-1 µsvc pod-2 µsvc pod-3 µsvc pod-4 K8s scheduler kube-dns K8s controller manager µsvc pod-5 µsvc pod-6 µsvc pod-7 µsvc pod-8 kubelet kube-proxy K8s api-server proxy kubelet kube-proxy K8s api-server proxy Docker Docker flanneld flanneld
powerful seal Our chaos monkey IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIZIIIIII7IIIIIII$IIIIIIIIIIIIIIIIIIZ?II IIIIIIIIIIIIIIIIIIIIIIIIZIIIIIIIIIIIIZD+~7NIIIIII7IIIIIII$IIIIIII7IIIIIIIIIIZII? IIIIIIIIIIIIIIIIIIIIIIIIZIIIIIIIIIIID::~~,:?8IIII7IIIIIII$IIIIIII7IIIIIIIIIIZIII IIIIIIIIIIIIIIIIIIIIIIIIZIIIIIIIII78~~~D8O~~=DIII7IIIIIII$IIIIIII7IIIIIIIIIIZIII IIIIIIIIIIIIIIIIIIIIIIIIZIIIIZNNOD8:~~~NDD:~~$ZII7IIIIIII$IIIIIII7IIIIIIIIIIZ7II IIIIIIIOD?~$~8$IIIIIIIIIZIIII8~~~~~II~~~~~~~~~NII7IIIIIII$IIIIIII7IIIIIIIIIIZ7II IIIIIIO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$$$$$$$$ZZZZO$$$$$$$Z$$$$$ZZZN=~~~~~~~~~~~~~~~~~~~~D$$NDDD ::::::::::::::::::~~~:::::::::::::::::::::::::::::::::::::::::::::::::~~:::::::: powerful seal Our chaos monkey
lessons learned Or how we learned to stop worrying and love the bomb kubernetes Image credit: https://flic.kr/p/ebfFrK
lessons learned Kubelet (and other k8s components) can’t handle multiple masters https://github.com/kubernetes/kubernetes/issues/18174 https://github.com/kubernetes/kubernetes/issues/19152
lessons learned flanneld won’t handle sigpipe communication between pods can break
lessons learned
lessons learned Security issues: kube-apiserver -> kubelet communication broken https://github.com/kubernetes/kubernetes/issues/11816 https://github.com/kayrus/kubelet-exploit can’t completely disable insecure port on K8S https://github.com/kubernetes/kubernetes/issues/13598 certificate revocations not supported
Questions?