SlideShare a Scribd company logo
Intro to Creating
Kubernetes
Operators
... and what can a framework do for you
About me
● Attila Mészáros (csviri@gmail.com)
● 10+ years Java developer / architect
● Last 3 years more on platform teams
● Currently: Senior Software Engineer @
○ Building multi-cloud platform
○ Golang, K8S, AWS (on-prem, GCP, AZURE)
(Java) + Everything around
● Free Time
○ ❤Rust❤
○ co-creator of Java Operator SDK
Agenda
● Intro to Kubernetes Operators
● Simple Example
● Intro To Java Operator SDK
● Common problems and how we solve them
● Event Sources and the power of operators
Extending K8S API - CRDs
● Define Custom Type in K8S: Custom
Resource Defintion
● Abstraction over a more complex
domain
● Instance of our type we call Custom
Resource
● “kubectl apply” this =>
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: webservers.sample.javaoperatorsdk
spec:
group: sample.javaoperatorsdk
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
html:
type: string
scope: Namespaced
names:
plural: webservers
singular: webserver
kind: WebServer
shortNames:
- ws
Sample Custom Resource
apiVersion: "sample.javaoperatorsdk/v1"
kind: WebServer
metadata:
name: hellows
spec:
html: |
<html>
<head>
<title>Hello Operator World</title>
</head>
<body>
Hello Meetup
</body>
</html>
● simple examples: abstraction over
static website
Kubernetes Operator - Definition
● “Operators are software extensions to Kubernetes that make use of custom resources to
manage applications and their components. Operators follow Kubernetes principles, notably the
control loop.”
● That’s it, K8S does not provide any additional facilities. Only:
○ Extension to API - CRD/CR
○ and the operations we have on K8S Objects: CRUD, Patch, Watch
○ (ok for golang it kinda provides )
What is a control loop?
The Operator Pattern
● At the end it’s a Pod watching
Custom Resources
● and Reconciling the desired state
with the target world
Demo Time - WebServer Example
Managing K8S and non-K8S Resources
● Manage all well known K8S resources (pods, config maps, ingress, service, pv)
○ Create nice abstractions
○ Deploy/Manage Complex Applications (Kafka, Postgres)
○ Flux
● External Resources (or anything that has an API)
○ Git Repositories,
○ Users in external System
○ CockroachDB users
○ AWS Controllers for Kubernetes (ACK)
Framework Support
● Well known frameworks
○ Operator SDK (go, from RedHat)
○ Java Operator SDK
○ Kopf (python)
○ ...
History to Java Operator SDK
● Started on ~ May 2019
● Spinoff from a project on Java based big Enterprise Company
● From ~ 2020 November heavy RedHat involvement
● Now dedicated RedHat maintiners
● https://twitter.com/maxandersen/status/1387683489877831685
● Plugin to Operator SDK to generate Java Operator SDK project
● Interesting for big enterprises building heavily on Java
Why to use it?
● Why not just creating a watch?
● Fixes typical problem independent of programming language
● It’s a (micro)framework, so you have to just think about missing pieces.
○ Usually implementing a method
● Non trivial design issues
○ Like optimistic locking of status subresource?
Concurrency
● No concurrent event processing for same Custom Resource
● Correct handling of Optimistic Locking
Automatic Retries
● Network problems?
● Essential for correctness
● Configurable retries
○ Various backoff strategies
Finalizers
● Essential for correctness
● Automatically handled
● What if operator is down?
apiVersion: "sample.javaoperatorsdk/v1"
kind: WebServer
metadata:
name: hellows
finalizers:
- webservers.sample.javaoperatorsdk/finalizer
spec:
html: |
<html>
<head>
<title>Hello Operator World</title>
</head>
<body>
Hello Meetup
</body>
</html>
...and more
● Support for Generations
● Nice API to update custom resource and/or status-subresource
● Integration with Quarkus and Spring Boot
● ...
Event Sources - Dependent Resources
Event Sources
How does it compare to Terraform
● With Terraform we provision resources managed by cloud providers
● With Operators we manage resources
○ (IMHO) But how it should be managed inside the controller implementation it’s quite
close to terraform
■ Status is state
■ Reconcile always all the resources independently from event
○ Note that some patterns are still just being explored.
Thank you!
Time for Questions!
Ad

Recommended

The evolving container landscape
The evolving container landscape
Nilesh Trivedi
 
Cncf storage-final-filip
Cncf storage-final-filip
Juraj Hantak
 
AWS Lambda and serverless Java | DevNation Live
AWS Lambda and serverless Java | DevNation Live
Red Hat Developers
 
16. Cncf meetup-docker
16. Cncf meetup-docker
Juraj Hantak
 
Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)
Opsta
 
Promise of DevOps
Promise of DevOps
Juraj Hantak
 
Kubernetes day 2_jozef_halgas_pf
Kubernetes day 2_jozef_halgas_pf
Juraj Hantak
 
7 - Monitoring Kubernetes with Elastic
7 - Monitoring Kubernetes with Elastic
Kangaroot
 
Swarm migration
Swarm migration
Janakiram MSV
 
5 - Hands-on Kubernetes Workshop:
5 - Hands-on Kubernetes Workshop:
Kangaroot
 
State of the Container Ecosystem
State of the Container Ecosystem
Vinay Rao
 
Mirantis Contributions to Kubernetes Ecosystem
Mirantis Contributions to Kubernetes Ecosystem
MoscowKubernetes
 
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
Kangaroot
 
Monitoring with prometheus at scale
Monitoring with prometheus at scale
Juraj Hantak
 
CNCF Projects Overview
CNCF Projects Overview
Neependra Khare
 
Google Cloud Platform and Kubernetes
Google Cloud Platform and Kubernetes
Kasper Nissen
 
Kubernetes User Group: 維運 Kubernetes 的兩三事
Kubernetes User Group: 維運 Kubernetes 的兩三事
smalltown
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
Trang Nguyen
 
Secrets management vault cncf meetup
Secrets management vault cncf meetup
Juraj Hantak
 
What you have to know about Certified Kubernetes Administrator (CKA)
What you have to know about Certified Kubernetes Administrator (CKA)
Opsta
 
Beyond OpenStack | OpenStack in Real Life
Beyond OpenStack | OpenStack in Real Life
Opsta
 
Designing Cloud Native Applications with Kubernetes
Designing Cloud Native Applications with Kubernetes
Bilgin Ibryam
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
Rafał Leszko
 
Kubernetes Meetup: CNI, Flex Volume, and Scheduler
Kubernetes Meetup: CNI, Flex Volume, and Scheduler
Katie Crimi
 
GKE Tip Series - Usage Metering
GKE Tip Series - Usage Metering
Sreenivas Makam
 
Kubernetes and OpenStack at Scale
Kubernetes and OpenStack at Scale
Stephen Gordon
 
Kubernetes & Google Kubernetes Engine (GKE)
Kubernetes & Google Kubernetes Engine (GKE)
Akash Agrawal
 
Docker for HPC in a Nutshell
Docker for HPC in a Nutshell
inside-BigData.com
 
How kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updated
Shikha Srivastava
 
Operator Framework Overview
Operator Framework Overview
Rob Szumski
 

More Related Content

What's hot (20)

Swarm migration
Swarm migration
Janakiram MSV
 
5 - Hands-on Kubernetes Workshop:
5 - Hands-on Kubernetes Workshop:
Kangaroot
 
State of the Container Ecosystem
State of the Container Ecosystem
Vinay Rao
 
Mirantis Contributions to Kubernetes Ecosystem
Mirantis Contributions to Kubernetes Ecosystem
MoscowKubernetes
 
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
Kangaroot
 
Monitoring with prometheus at scale
Monitoring with prometheus at scale
Juraj Hantak
 
CNCF Projects Overview
CNCF Projects Overview
Neependra Khare
 
