Kubernetes Operators
Druperator - Drupal Operator
Adheip Singh | Senior DevOps | Srijan
#SrijanWW | @srijan
⏩ Hybrid Cloud
⏩ API Economy
⏩ Cloud Native
⏩ Big Data
⏩ DevOps
SRIJAN is a full stack, full lifecycle digital engineering
firm.
We specialize in platform & product innovation, utilizing
the best in class polyglot tech stack, open source
frameworks & (almost any) cloud infrastructure.
Our customers say we run software delivery like a
hospitality business.
● Product Engineering
● Enterprise Content
Management
● Learning Ecosystems
● Omnichannel Media
● Analytics
● Machine Learning
● Data Engineering
● Intelligent Automation
➔ 16+ years of profitable growth
➔ 10+ multi-year enterprise customers
➔ 15+ global offices across 10 countries in 4 continents
➔ 350+ employees and growing, across 3 service lines
Digital Experience Platform Modernization Data Intelligence
#SrijanWW | @srijan
This session is relevant for you if
you are:
● An IT / Business stakeholder responsible
for the development and operations of Drupal
project on k8s.
● An infrastructure or cloud engineer curious
to gain a worldview around running
Kubernetes
● A developer / application engineer who
wants to run application workloads
seamlessly on k8s.
● A Drupal Company / Managed Services Org
that builds (OR) maintains a number of Drupal
sites.
About this session
What you will learn during this session:
● Gotchas around “running” Kubernetes
Operators
● Def:
○ “Platform”
○ “Cloud Native”
● LAMP stack Gotchas
○ On Docker Containers
○ Kubernetes (a full refresher)
● How to build and run your own
#SrijanWW | @srijan
● Formerly a Content Management System with D8 -
Evolved to a Symfony-esque Content Management
Framework
● Amongst the most popular OSS projects in the world:
Active community of 100K+ contributors with a plugin
ecosystem of 40K+
● Powers a whole range of web applications in diverse
domains: Gov, Media/Entertainment, Education,
Publishing, Nonprofits Consumer Internet unto high
tech
● Mature ecosystem of service providers:
Single-person studios to SIs with whole units focussed
on Drupal development
A quick recap on Drupal
#SrijanWW | @srijan
● Docker: de-facto standard for containers. Tiny
footprint vis-a-vis conventional VMs. Shared
kernel and separated user space
● Kubernetes: de-facto standard for container
orchestration (born at Google)
● Containers needs management plus distributed
systems is a problem
● Kubernetes helps to manage lifecycle of
containers, distribution, scheduling, command &
control, etc
● Together: de-facto standard for cloud
abstraction. Ability to run on any cloud without
binding to IaaS primitives
Introduction To Kubernetes
#SrijanWW | @srijan
KUBERNETES ARCHITECTURE
#SrijanWW | @srijan
● Operators are softwares written to encapsulate all of those operational considerations for a
specific Kubernetes application.
● Operators ensure that all aspects of an application lifecycle starting from configuration and
deployment to upgrades, monitoring, and failure-handling, are integrated right into the
Kubernetes framework and invoked when needed.
● Capability levels of an Operator :--
○ An operator ensures Basic Install of an Application in an automated way which is
usually a single spec file.
○ Operator offers seamless upgrades.
○ Full Application Lifecycle.
○ Auto Pilot Mode. Deploy and sit back.
Kubernetes Operators
#SrijanWW | @srijan
Let’s Extend the Kubernetes Control Plane
#SrijanWW | @srijan
● Kubernetes provides various ways to extend its control
plane :--
○ Custom API Server
○ Custom Resource Definitions CRD’s.
○ Custom Schedulers
○ Webhooks ( Admission Control Plugins )
○ Kubernetes 1.11 provides a way of adding custom
cloud controller manager process to integrate with
the Cloud.
○ Kublet Plugins
How to extend Kubernetes Plane
#SrijanWW | @srijan
● CRD’s are available in every kubernetes cluster since version 1.7.
● Custom Resources are stored in the same etcd as the main K8s resources.
● The kubernetes API creates a new REST path for the CR.
● CRD’s have a scope, they can be namespaced or cluster scoped.
● Validation of a CRD takes place through OpenAPI Scheme. Current version is v3.
● Each Custom Resource has a
○ Group -- srijan.net
○ Version -- v1 alpha1
○ Kind. -- druperator
Custom Resource Definition
#SrijanWW | @srijan
Custom Controllers or Operators ?
#SrijanWW | @srijan
● In order to write operators SDK’s are available for scaffolding and helping you focus
primarily on the reconcile loop.
● Provides high level API’s, Useful abstractions and project scaffolding
● Extensions to cover common operator use cases.
● Some popular SDK’s widely used are :-
1. Operator-SDK
2. Kube-Builder
3. MetaController
Getting Started With Operators Using
SDK’s
#SrijanWW | @srijan
SDK or No SDK
#SrijanWW | @srijan
● Though SDK’s can help you get started quickly but due to high level abstractions,
boilerplate code which can be cause for multiple bugs and low level production grade code.
● In order to write controllers from scratch one must have understanding of client libraries
and kubernetes controllers as in whole.
● Tools like code-gen can be useful and timesaving in generating Listeners, Watchers and
writing DeepCopy Functions.
● Client Libraries are available in :--
○ Golang
○ Java
○ Python
○ Rust
Writing Operators From Scratch
#SrijanWW | @srijan
Custom Controller Architecture
#SrijanWW | @srijan
● At Srijan we are building a Drupal Operator (Druperartor), which is an operator for
managing drupal application lifecycle on kubernetes.
● Currently the operator is in pre-alpha stages of development.
● Druperator is a custom controller for watching druperator resources as defined with a
Custom Resource Definition(CRD).
● Druperator code will be open sourced once development proceeds to beta stage.
Druperator - Drupal Operator For
Kubernetes
#SrijanWW | @srijan
Demo

