In this webinar with special guest Fabio Tiriticco, we will explore how Akka is the perfect companion to Kubernetes, providing the application level requirements needed to successfully deploy and manage your cloud-native services with technologies built specifically for cloud-native applications, like Kubernetes.
7. @ticofab
ticofab.ioThe Key to Elasticity is Distribution
Scale UP
Limited by
speed of light
and heat
dissipation
Scale OUT
🌍
8. @ticofab
ticofab.ioThe Key to Distribution is Location Transparency
MESSAGE DRIVEN
=
LOCATION TRANSPARENCY
=
DISTRIBUTION
9. @ticofab
ticofab.ioFault Tolerance vs Resilience
“A fault-tolerant component is hit but keeps going, possibly with reduced functionality”
“Upon failure, a resilient component is able to jump back to a fully functional fresh state”
12. @ticofab
ticofab.ioLocation Transparency in Akka
Actor 1
“John”
“John”
name?
• can only communicate
via async messaging
• unit of computation
Akka’s building
blocks are Actors
name:
Actor 2
• contains logic & state
Actor 1
“John”
“John”
name?
name:
Actor 2
State isolation &
location transparency
Single JVM
JVM 1 JVM 2
14. @ticofab
ticofab.ioResilience in Akka
Supervisor
Actor
Actor
Every actor is created by its supervisor,
to whom failure handling is delegated
• Business logic and failure handling are
clearly decoupled ➝ easier to test
• Flexible ways to react to failure
• Failures don’t cascade to other parts
15. @ticofab
ticofab.ioResilience in Akka
Skynet
actor
T1000
actor
try {
walk();
} catch (OutOfLegsException e) {
}
legsAvailable = false;
pullWithArms();
T800
instance
// in T1000 actor
walk()
// in Skynet supervisor
case h: TooManyHolesException =>
Restart // or another strategy
17. @ticofab
ticofab.io
4 x
What is Kubernetes?
MENU
Auth Service
For those in need of security
Picture Resizer Service
Available in all sizes
Uploader Service
Sharing is caring
Order
1 x
Auth Service
2 x
Uploader Service
Service
orchestration
2 to 8 based on appetite
Picture Resizer Service
18. @ticofab
ticofab.ioLocation Transparency in Kubernetes
VM 1 VM 2
No need to know IP address of VMs
Use pod label or a DNS service
Pod 4
Actor 1
Pod 5
Actor 2
Actor
3
Pod 1
name: A
Pod 2
name: B
Pod 3
name: C
Pod
=
Docker image
=
JVM
26. @ticofab
ticofab.io
Load
balancer
pod
pod
pod
Distributed Workload
Worker 1 (pod)
Master
(pod)
Worker 2 (pod)
Worker N (pod)
Master
(router)
Worker
Worker
DELEGATION OF ELASTICITY
TO INFRASTRUCTURE LEVEL
Worker
Worker
+
Example:
github.com/ticofab/akka-cluster-kubernetes
COLLABORATION BETWEEN
APPLICATION AND
INFRASTRUCTURE LEVEL
Kubernetes API
35. @ticofab
ticofab.ioReasons for Resilience at the Application Level
Restart time
seconds
Actor
milliseconds
If it ain’t broken,
don’t restart it
One does not
simply restart things
pod issue
restart
actor issue
resumerestart
stop
38. @ticofab
ticofab.ioReview of the Akka-Kubernetes Stack
Kubernetes is a great
infrastructure choice for your
clustered application
⚙
It provides location
transparency with
cluster formation
🖇
It introduces resilience at
an infrastructure level
(
Akka has a cloud-native
programming model,
ready to scale from day 1
📬
It enables transparent
communication between
different nodes of a service
📟
Resilience is built in
your service with
granular control
+
41. @ticofab
ticofab.ioReferences
J. Bonér, R. Kuhn, D. Farley, M. Thompson: The Reactive Manifesto
R. Kuhn, B. Hanafee, J. Allen “Reactive Design Patterns”
http://github.com/ticofab/akka-cluster-kubernetes
Tools:
Akka
Docker
Kubernetes
akka.io
docker.com
kubernetes.io
Code example:
Resources: