201K8s
A little dabble into Kubernetes and Operators
@ravilach
What are we talking about?
@ravilach
● Shift into Containers
● Container Orchestrators
● Rise in Container Orchestrator SDKs
Ravi Lachhman
Technical Evangelist
AppDynamics
@ravilach
The Next Architectural Shift is Already Becoming
Mainstream
@ravilach
The Next Architectural Shift is Already Becoming
Mainstream
@ravilach
Physical (x86) Virtual Cloud-nativeMainframe
Containerization
@ravilach
Containerization
@ravilach
Private Copy
Shared
User Code
Libraries
Virtual Processor
Operating System
Physical Processor
Virtual Machines Containers
User Code
Libraries
Virtual Processor
Operating System
Physical Processor
Start time 30-45 seconds < 50 ms
Stop time 5-10 seconds < 50 ms
Workload density 10 - 100x1x
Welcome (and hail) Docker!
@ravilach
It’s all Rainbows and Unicorns
@ravilach
JAVA 7 vs JAVA 11
@ravilach
Stateful Applications in Docker?! [2014]
@ravilach
OR
Transactions
@ravilach
Multiple Systems
@ravilach
Let’s Decompose and Deploy (Microservices?!)
@ravilach
Container Sprawl is the new VM Sprawl…
@ravilach
Save us Container Orchestrators!
@ravilach
Enter Kubernetes
@ravilach
https://deis.com/blog/2016/kubernetes-illustrated-guide/
History of Kubernetes
@ravilach
June 2014
Kubernetes hits GitHub
Oct 2018
Kubernetes 1.12 Released
Your Orchestrator Journey
In 2.1 or 3 steps!
@ravilach
Step 1. Describe your app in YAML
@ravilach
Stateful Applications in Docker?! [2018]
@ravilach
OR
Docker Ecosystem Today
@ravilach
Product Owner’s Dilemma
@ravilach
https://deis.com/blog/2016/kubernetes-illustrated-guide/
2008 JAVA Web App
@ravilach
2018, Look what DevOps has done!
@ravilach
 More Control ----- Less Control 
@ravilach
Someone call the Operator
@ravilach
A Brief History of the Operator
@ravilach
● Created by CoreOS in late 2016 for
Kubernetes.
● Next rendition is the Operator SDK which
was built in conjunction with Red Hat in the
second half of 2018; this is an pre-alpha
release.
What is an Operator?
@ravilach
What is an Operator?
@ravilach
● Allows programmatic mappings and
packaging of application functionality to
Kubernetes Primitives.
● Moving from describing applications in
K8’s to building applications to K8’s.
Step 2. Familiar with CRDs
@ravilach
● Custom Resource Definition: custom endpoint.
But why CRD?
@ravilach
Step 2.1 (or 3) Add a Controller in the Mix
@ravilach
Ta-Da! You have a workflow?!
@ravilach
Observe
Analyze
Act
Remember Event Listeners?
@ravilach
Don’t worry there is Code Completion :-)
@ravilach
Good Resources
@ravilach
● CoreOS Blog:
● https://coreos.com/blog/introducing-operators.html
● List of Operators
● https://github.com/operator-framework/awesome-
operators
● Building a Controller
https://engineering.bitnami.com/articles/kubewatch-an-
example-of-kubernetes-custom-controller.html
● Controller Parts
● https://medium.com/@cloudark/kubernetes-custom-
controllers-b6c7d0668fdf
We learned a little more about:
@ravilach
● Containerization as Docker as popular format.
● Kubernetes Project
● Rise in Operators / Operator SDK
Go forth and Operate (or Control)!
@ravilach
@ravilach

Caribbean Developers Conference - 201K8s