Google Cloud Platform and Kubernetes
Google Cloud Platform and Kubernetes
Kasper Nissen
 
Kubernetes User Group: 維運 Kubernetes 的兩三事
Kubernetes User Group: 維運 Kubernetes 的兩三事
smalltown
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
Trang Nguyen
 
Secrets management vault cncf meetup
Secrets management vault cncf meetup
Juraj Hantak
 
What you have to know about Certified Kubernetes Administrator (CKA)
What you have to know about Certified Kubernetes Administrator (CKA)
Opsta
 
Beyond OpenStack | OpenStack in Real Life
Beyond OpenStack | OpenStack in Real Life
Opsta
 
Designing Cloud Native Applications with Kubernetes
Designing Cloud Native Applications with Kubernetes
Bilgin Ibryam
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
Rafał Leszko
 
Kubernetes Meetup: CNI, Flex Volume, and Scheduler
Kubernetes Meetup: CNI, Flex Volume, and Scheduler
Katie Crimi
 
GKE Tip Series - Usage Metering
GKE Tip Series - Usage Metering
Sreenivas Makam
 
Kubernetes and OpenStack at Scale
Kubernetes and OpenStack at Scale
Stephen Gordon
 
Kubernetes & Google Kubernetes Engine (GKE)
Kubernetes & Google Kubernetes Engine (GKE)
Akash Agrawal
 
Docker for HPC in a Nutshell
Docker for HPC in a Nutshell
inside-BigData.com
 
5 - Hands-on Kubernetes Workshop:
5 - Hands-on Kubernetes Workshop:
Kangaroot
 
State of the Container Ecosystem
State of the Container Ecosystem
Vinay Rao
 
Mirantis Contributions to Kubernetes Ecosystem
Mirantis Contributions to Kubernetes Ecosystem
MoscowKubernetes
 
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
Kangaroot
 
Monitoring with prometheus at scale
Monitoring with prometheus at scale
Juraj Hantak
 
Google Cloud Platform and Kubernetes
Google Cloud Platform and Kubernetes
Kasper Nissen
 
Kubernetes User Group: 維運 Kubernetes 的兩三事
Kubernetes User Group: 維運 Kubernetes 的兩三事
smalltown
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
Trang Nguyen
 
Secrets management vault cncf meetup
Secrets management vault cncf meetup
Juraj Hantak
 
What you have to know about Certified Kubernetes Administrator (CKA)
What you have to know about Certified Kubernetes Administrator (CKA)
Opsta
 
Beyond OpenStack | OpenStack in Real Life
Beyond OpenStack | OpenStack in Real Life
Opsta
 
Designing Cloud Native Applications with Kubernetes
Designing Cloud Native Applications with Kubernetes
Bilgin Ibryam
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
Rafał Leszko
 
Kubernetes Meetup: CNI, Flex Volume, and Scheduler
Kubernetes Meetup: CNI, Flex Volume, and Scheduler
Katie Crimi
 
GKE Tip Series - Usage Metering
GKE Tip Series - Usage Metering
Sreenivas Makam
 
Kubernetes and OpenStack at Scale
Kubernetes and OpenStack at Scale
Stephen Gordon
 
Kubernetes & Google Kubernetes Engine (GKE)
Kubernetes & Google Kubernetes Engine (GKE)
Akash Agrawal
 

Similar to Intro to creating kubernetes operators (20)

How kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updated
Shikha Srivastava
 
Operator Framework Overview
Operator Framework Overview
Rob Szumski
 
Operator SDK for K8s using Go
Operator SDK for K8s using Go
CloudOps2005
 
The Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in Kubernetes
QAware GmbH
 
An intro to Kubernetes operators
An intro to Kubernetes operators
J On The Beach
 
Someone Call the Operator - ATL K8's Meetup
Someone Call the Operator - ATL K8's Meetup
Ravi Lachhman
 
Red Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABC
Robert Bohne
 
Ofir Makmal - Intro To Kubernetes Operators - Google Cloud Summit 2018 Tel Aviv
Ofir Makmal - Intro To Kubernetes Operators - Google Cloud Summit 2018 Tel Aviv
Ofir Makmal
 