[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S Operator

  • 1.
    Kubernetes Operators Druperator -Drupal Operator Adheip Singh | Senior DevOps | Srijan #SrijanWW | @srijan
  • 2.
    ⏩ Hybrid Cloud ⏩API Economy ⏩ Cloud Native ⏩ Big Data ⏩ DevOps SRIJAN is a full stack, full lifecycle digital engineering firm. We specialize in platform & product innovation, utilizing the best in class polyglot tech stack, open source frameworks & (almost any) cloud infrastructure. Our customers say we run software delivery like a hospitality business. ● Product Engineering ● Enterprise Content Management ● Learning Ecosystems ● Omnichannel Media ● Analytics ● Machine Learning ● Data Engineering ● Intelligent Automation ➔ 16+ years of profitable growth ➔ 10+ multi-year enterprise customers ➔ 15+ global offices across 10 countries in 4 continents ➔ 350+ employees and growing, across 3 service lines Digital Experience Platform Modernization Data Intelligence
  • 3.
    #SrijanWW | @srijan Thissession is relevant for you if you are: ● An IT / Business stakeholder responsible for the development and operations of Drupal project on k8s. ● An infrastructure or cloud engineer curious to gain a worldview around running Kubernetes ● A developer / application engineer who wants to run application workloads seamlessly on k8s. ● A Drupal Company / Managed Services Org that builds (OR) maintains a number of Drupal sites. About this session What you will learn during this session: ● Gotchas around “running” Kubernetes Operators ● Def: ○ “Platform” ○ “Cloud Native” ● LAMP stack Gotchas ○ On Docker Containers ○ Kubernetes (a full refresher) ● How to build and run your own
  • 4.
    #SrijanWW | @srijan ●Formerly a Content Management System with D8 - Evolved to a Symfony-esque Content Management Framework ● Amongst the most popular OSS projects in the world: Active community of 100K+ contributors with a plugin ecosystem of 40K+ ● Powers a whole range of web applications in diverse domains: Gov, Media/Entertainment, Education, Publishing, Nonprofits Consumer Internet unto high tech ● Mature ecosystem of service providers: Single-person studios to SIs with whole units focussed on Drupal development A quick recap on Drupal
  • 5.
    #SrijanWW | @srijan ●Docker: de-facto standard for containers. Tiny footprint vis-a-vis conventional VMs. Shared kernel and separated user space ● Kubernetes: de-facto standard for container orchestration (born at Google) ● Containers needs management plus distributed systems is a problem ● Kubernetes helps to manage lifecycle of containers, distribution, scheduling, command & control, etc ● Together: de-facto standard for cloud abstraction. Ability to run on any cloud without binding to IaaS primitives Introduction To Kubernetes
  • 6.
  • 7.
    #SrijanWW | @srijan ●Operators are softwares written to encapsulate all of those operational considerations for a specific Kubernetes application. ● Operators ensure that all aspects of an application lifecycle starting from configuration and deployment to upgrades, monitoring, and failure-handling, are integrated right into the Kubernetes framework and invoked when needed. ● Capability levels of an Operator :-- ○ An operator ensures Basic Install of an Application in an automated way which is usually a single spec file. ○ Operator offers seamless upgrades. ○ Full Application Lifecycle. ○ Auto Pilot Mode. Deploy and sit back. Kubernetes Operators
  • 8.
    #SrijanWW | @srijan Let’sExtend the Kubernetes Control Plane
  • 9.
    #SrijanWW | @srijan ●Kubernetes provides various ways to extend its control plane :-- ○ Custom API Server ○ Custom Resource Definitions CRD’s. ○ Custom Schedulers ○ Webhooks ( Admission Control Plugins ) ○ Kubernetes 1.11 provides a way of adding custom cloud controller manager process to integrate with the Cloud. ○ Kublet Plugins How to extend Kubernetes Plane
  • 10.
    #SrijanWW | @srijan ●CRD’s are available in every kubernetes cluster since version 1.7. ● Custom Resources are stored in the same etcd as the main K8s resources. ● The kubernetes API creates a new REST path for the CR. ● CRD’s have a scope, they can be namespaced or cluster scoped. ● Validation of a CRD takes place through OpenAPI Scheme. Current version is v3. ● Each Custom Resource has a ○ Group -- srijan.net ○ Version -- v1 alpha1 ○ Kind. -- druperator Custom Resource Definition
  • 11.
    #SrijanWW | @srijan CustomControllers or Operators ?
  • 12.
    #SrijanWW | @srijan ●In order to write operators SDK’s are available for scaffolding and helping you focus primarily on the reconcile loop. ● Provides high level API’s, Useful abstractions and project scaffolding ● Extensions to cover common operator use cases. ● Some popular SDK’s widely used are :- 1. Operator-SDK 2. Kube-Builder 3. MetaController Getting Started With Operators Using SDK’s
  • 13.
  • 14.
    #SrijanWW | @srijan ●Though SDK’s can help you get started quickly but due to high level abstractions, boilerplate code which can be cause for multiple bugs and low level production grade code. ● In order to write controllers from scratch one must have understanding of client libraries and kubernetes controllers as in whole. ● Tools like code-gen can be useful and timesaving in generating Listeners, Watchers and writing DeepCopy Functions. ● Client Libraries are available in :-- ○ Golang ○ Java ○ Python ○ Rust Writing Operators From Scratch
  • 15.
    #SrijanWW | @srijan CustomController Architecture
  • 16.
    #SrijanWW | @srijan ●At Srijan we are building a Drupal Operator (Druperartor), which is an operator for managing drupal application lifecycle on kubernetes. ● Currently the operator is in pre-alpha stages of development. ● Druperator is a custom controller for watching druperator resources as defined with a Custom Resource Definition(CRD). ● Druperator code will be open sourced once development proceeds to beta stage. Druperator - Drupal Operator For Kubernetes
  • 17.