Editor's Notes

  • #3 Shift into Containers Container Orchestrators Rise in Container Orchestrator SDKs
  • #4 Technical Evangelist at AppDynamics. Prior experience at Mesosphere, Red Hat, and IBM. Specialties include SQL and NoSQL DB corruptions and not being able to do CIDR calculations.
  • #5 The change from machine centric to cloud native Pictures above are from Pong in the 1970s to Far Cry 5 in 2018
  • #6 The change from machine centric to cloud native
  • #8 Base of what a container is vs a VM
  • #9 Docker made it really popular to deploy an application inside a container. History Mesos since 2009, Solaris Zones since 1980s, Linux Containers since 2008, RKT from CoreOS.
  • #10 There are some real limitations in containers…
  • #11 Languages have to keep up also. The ecosystem evolution is occurring,. https://mesosphere.com/blog/java-container/ In JDK 7/8, it gets the core count resources from sysconf. The JVM will now consider cgroups memory limits if the following flags are specified: -XX:+UseCGroupMemoryLimitForHeap -XX:+UnlockExperimentalVMOptions All languages need to catch up
  • #12 Poise the question?? The common conception in 2014 Storage was certainly emphemeral Example of Stateful vs Non Stateful Non Stateful Web Service "What is the weather in XYZ" Stateful Service to "exchange money"
  • #13 When you think of a transaction, usually a financial transaction comes to mind.
  • #14 Transactions are important especially when dealing with multiple systems. More that one system e.g DB, message queue participate.
  • #15 Microservices introduces endpoint hell… Each one of those endpoints can be a service endpoint. Wiring hell! Each of these could be a POD or Container, etc.
  • #16 Need an orchestrator
  • #17 Why Hello Orchestrators Certainly Choice in prospective
  • #18 How do you package your application “Childrens book: The Giraffe was lost and at sea, and worried how to get home" Giraffe – Lost Container Owl -- Kubernetes
  • #19 Four year old project Linage from Google Borg
  • #20 From describe to build to. Can be in 2 or 3 steps depending how you look at the journey.
  • #21 Kubernetes deployment journey – describe. This is how a majority of MVPs get into the K8s ecosystem.
  • #22 A lot has been built in the ecosystem “A lot easier to run a stateful apps in containers”. -More apps and app infrastructure is built to support containerization in the last four years. ”Litmus Test for stateful app” “How distributed is an app?”
  • #23 Operators, Kubernetes, Container Storage Interface, Container Network Interface, Weaveworks, Portworx A lot has been built in the ecosystem Struggling with Networking and Storage stacks with the transitive nature of containers were bothersome Before CSI and CNI.
  • #24 How do you package your application Shipping Multiple WARS https://thenewstack.io/the-rise-of-the-container-orchestrator-sdks/
  • #25 In 2008, can have three WARs with three Web XMLs Only a tiny piece compared to 2018
  • #26 Need to share a litany of formats. You are required to expose a lot more. How can you be precise and repeatable?! Source, Binary, Security, End Distribution, Infrastructure as Code, Containers, Container Orchestrators, Loggers/Tracing, PaaS’s, Public Cloud <-More Control -- Less Control ->
  • #27 <-More Control -- Less Control -> Pivotal Clustering is different than OpenShift clustering
  • #28 Because of going right, you have less control, when you have a distributed application the system to system interactions aka Application infrastructure becomes unreliable and un-recreatable. -Why an Operator Pivotal Clustering is different than OpenShift clustering Building different vs describing different A way of describing, connecting two desperate sources.
  • #30 C example the Ternary Expression has multiple Operands. Greater Than, Less Than, Equal
  • #31 Domain Specific Controller – Single App Focus To paraphrase: All Operators use the controller pattern, but not all controllers are Operators. It's only an Operator if it's got: controller pattern + API extension + single-app focus. https://stackoverflow.com/questions/47848258/kubernetes-controller-vs-kubernetes-operator https://github.com/kubeflow/tf-operator/issues/300
  • #32 A resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind. For example, the built-in podsresource contains a collection of Pod objects. A custom resource is an extension of the Kubernetes API that is not necessarily available on every Kubernetes cluster. In other words, it represents a customization of a particular Kubernetes installation. Custom resources can appear and disappear in a running cluster through dynamic registration, and cluster admins can update custom resources independently of the cluster itself. Once a custom resource is installed, users can create and access its objects with kubectl, just as they do for built-in resources like pods.
  • #33 Use Kube CLI aka KubeCTL https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
  • #34  A Controller is needed to manage resources, in this case a Custom Resource. A Custom Controller needs to watch, react, and update components. Get ready to write some GO! https://resources.coreos.com/youtube-coreos-fest-2017/writing-a-custom-controller-extending-the-functionality-of-your-cluster
  • #35  A Controller is needed to manage resources, in this case a Custom Resource. A Custom Controller needs to watch, react, and update components. Get ready to write some GO! https://resources.coreos.com/youtube-coreos-fest-2017/writing-a-custom-controller-extending-the-functionality-of-your-cluster
  • #36  A Controller is needed to manage resources, in this case a Custom Resource. A Custom Controller needs to watch, react, and update components. Get ready to write some GO! https://resources.coreos.com/youtube-coreos-fest-2017/writing-a-custom-controller-extending-the-functionality-of-your-cluster
  • #37 Operator SDK KubeBuilder https://itnext.io/building-an-operator-for-kubernetes-with-kubebuilder-17cbd3f07761
  • #38 Check them out!
  • #39 Containerization as Docker as popular format. Kubernetes Project Rise in Operators / Operator SDK
  • #40 Thanks so much for your time!