ОЛЕГ МАЦЬКІВ «Crash course on Operator Framework» Lviv DevOps Conference 2019
ОЛЕГ МАЦЬКІВ «Crash course on Operator Framework» Lviv DevOps Conference 2019
UA DevOps Conference
 
Kubernetes extensibility: crd & operators
Kubernetes extensibility: crd & operators
Giacomo Tirabassi
 
Kubernetes extensibility: CRDs & Operators
Kubernetes extensibility: CRDs & Operators
SIGHUP
 
The Kubernetes Operator Pattern - ContainerConf Nov 2017
The Kubernetes Operator Pattern - ContainerConf Nov 2017
Jakob Karalus
 
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
All Things Open
 
Automating stateful applications with kubernetes operators - Openstack Summit...
Automating stateful applications with kubernetes operators - Openstack Summit...
Jorge Morales
 
Extending Kubernetes with Operators
Extending Kubernetes with Operators
peychevi
 
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Red Hat Developers
 
Kubernetes Operators 1st Edition Jason Dobies
Kubernetes Operators 1st Edition Jason Dobies
budhuradot
 
ADDO - Your own Kubernetes controller, not only in Go
ADDO - Your own Kubernetes controller, not only in Go
Nicolas Fränkel
 
Kubernetes Operators Automating the Container Orchestration Platform 1st Edit...
Kubernetes Operators Automating the Container Orchestration Platform 1st Edit...
sigemozareer53
 
Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...
Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...
Jakob Karalus
 
How kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updated
Shikha Srivastava
 
Operator Framework Overview
Operator Framework Overview
Rob Szumski
 
Operator SDK for K8s using Go
Operator SDK for K8s using Go
CloudOps2005
 
The Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in Kubernetes
QAware GmbH
 
An intro to Kubernetes operators
An intro to Kubernetes operators
J On The Beach
 
Someone Call the Operator - ATL K8's Meetup
Someone Call the Operator - ATL K8's Meetup
Ravi Lachhman
 
Red Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABC
Robert Bohne
 
Ofir Makmal - Intro To Kubernetes Operators - Google Cloud Summit 2018 Tel Aviv
Ofir Makmal - Intro To Kubernetes Operators - Google Cloud Summit 2018 Tel Aviv
Ofir Makmal
 
ОЛЕГ МАЦЬКІВ «Crash course on Operator Framework» Lviv DevOps Conference 2019
ОЛЕГ МАЦЬКІВ «Crash course on Operator Framework» Lviv DevOps Conference 2019
UA DevOps Conference
 
Kubernetes extensibility: crd & operators
Kubernetes extensibility: crd & operators
Giacomo Tirabassi
 
Kubernetes extensibility: CRDs & Operators
Kubernetes extensibility: CRDs & Operators
SIGHUP
 
The Kubernetes Operator Pattern - ContainerConf Nov 2017
The Kubernetes Operator Pattern - ContainerConf Nov 2017
Jakob Karalus
 
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
All Things Open
 
Automating stateful applications with kubernetes operators - Openstack Summit...
Automating stateful applications with kubernetes operators - Openstack Summit...
Jorge Morales
 
Extending Kubernetes with Operators
Extending Kubernetes with Operators
peychevi
 
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Red Hat Developers
 
Kubernetes Operators 1st Edition Jason Dobies
Kubernetes Operators 1st Edition Jason Dobies
budhuradot
 
ADDO - Your own Kubernetes controller, not only in Go
ADDO - Your own Kubernetes controller, not only in Go
Nicolas Fränkel
 
Kubernetes Operators Automating the Container Orchestration Platform 1st Edit...
Kubernetes Operators Automating the Container Orchestration Platform 1st Edit...
sigemozareer53
 
Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...
Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...
Jakob Karalus
 
Ad

More from Juraj Hantak (20)

Kubernetes day 2 @ zse energia
Kubernetes day 2 @ zse energia
Juraj Hantak
 
Dev ops culture_final
Dev ops culture_final
Juraj Hantak
 
23 meetup rancher
23 meetup rancher
Juraj Hantak
 
Integracia security do ci cd pipelines
Integracia security do ci cd pipelines
Juraj Hantak
 
CNCF opa
CNCF opa
Juraj Hantak
 
Introductiontohelmcharts2021
Introductiontohelmcharts2021
Juraj Hantak
 
19. stretnutie komunity kubernetes
19. stretnutie komunity kubernetes
Juraj Hantak
 
16. meetup sietovy model v kubernetes
16. meetup sietovy model v kubernetes
Juraj Hantak
 
16.meetup uvod
16.meetup uvod
Juraj Hantak
 
14. meetup
14. meetup
Juraj Hantak
 
Terraform a gitlab ci
Terraform a gitlab ci
Juraj Hantak
 
Kubernetes monitoring using prometheus stack
Kubernetes monitoring using prometheus stack
Juraj Hantak
 
12.cncfsk meetup observability and analysis
12.cncfsk meetup observability and analysis
Juraj Hantak
 
Grafana 7.0
Grafana 7.0
Juraj Hantak
 
Nginx app protect-for-meetup-v1.0-202006_lk
Nginx app protect-for-meetup-v1.0-202006_lk
Juraj Hantak
 
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
Juraj Hantak
 
10.cncfsk en-story
10.cncfsk en-story
Juraj Hantak
 
Ingress controller present, past and future
Ingress controller present, past and future
Juraj Hantak
 
Cncf meetup-service-mesh-sk
Cncf meetup-service-mesh-sk
Juraj Hantak
 
Kubernetes ingress-pixelfederation
Kubernetes ingress-pixelfederation
Juraj Hantak
 
Kubernetes day 2 @ zse energia
Kubernetes day 2 @ zse energia
Juraj Hantak
 
Dev ops culture_final
Dev ops culture_final
Juraj Hantak
 
Integracia security do ci cd pipelines
Integracia security do ci cd pipelines
Juraj Hantak
 
Introductiontohelmcharts2021
Introductiontohelmcharts2021
Juraj Hantak
 
19. stretnutie komunity kubernetes
19. stretnutie komunity kubernetes
Juraj Hantak
 
16. meetup sietovy model v kubernetes
16. meetup sietovy model v kubernetes
Juraj Hantak
 
Terraform a gitlab ci
Terraform a gitlab ci
Juraj Hantak
 
Kubernetes monitoring using prometheus stack
Kubernetes monitoring using prometheus stack
Juraj Hantak
 
12.cncfsk meetup observability and analysis
12.cncfsk meetup observability and analysis
Juraj Hantak
 
Nginx app protect-for-meetup-v1.0-202006_lk
Nginx app protect-for-meetup-v1.0-202006_lk
Juraj Hantak
 
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
Juraj Hantak
 
10.cncfsk en-story
10.cncfsk en-story
Juraj Hantak
 
Ingress controller present, past and future
Ingress controller present, past and future
Juraj Hantak
 
Cncf meetup-service-mesh-sk
Cncf meetup-service-mesh-sk
Juraj Hantak
 
Kubernetes ingress-pixelfederation
Kubernetes ingress-pixelfederation
Juraj Hantak
 
Ad

Recently uploaded (20)

Global Networking Trends, presented at the India ISP Conclave 2025
Global Networking Trends, presented at the India ISP Conclave 2025
APNIC
 
ChatGPT_and_Its_Uses_Presentationss.pptx
ChatGPT_and_Its_Uses_Presentationss.pptx
Neha Prakash
 
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
taqyed
 
ChatGPT A.I. Powered Chatbot and Popularization.pdf
ChatGPT A.I. Powered Chatbot and Popularization.pdf
StanleySamson1
 
TCP/IP presentation SET2- Information Systems
TCP/IP presentation SET2- Information Systems
agnesegtcagliero
 
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
taqyed
 
Almos Entirely Correct Mixing with Apps to Voting
Almos Entirely Correct Mixing with Apps to Voting
gapati2964
 
BitRecover OST to PST Converter Software
BitRecover OST to PST Converter Software
antoniogosling01
 
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
AhmadAli716831
 
Slides: Eco Economic Epochs for The World Game (s) pdf
Slides: Eco Economic Epochs for The World Game (s) pdf
Steven McGee
 
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens
 
The ARUBA Kind of new Proposal Umum .pptx
The ARUBA Kind of new Proposal Umum .pptx
andiwarneri
 
history of internet in nepal Class-8 (sparsha).pptx
history of internet in nepal Class-8 (sparsha).pptx
SPARSH508080
 
DDoS in India, presented at INNOG 8 by Dave Phelan
DDoS in India, presented at INNOG 8 by Dave Phelan
APNIC
 
Pitch PitchPitchPitchPitchPitchPitch.pptx
Pitch PitchPitchPitchPitchPitchPitch.pptx
157551
 
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
Taqyea
 
Paper: The World Game (s) Great Redesign.pdf
Paper: The World Game (s) Great Redesign.pdf
Steven McGee
 
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
taqyea
 
Make DDoS expensive for the threat actors
Make DDoS expensive for the threat actors
APNIC
 
BroadLink Cloud Service introduction.pdf
BroadLink Cloud Service introduction.pdf
DevendraDwivdi1
 
Global Networking Trends, presented at the India ISP Conclave 2025
Global Networking Trends, presented at the India ISP Conclave 2025
APNIC
 
ChatGPT_and_Its_Uses_Presentationss.pptx
ChatGPT_and_Its_Uses_Presentationss.pptx
Neha Prakash
 
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
taqyed
 
ChatGPT A.I. Powered Chatbot and Popularization.pdf
ChatGPT A.I. Powered Chatbot and Popularization.pdf
StanleySamson1
 
TCP/IP presentation SET2- Information Systems
TCP/IP presentation SET2- Information Systems
agnesegtcagliero
 
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
taqyed
 
Almos Entirely Correct Mixing with Apps to Voting
Almos Entirely Correct Mixing with Apps to Voting
gapati2964
 
BitRecover OST to PST Converter Software
BitRecover OST to PST Converter Software
antoniogosling01
 
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
AhmadAli716831
 
Slides: Eco Economic Epochs for The World Game (s) pdf
Slides: Eco Economic Epochs for The World Game (s) pdf
Steven McGee
 
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens
 
The ARUBA Kind of new Proposal Umum .pptx
The ARUBA Kind of new Proposal Umum .pptx
andiwarneri
 
history of internet in nepal Class-8 (sparsha).pptx
history of internet in nepal Class-8 (sparsha).pptx
SPARSH508080
 
DDoS in India, presented at INNOG 8 by Dave Phelan
DDoS in India, presented at INNOG 8 by Dave Phelan
APNIC
 
Pitch PitchPitchPitchPitchPitchPitch.pptx
Pitch PitchPitchPitchPitchPitchPitch.pptx
157551
 
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
Taqyea
 
Paper: The World Game (s) Great Redesign.pdf
Paper: The World Game (s) Great Redesign.pdf
Steven McGee
 
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
taqyea
 
Make DDoS expensive for the threat actors
Make DDoS expensive for the threat actors
APNIC
 
BroadLink Cloud Service introduction.pdf
BroadLink Cloud Service introduction.pdf
DevendraDwivdi1
 

Intro to creating kubernetes operators

  • 1. Intro to Creating Kubernetes Operators ... and what can a framework do for you
  • 2. About me ● Attila Mészáros ([email protected]) ● 10+ years Java developer / architect ● Last 3 years more on platform teams ● Currently: Senior Software Engineer @ ○ Building multi-cloud platform ○ Golang, K8S, AWS (on-prem, GCP, AZURE) (Java) + Everything around ● Free Time ○ ❤Rust❤ ○ co-creator of Java Operator SDK
  • 3. Agenda ● Intro to Kubernetes Operators ● Simple Example ● Intro To Java Operator SDK ● Common problems and how we solve them ● Event Sources and the power of operators
  • 4. Extending K8S API - CRDs ● Define Custom Type in K8S: Custom Resource Defintion ● Abstraction over a more complex domain ● Instance of our type we call Custom Resource ● “kubectl apply” this => apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: webservers.sample.javaoperatorsdk spec: group: sample.javaoperatorsdk versions: - name: v1 served: true storage: true schema: openAPIV3Schema: type: object properties: spec: type: object properties: html: type: string scope: Namespaced names: plural: webservers singular: webserver kind: WebServer shortNames: - ws
  • 5. Sample Custom Resource apiVersion: "sample.javaoperatorsdk/v1" kind: WebServer metadata: name: hellows spec: html: | <html> <head> <title>Hello Operator World</title> </head> <body> Hello Meetup </body> </html> ● simple examples: abstraction over static website
  • 6. Kubernetes Operator - Definition ● “Operators are software extensions to Kubernetes that make use of custom resources to manage applications and their components. Operators follow Kubernetes principles, notably the control loop.” ● That’s it, K8S does not provide any additional facilities. Only: ○ Extension to API - CRD/CR ○ and the operations we have on K8S Objects: CRUD, Patch, Watch ○ (ok for golang it kinda provides )
  • 7. What is a control loop?
  • 8. The Operator Pattern ● At the end it’s a Pod watching Custom Resources ● and Reconciling the desired state with the target world
  • 9. Demo Time - WebServer Example
  • 10. Managing K8S and non-K8S Resources ● Manage all well known K8S resources (pods, config maps, ingress, service, pv) ○ Create nice abstractions ○ Deploy/Manage Complex Applications (Kafka, Postgres) ○ Flux ● External Resources (or anything that has an API) ○ Git Repositories, ○ Users in external System ○ CockroachDB users ○ AWS Controllers for Kubernetes (ACK)
  • 11. Framework Support ● Well known frameworks ○ Operator SDK (go, from RedHat) ○ Java Operator SDK ○ Kopf (python) ○ ...
  • 12. History to Java Operator SDK ● Started on ~ May 2019 ● Spinoff from a project on Java based big Enterprise Company ● From ~ 2020 November heavy RedHat involvement ● Now dedicated RedHat maintiners ● https://twitter.com/maxandersen/status/1387683489877831685 ● Plugin to Operator SDK to generate Java Operator SDK project ● Interesting for big enterprises building heavily on Java
  • 13. Why to use it? ● Why not just creating a watch? ● Fixes typical problem independent of programming language ● It’s a (micro)framework, so you have to just think about missing pieces. ○ Usually implementing a method ● Non trivial design issues ○ Like optimistic locking of status subresource?
  • 14. Concurrency ● No concurrent event processing for same Custom Resource ● Correct handling of Optimistic Locking
  • 15. Automatic Retries ● Network problems? ● Essential for correctness ● Configurable retries ○ Various backoff strategies
  • 16. Finalizers ● Essential for correctness ● Automatically handled ● What if operator is down? apiVersion: "sample.javaoperatorsdk/v1" kind: WebServer metadata: name: hellows finalizers: - webservers.sample.javaoperatorsdk/finalizer spec: html: | <html> <head> <title>Hello Operator World</title> </head> <body> Hello Meetup </body> </html>
  • 17. ...and more ● Support for Generations ● Nice API to update custom resource and/or status-subresource ● Integration with Quarkus and Spring Boot ● ...
  • 18. Event Sources - Dependent Resources
  • 20. How does it compare to Terraform ● With Terraform we provision resources managed by cloud providers ● With Operators we manage resources ○ (IMHO) But how it should be managed inside the controller implementation it’s quite close to terraform ■ Status is state ■ Reconcile always all the resources independently from event ○ Note that some patterns are still just being explored.
  • 21. Thank you! Time for Questions!