SlideShare a Scribd company logo
A series of fortunate events
Building an operator in Java
September 1–2, 2021
springone.io
1
Bella Bai
@bellalleb_bai
LittleBaiBai
Alberto C. Ríos
@Albertoimpl
Albertoimpl
Sample app:
https://github.com/building-k8s-operator/kubernetes-java-operator-sample
What is an operator?
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.
3
-- Kubernetes Documentation
Quote source: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
Control loop of operators
4
Image source: https://github.com/cncf/tag-app-delivery/blob/master/operator-wg/whitepaper/Operator-WhitePaper_v1-0.md#operator-components-in-kubernetes
An operator is a Kubernetes controller that
understands two domains: Kubernetes and
something else.
By combining knowledge of both domains, it
can automate tasks that usually require a human
operator that understands both domains.
5
-- Jimmy Zelinskie
Quote source: https://github.com/kubeflow/tf-operator/issues/300#issuecomment-357527937
The “business” context in our sample app
6
apiVersion: "operator.example.com/v1alpha1"
kind: AdoptionCenter
metadata:
name: kittens-dream-land
apiVersion: "operator.example.com/v1alpha1"
kind: CatForAdoption
metadata:
name: my-precious-fluffy-ball
spec:
name: Chocobo
dateOfBirth: 2014-09-17
description: She is chubby, lazy ...
adoptionCenterName: kittens-dream-land
The AdoptionCenter icon is made by Freepik: https://www.flaticon.com/
The “business” context in our sample app
7
The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/
When to and when not to?
When do we want to use an operator
● Deploying applications on demand
● Backing up and restoring an application's
state
● Automating application upgrades
● Provide a decentralized way to manage
centralized resources
9
When NOT to use an operator
● It is just an app with some configuration
● You don't need some special business logic for
handling most of the operational work and can
deploy it as it is
● When you can just deploy everything with Helm or
Kustomize
● No need for any kind of persistence nor status to
be backed
10
Scaffolding
Starting from scratch
12
● Pick an operator library with Spring support
○ Kubernetes Java Client
○ Java Operator SDK
● Generate models based on your CRDs
○ Or generate your CRDs based on your model
○ Maintain single source of truth
● Setup your controller with resource listeners
Kubernetes Java Client: https://github.com/kubernetes-client/java
Java Operator SDK: https://github.com/java-operator-sdk/java-operator-sdk
@Bean public Controller adoptionCenterController(
SharedInformerFactory sharedInformerFactory,
AdoptionCenterReconciler reconciler) {
return ControllerBuilder
.defaultBuilder(sharedInformerFactory)
.watch((q) -> ControllerBuilder
.controllerWatchBuilder(V1alpha1AdoptionCenter.class, q)
.withOnDeleteFilter((resource, cache) -> false)
.withOnUpdateFilter((old, new) -> false)
.withOnAddFilter((resource) -> true)
.build())
.withReconciler(reconciler)
.withName(AdoptionCenterReconciler.CONTROLLER_NAME)
.build();
}
Example controller
13
Starting from scratch
14
● Pick an operator library with Spring support
○ Kubernetes Java Client
○ Java Operator SDK
● Generate models based on your CRDs
○ Or generate your CRDs based on your model
○ Maintain single source of truth
● Setup your controller with resource listeners
Kubernetes Java Client: https://github.com/kubernetes-client/java
Java Operator SDK: https://github.com/java-operator-sdk/java-operator-sdk
● Start reconciling 💪
Example reconciler
15
@Override
public Result reconcile(Request request) {
V1alpha1AdoptionCenter center = adoptionCenterLister.get(request.getName())
try {
V1OwnerReference owner = toOwnerReference(center);
configMapUpdater.createConfigMap(owner);
deploymentEditor.createDeployment(owner);
return new Result(false);
}
catch (Exception e) {
return new Result(true);
}
}
Useful patterns to know
Managing Status
Managing status
% kubectl get cats
NAME
my-precious-fluffy-ball
18
Managing status
% kubectl get cats
NAME
my-precious-fluffy-ball
19
Managing status
% kubectl get cats
NAME READY REASON
my-precious-fluffy-ball True CatAddedToConfigMap
2
0
Managing status
schema:
openAPIV3Schema :
type: object
properties :
spec:
...
status:
type: object
properties:
conditions:
type: array
items:
type: object
properties:
type:
type: string
description: The unique identifier of a condition, used to
distinguish between other conditions in the resource.
status:
type: string
description: The status of the condition.
21
https://github.com/building-k8s-operator/kubernetes-java-operator-sample/blob/main/
crds/cat-custom-resource-definition.yaml
Managing status
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: catsforadoption.operator.example.com
spec:
...
versions:
- name: v1alpha1
served: true
storage: true
additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- jsonPath: .status.conditions[?(@.type=="Ready")].reason
name: Reason
type: string
schema:
…
2
2
https://github.com/building-k8s-operator/kubernetes-java-operator-sample/blob/main/
crds/cat-custom-resource-definition.yaml
Managing status
String patch = String.format("{"status": " +
"{ "conditions": " +
"[{ "type": "%s", "status": "%s",
"lastTransitionTime": "%s", "reason": "%s"}]" +
"}}",
type, status, ZonedDateTime.now(ZoneOffset.UTC), reason);
2
3
PatchUtils.patch(
V1alpha1CatForAdoption.class,
() -> api
.patchNamespacedCatForAdoptionStatusCall(
cat.getMetadata().getName(),
cat.getMetadata().getNamespace(),
new V1Patch(patch), null, null, null, null),
V1Patch.PATCH_FORMAT_JSON_MERGE_PATCH,
api.getApiClient());
Managing status
% kubectl get cats
NAME READY REASON
my-precious-fluffy-ball True CatAddedToConfigMap
2
4
Garbage Collection
Garbage Collection
V1alpha1AdoptionCenter adoptionCenter = lister.namespace(ns).get(name);
if(isDeleteRequest(adoptionCenter)) {
deploymentService.delete(adoptionCenter);
configMapService.delete(adoptionCenter);
secretService.delete(adoptionCenter);
}
2
6
Garbage Collection
% kubectl get deployment my-adoption-center -oyaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-adoption-center
namespace: animal-rescue
ownerReferences:
- apiVersion: operator.example.com/v1alpha1
blockOwnerDeletion: true
controller: true
kind: AdoptionCenter
name: my-adoption-center
uid: 9d09ca3f-f92f-4745-9eb4-9798096b7408
27
Garbage Collection
2
8
public V1Deployment createDeployment(V1alpha1AdoptionCenter adoptionCenter){
...
deployment
.getMetadata()
.addOwnerReferencesItem(toOwnerReference(adoptionCenter));
...
}
private V1OwnerReference toOwnerReference(V1alpha1AdoptionCenter adoptionCenter) {
return new V1OwnerReference().controller(true)
.name(adoptionCenter.getMetadata().getName())
.uid(adoptionCenter.getMetadata().getUid())
.kind(adoptionCenter.getKind())
.apiVersion(adoptionCenter.getApiVersion())
.blockOwnerDeletion(true);
}
Readiness Gates
Readiness Gates
3
0
kind: Pod
...
spec:
readinessGates:
- conditionType: "example.com/feature-1"
status:
Conditions:
- ... # built in PodConditions
- type: "example.com/feature-1"
status: "True"
lastProbeTime: null
lastTransitionTime: 2021-09-01T00:00:00Z
Image source: https://www.reddit.com/r/gatekeeping/comments/bafsci/cat_gatekeeping_guests/
Readiness Gates
31
kind: Pod
...
spec:
readinessGates:
- conditionType: "example.com/feature-1"
status:
Conditions:
- ... # built in PodConditions
- type: "example.com/feature-1"
status: "True"
lastProbeTime: null
lastTransitionTime: 2021-09-01T00:00:00Z
Image source: https://www.reddit.com/r/gatekeeping/comments/bafsci/cat_gatekeeping_guests/
Finalizers
Finalizers are namespaced keys that tell
Kubernetes to wait until specific
conditions are met before it fully deletes
resources marked for deletion.
You can use finalizers to control garbage
collection of resources.
33
-- Kubernetes Documentation
Quote source: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/
Removing CatForAdoption without finalizers
34
The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/
Operator
Desired State Actual State
Removing CatForAdoption without finalizers
3
5
The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/
Operator
Desired State Actual State
Return “Null”
Actual State
Desired State
Return “Null”
Removing CatForAdoption without finalizers
3
6
The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/
Operator
Removing CatForAdoption with finalizers
37
The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/
Operator
Desired State Actual State
metadata.deletionTimeStamp != null
Add / remove finalizer
boolean toDelete = cat.getMetadata().getDeletionTimestamp() != null;
if (!toDelete) {
boolean notFound = cat.getMetadata().getFinalizers() == null ||
cat.getMetadata().getFinalizers().isEmpty();
if (notFound) {
catFinalizerEditor.add(cat);
}
upsertCatToAdoptionCenter(cat);
} else {
removeCatFromAdoptionCenter(cat);
catFinalizerEditor.remove(cat);
}
38
CatFinalizerEditor code example
public V1alpha1CatForAdoption add(V1alpha1CatForAdoption cat) throws
ApiException {
return PatchUtils.patch(
V1alpha1CatForAdoption.class,
() -> api.patchNamespacedCatForAdoptionCall(
cat.getMetadata().getName(),
cat.getMetadata().getNamespace(),
new V1Patch("{"metadata":{"finalizers":["" +
FINALIZER_STRING + ""]}}"),
null, null, null, null),
V1Patch.PATCH_FORMAT_JSON_MERGE_PATCH,
api.getApiClient());
}
3
9
Watch out when you uninstall
4
0
● Resources pending delete without operator
● What to do?
○ Pre-delete hook in operator
○ Pre-delete hook in Helm or other
packaging options
○ Cancel uninstallation
○ Carefully order the uninstall process
○ Just document as known issue
Custom Resource Validation
Custom Resource Validation
4
2
Create/Update
Custom Resource
Request
Request Decoding &
Conversion
Validation
Storage Conversion
etcd
Response Encoding
& Conversion
Syntactic validation
schema:
openAPIV3Schema:
…
name:
type: string
description: The name of the cat
dateOfBirth:
type: string
format: date
description: Date of birth of the cat in the format defined in RFC 3339
description:
type: string
description: The description of the cat
adoptionCenterName:
type: string
description: Name of the adoption center to register this cat to
required: ["adoptionCenterName", "name"]
43
Syntactic validation
anyOf:
- properties:
spec:
required: ["propertyA"]
- properties:
spec:
properties:
propertyB:
items:
required: ["propertyC"]
44
Custom Resource Validation
4
5
Create/Update
Custom Resource
Request
Request Decoding &
Conversion
Validation
Storage Conversion
etcd
Response Encoding
& Conversion
Custom Resource Validation
4
6
Create/Update Custom
Resource Request
Request Decoding &
Conversion
Admission
Storage Conversion
etcd
Response Encoding &
Conversion
Mutating
webhooks
Validation
Validating
webhooks
Semantic validation
public V1beta1AdmissionReviewValidation validate(V1beta1AdmissionReview request) {
boolean isAllowed = validate(request.getRequest().getOldObject().get("spec"));
V1beta1AdmissionReviewResponse response = new V1beta1AdmissionReviewResponse();
response.setAllowed(isAllowed);
return new V1beta1AdmissionReviewValidation(response);
}
47
Testing
Testing
4
9
Image source: https://github.com/cncf/tag-app-delivery/blob/master/operator-wg/whitepaper/Operator-WhitePaper_v1-0.md#operator-components-in-kubernetes
Testing
● Unit Tests
5
0
Testing
● Unit Tests
● Component Tests: Closed-box test from the Operator's
perspective
We do not assert correctness of the deployed application
but assert on the values it was deployed with.
51
@WithKubernetesCluster
class CatFinalizerEditorComponentTest {
...
}
Component Tests
5
2
https://kind.sigs.k8s.io
@Autowired private CatFinalizerEditor finalizerEditor;
@Autowired private TestK8sClient testK8sClient;
@BeforeAll
void createCrd() { testK8sClient.createCatCrd();}
@Test
void add_shouldAddFinalizerToCatResource
() throws ApiException {
V1alpha1CatForAdoption existing = testK8sClient.createCat(TEST_NAMESPACE,
resourceName);
V1alpha1CatForAdoption returned = finalizerEditor.add(existing);
assertThat(returned.getMetadata().getFinalizers()).contains(
FINALIZER_STRING);
V1alpha1CatForAdoption catFromApiServer =api.readNamespacedCatForAdoption(
resourceName, TEST_NAMESPACE, null, null);
assertThat(catFromApiServer.getMetadata().getFinalizers()).contains(
FINALIZER_STRING);
}
Component Tests
5
3
Testing
● Unit Tests
● Component Tests
● Acceptance Tests: Testing the system as a whole
Using a real environment and installing the product as a
user would.
5
4
@Test
void journeyTest() throws Exception {
V1alpha1AdoptionCenter adoptionCenter = testK8sClient.createAdoptionCenter();
assertThatSubResourcesAreDeployed(adoptionCenter);
assertThatAdoptionCenterHasCat(adoptionCenter.getMetadata().getName(), 0);
V1alpha1CatForAdoption cat = testK8sClient.createCat("default", "my-cat");
waitForReconciliationtoTriggerRestart();
assertThatAdoptionCenterHasCat(adoptionCenter.getMetadata().getName(), 1, cat);
testK8sClient.deleteCat("default", "my-cat");
waitForReconciliationtoTriggerRestart();
assertThatAdoptionCenterHasCat(adoptionCenter.getMetadata().getName(), 0);
testK8sClient.deleteAdoptionCenter(adoptionCenter.getMetadata().getName());
assertThatSubResourcesAreDeleted(adoptionCenter);
}
Acceptance tests
5
5
Demo Time!
https://github.com/building-k8s-operator/kubernetes-java-
operator-sample
Closing notes
Closing notes
● Operators are excellent for
managing continuous reconciliation
5
8
Closing notes
● Operators are excellent for
managing continuous reconciliation
5
9
● Operators are hard to maintain and
develop
Closing notes
Java
https://github.com/kubernetes-client/java
https://github.com/java-operator-sdk/java-operator-sdk
Golang
https://github.com/operator-framework/operator-sdk
https://github.com/kubernetes-sigs/kubebuilder
6
0
● Operators are excellent for
managing continuous reconciliation
● Operators are hard to maintain and
develop
Closing notes
● Generate your Java classes from CRD:
https://github.com/building-k8s-operator/kubernetes-java-operator-sample#gen
erating-java-classes-from-crd
● Use Statuses, Finalizers, Readiness gates and Owner references.
● They can be TDDed!
61
Now it’s your turn to try!
https://github.com/building-k8s-operator/kubernetes-java-
operator-sample
Any questions?
#springone
@SpringOne
Thank you!
Bella Bai
@bellalleb_bai
Alberto C. Ríos
@Albertoimpl

More Related Content

What's hot

500 Demo Day Batch 19: Sickweather
500 Demo Day Batch 19: Sickweather500 Demo Day Batch 19: Sickweather
500 Demo Day Batch 19: Sickweather
500 Startups
 
The investor presentation we used to raise 2 million dollars
The investor presentation we used to raise 2 million dollarsThe investor presentation we used to raise 2 million dollars
The investor presentation we used to raise 2 million dollars
Mikael Cho
 
Pitch Deck Teardown: Unito's $20M Series B deck
Pitch Deck Teardown: Unito's $20M Series B deckPitch Deck Teardown: Unito's $20M Series B deck
Pitch Deck Teardown: Unito's $20M Series B deck
HajeJanKamps
 
BuzzFeed Pitch Deck
BuzzFeed Pitch DeckBuzzFeed Pitch Deck
BuzzFeed Pitch Deck
Tech in Asia ID
 
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
Hyojun Jeon
 
AppVirality.com - Investor Pitch Deck
AppVirality.com - Investor Pitch DeckAppVirality.com - Investor Pitch Deck
AppVirality.com - Investor Pitch Deck
Laxman Papineni
 
SphereEx pitch deck
SphereEx pitch deckSphereEx pitch deck
SphereEx pitch deck
Tech in Asia
 
Coinbase Pitch Deck designed by Zlides
Coinbase Pitch Deck designed by ZlidesCoinbase Pitch Deck designed by Zlides
Coinbase Pitch Deck designed by Zlides
Zlides
 
Fivetran pitch deck
Fivetran pitch deckFivetran pitch deck
Fivetran pitch deck
Tech in Asia
 
SEOmoz Pitch Deck July 2011
SEOmoz Pitch Deck July 2011SEOmoz Pitch Deck July 2011
SEOmoz Pitch Deck July 2011
Rand Fishkin
 
Lean Analytics for Startups and Enterprises
Lean Analytics for Startups and EnterprisesLean Analytics for Startups and Enterprises
Lean Analytics for Startups and Enterprises
Lean Analytics
 
Stripe Pitch Deck designed by Zlides
Stripe Pitch Deck designed by ZlidesStripe Pitch Deck designed by Zlides
Stripe Pitch Deck designed by Zlides
Zlides
 
Mattermark 2nd (Final) Series A Deck
Mattermark 2nd (Final) Series A DeckMattermark 2nd (Final) Series A Deck
Mattermark 2nd (Final) Series A Deck
Danielle Morrill
 
N26 company slide deck
N26 company slide deck N26 company slide deck
N26 company slide deck
TechMeetups
 
Intercom's first pitch deck!
Intercom's first pitch deck!Intercom's first pitch deck!
Intercom's first pitch deck!
Eoghan McCabe
 
[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구
[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구
[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구
Alberto Yeo
 
Improvado Pitch Deck
Improvado Pitch DeckImprovado Pitch Deck
Improvado Pitch Deck
Improvado.io
 
Technology stack behind Airbnb
Technology stack behind Airbnb Technology stack behind Airbnb
Technology stack behind Airbnb
Rohan Khude
 
Marketing Pipeline Intelligence: A Dimensional Model
Marketing Pipeline Intelligence: A Dimensional ModelMarketing Pipeline Intelligence: A Dimensional Model
Marketing Pipeline Intelligence: A Dimensional Model
Daniel Upton
 
The Etsy Shard Architecture: Starts With S and Ends With Hard
The Etsy Shard Architecture: Starts With S and Ends With HardThe Etsy Shard Architecture: Starts With S and Ends With Hard
The Etsy Shard Architecture: Starts With S and Ends With Hard
jgoulah
 

What's hot (20)

500 Demo Day Batch 19: Sickweather
500 Demo Day Batch 19: Sickweather500 Demo Day Batch 19: Sickweather
500 Demo Day Batch 19: Sickweather
 
The investor presentation we used to raise 2 million dollars
The investor presentation we used to raise 2 million dollarsThe investor presentation we used to raise 2 million dollars
The investor presentation we used to raise 2 million dollars
 
Pitch Deck Teardown: Unito's $20M Series B deck
Pitch Deck Teardown: Unito's $20M Series B deckPitch Deck Teardown: Unito's $20M Series B deck
Pitch Deck Teardown: Unito's $20M Series B deck
 
BuzzFeed Pitch Deck
BuzzFeed Pitch DeckBuzzFeed Pitch Deck
BuzzFeed Pitch Deck
 
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
 
AppVirality.com - Investor Pitch Deck
AppVirality.com - Investor Pitch DeckAppVirality.com - Investor Pitch Deck
AppVirality.com - Investor Pitch Deck
 
SphereEx pitch deck
SphereEx pitch deckSphereEx pitch deck
SphereEx pitch deck
 
Coinbase Pitch Deck designed by Zlides
Coinbase Pitch Deck designed by ZlidesCoinbase Pitch Deck designed by Zlides
Coinbase Pitch Deck designed by Zlides
 
Fivetran pitch deck
Fivetran pitch deckFivetran pitch deck
Fivetran pitch deck
 
SEOmoz Pitch Deck July 2011
SEOmoz Pitch Deck July 2011SEOmoz Pitch Deck July 2011
SEOmoz Pitch Deck July 2011
 
Lean Analytics for Startups and Enterprises
Lean Analytics for Startups and EnterprisesLean Analytics for Startups and Enterprises
Lean Analytics for Startups and Enterprises
 
Stripe Pitch Deck designed by Zlides
Stripe Pitch Deck designed by ZlidesStripe Pitch Deck designed by Zlides
Stripe Pitch Deck designed by Zlides
 
Mattermark 2nd (Final) Series A Deck
Mattermark 2nd (Final) Series A DeckMattermark 2nd (Final) Series A Deck
Mattermark 2nd (Final) Series A Deck
 
N26 company slide deck
N26 company slide deck N26 company slide deck
N26 company slide deck
 
Intercom's first pitch deck!
Intercom's first pitch deck!Intercom's first pitch deck!
Intercom's first pitch deck!
 
[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구
[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구
[DataBreak 2018] 기획자의 마음을 움직이는 데이터 시각화, 여찬구
 
Improvado Pitch Deck
Improvado Pitch DeckImprovado Pitch Deck
Improvado Pitch Deck
 
Technology stack behind Airbnb
Technology stack behind Airbnb Technology stack behind Airbnb
Technology stack behind Airbnb
 
Marketing Pipeline Intelligence: A Dimensional Model
Marketing Pipeline Intelligence: A Dimensional ModelMarketing Pipeline Intelligence: A Dimensional Model
Marketing Pipeline Intelligence: A Dimensional Model
 
The Etsy Shard Architecture: Starts With S and Ends With Hard
The Etsy Shard Architecture: Starts With S and Ends With HardThe Etsy Shard Architecture: Starts With S and Ends With Hard
The Etsy Shard Architecture: Starts With S and Ends With Hard
 

Similar to A Series of Fortunate Events: Building an Operator in Java

DevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdfDevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdf
kanedafromparis
 
Extending Kubernetes with Operators
Extending Kubernetes with OperatorsExtending Kubernetes with Operators
Extending Kubernetes with Operators
peychevi
 
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerJDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
PROIDEA
 
Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020
Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020
Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020
VMware Tanzu
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenSpring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in Heaven
Joshua Long
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
Ivan Ma
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
Paul Czarkowski
 
Drools 6 deep dive
Drools 6 deep diveDrools 6 deep dive
Drools 6 deep dive
Mario Fusco
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Tobias Schneck
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
HungWei Chiu
 
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
Mark A
 
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDays Riga
 
使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster 使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster
inwin stack
 
Coldbox developer training – session 5
Coldbox developer training – session 5Coldbox developer training – session 5
Coldbox developer training – session 5Billie Berzinskas
 
Spring Boot Loves K8s
Spring Boot Loves K8sSpring Boot Loves K8s
Spring Boot Loves K8s
VMware Tanzu
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
Javier Eguiluz
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Toru Wonyoung Choi
 
Brief intro to K8s controller and operator
Brief intro to K8s controller and operator Brief intro to K8s controller and operator
Brief intro to K8s controller and operator
Shang Xiang Fan
 
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTOClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
Altinity Ltd
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
Satnam Singh
 

Similar to A Series of Fortunate Events: Building an Operator in Java (20)

DevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdfDevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdf
 
Extending Kubernetes with Operators
Extending Kubernetes with OperatorsExtending Kubernetes with Operators
Extending Kubernetes with Operators
 
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerJDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
 
Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020
Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020
Delivering-Off-The-Shelf Software with Kubernetes- November 12, 2020
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenSpring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in Heaven
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Drools 6 deep dive
Drools 6 deep diveDrools 6 deep dive
Drools 6 deep dive
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
BizSpark SF Lightning Talk: "Automated Testing (Unit, Integration and Systems...
 
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
 
使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster 使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster
 
Coldbox developer training – session 5
Coldbox developer training – session 5Coldbox developer training – session 5
Coldbox developer training – session 5
 
Spring Boot Loves K8s
Spring Boot Loves K8sSpring Boot Loves K8s
Spring Boot Loves K8s
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
Brief intro to K8s controller and operator
Brief intro to K8s controller and operator Brief intro to K8s controller and operator
Brief intro to K8s controller and operator
 
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTOClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
 

More from VMware Tanzu

Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
VMware Tanzu
 
What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
VMware Tanzu
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
VMware Tanzu
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
VMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
VMware Tanzu
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
VMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
VMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
VMware Tanzu
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
VMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
VMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
VMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
VMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
VMware Tanzu
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
VMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
VMware Tanzu
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
VMware Tanzu
 

More from VMware Tanzu (20)

Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 

Recently uploaded

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 

Recently uploaded (20)

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 

A Series of Fortunate Events: Building an Operator in Java

  • 1. A series of fortunate events Building an operator in Java September 1–2, 2021 springone.io 1 Bella Bai @bellalleb_bai LittleBaiBai Alberto C. Ríos @Albertoimpl Albertoimpl Sample app: https://github.com/building-k8s-operator/kubernetes-java-operator-sample
  • 2. What is an operator?
  • 3. 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. 3 -- Kubernetes Documentation Quote source: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
  • 4. Control loop of operators 4 Image source: https://github.com/cncf/tag-app-delivery/blob/master/operator-wg/whitepaper/Operator-WhitePaper_v1-0.md#operator-components-in-kubernetes
  • 5. An operator is a Kubernetes controller that understands two domains: Kubernetes and something else. By combining knowledge of both domains, it can automate tasks that usually require a human operator that understands both domains. 5 -- Jimmy Zelinskie Quote source: https://github.com/kubeflow/tf-operator/issues/300#issuecomment-357527937
  • 6. The “business” context in our sample app 6 apiVersion: "operator.example.com/v1alpha1" kind: AdoptionCenter metadata: name: kittens-dream-land apiVersion: "operator.example.com/v1alpha1" kind: CatForAdoption metadata: name: my-precious-fluffy-ball spec: name: Chocobo dateOfBirth: 2014-09-17 description: She is chubby, lazy ... adoptionCenterName: kittens-dream-land The AdoptionCenter icon is made by Freepik: https://www.flaticon.com/
  • 7. The “business” context in our sample app 7 The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/
  • 8. When to and when not to?
  • 9. When do we want to use an operator ● Deploying applications on demand ● Backing up and restoring an application's state ● Automating application upgrades ● Provide a decentralized way to manage centralized resources 9
  • 10. When NOT to use an operator ● It is just an app with some configuration ● You don't need some special business logic for handling most of the operational work and can deploy it as it is ● When you can just deploy everything with Helm or Kustomize ● No need for any kind of persistence nor status to be backed 10
  • 12. Starting from scratch 12 ● Pick an operator library with Spring support ○ Kubernetes Java Client ○ Java Operator SDK ● Generate models based on your CRDs ○ Or generate your CRDs based on your model ○ Maintain single source of truth ● Setup your controller with resource listeners Kubernetes Java Client: https://github.com/kubernetes-client/java Java Operator SDK: https://github.com/java-operator-sdk/java-operator-sdk
  • 13. @Bean public Controller adoptionCenterController( SharedInformerFactory sharedInformerFactory, AdoptionCenterReconciler reconciler) { return ControllerBuilder .defaultBuilder(sharedInformerFactory) .watch((q) -> ControllerBuilder .controllerWatchBuilder(V1alpha1AdoptionCenter.class, q) .withOnDeleteFilter((resource, cache) -> false) .withOnUpdateFilter((old, new) -> false) .withOnAddFilter((resource) -> true) .build()) .withReconciler(reconciler) .withName(AdoptionCenterReconciler.CONTROLLER_NAME) .build(); } Example controller 13
  • 14. Starting from scratch 14 ● Pick an operator library with Spring support ○ Kubernetes Java Client ○ Java Operator SDK ● Generate models based on your CRDs ○ Or generate your CRDs based on your model ○ Maintain single source of truth ● Setup your controller with resource listeners Kubernetes Java Client: https://github.com/kubernetes-client/java Java Operator SDK: https://github.com/java-operator-sdk/java-operator-sdk ● Start reconciling 💪
  • 15. Example reconciler 15 @Override public Result reconcile(Request request) { V1alpha1AdoptionCenter center = adoptionCenterLister.get(request.getName()) try { V1OwnerReference owner = toOwnerReference(center); configMapUpdater.createConfigMap(owner); deploymentEditor.createDeployment(owner); return new Result(false); } catch (Exception e) { return new Result(true); } }
  • 18. Managing status % kubectl get cats NAME my-precious-fluffy-ball 18
  • 19. Managing status % kubectl get cats NAME my-precious-fluffy-ball 19
  • 20. Managing status % kubectl get cats NAME READY REASON my-precious-fluffy-ball True CatAddedToConfigMap 2 0
  • 21. Managing status schema: openAPIV3Schema : type: object properties : spec: ... status: type: object properties: conditions: type: array items: type: object properties: type: type: string description: The unique identifier of a condition, used to distinguish between other conditions in the resource. status: type: string description: The status of the condition. 21 https://github.com/building-k8s-operator/kubernetes-java-operator-sample/blob/main/ crds/cat-custom-resource-definition.yaml
  • 22. Managing status apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: catsforadoption.operator.example.com spec: ... versions: - name: v1alpha1 served: true storage: true additionalPrinterColumns: - jsonPath: .status.conditions[?(@.type=="Ready")].status name: Ready type: string - jsonPath: .status.conditions[?(@.type=="Ready")].reason name: Reason type: string schema: … 2 2 https://github.com/building-k8s-operator/kubernetes-java-operator-sample/blob/main/ crds/cat-custom-resource-definition.yaml
  • 23. Managing status String patch = String.format("{"status": " + "{ "conditions": " + "[{ "type": "%s", "status": "%s", "lastTransitionTime": "%s", "reason": "%s"}]" + "}}", type, status, ZonedDateTime.now(ZoneOffset.UTC), reason); 2 3 PatchUtils.patch( V1alpha1CatForAdoption.class, () -> api .patchNamespacedCatForAdoptionStatusCall( cat.getMetadata().getName(), cat.getMetadata().getNamespace(), new V1Patch(patch), null, null, null, null), V1Patch.PATCH_FORMAT_JSON_MERGE_PATCH, api.getApiClient());
  • 24. Managing status % kubectl get cats NAME READY REASON my-precious-fluffy-ball True CatAddedToConfigMap 2 4
  • 26. Garbage Collection V1alpha1AdoptionCenter adoptionCenter = lister.namespace(ns).get(name); if(isDeleteRequest(adoptionCenter)) { deploymentService.delete(adoptionCenter); configMapService.delete(adoptionCenter); secretService.delete(adoptionCenter); } 2 6
  • 27. Garbage Collection % kubectl get deployment my-adoption-center -oyaml apiVersion: apps/v1 kind: Deployment metadata: name: my-adoption-center namespace: animal-rescue ownerReferences: - apiVersion: operator.example.com/v1alpha1 blockOwnerDeletion: true controller: true kind: AdoptionCenter name: my-adoption-center uid: 9d09ca3f-f92f-4745-9eb4-9798096b7408 27
  • 28. Garbage Collection 2 8 public V1Deployment createDeployment(V1alpha1AdoptionCenter adoptionCenter){ ... deployment .getMetadata() .addOwnerReferencesItem(toOwnerReference(adoptionCenter)); ... } private V1OwnerReference toOwnerReference(V1alpha1AdoptionCenter adoptionCenter) { return new V1OwnerReference().controller(true) .name(adoptionCenter.getMetadata().getName()) .uid(adoptionCenter.getMetadata().getUid()) .kind(adoptionCenter.getKind()) .apiVersion(adoptionCenter.getApiVersion()) .blockOwnerDeletion(true); }
  • 30. Readiness Gates 3 0 kind: Pod ... spec: readinessGates: - conditionType: "example.com/feature-1" status: Conditions: - ... # built in PodConditions - type: "example.com/feature-1" status: "True" lastProbeTime: null lastTransitionTime: 2021-09-01T00:00:00Z Image source: https://www.reddit.com/r/gatekeeping/comments/bafsci/cat_gatekeeping_guests/
  • 31. Readiness Gates 31 kind: Pod ... spec: readinessGates: - conditionType: "example.com/feature-1" status: Conditions: - ... # built in PodConditions - type: "example.com/feature-1" status: "True" lastProbeTime: null lastTransitionTime: 2021-09-01T00:00:00Z Image source: https://www.reddit.com/r/gatekeeping/comments/bafsci/cat_gatekeeping_guests/
  • 33. Finalizers are namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion. You can use finalizers to control garbage collection of resources. 33 -- Kubernetes Documentation Quote source: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/
  • 34. Removing CatForAdoption without finalizers 34 The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/ Operator Desired State Actual State
  • 35. Removing CatForAdoption without finalizers 3 5 The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/ Operator Desired State Actual State Return “Null”
  • 36. Actual State Desired State Return “Null” Removing CatForAdoption without finalizers 3 6 The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/ Operator
  • 37. Removing CatForAdoption with finalizers 37 The AdoptionCenter icons are made by Freepik: https://www.flaticon.com/ Operator Desired State Actual State metadata.deletionTimeStamp != null
  • 38. Add / remove finalizer boolean toDelete = cat.getMetadata().getDeletionTimestamp() != null; if (!toDelete) { boolean notFound = cat.getMetadata().getFinalizers() == null || cat.getMetadata().getFinalizers().isEmpty(); if (notFound) { catFinalizerEditor.add(cat); } upsertCatToAdoptionCenter(cat); } else { removeCatFromAdoptionCenter(cat); catFinalizerEditor.remove(cat); } 38
  • 39. CatFinalizerEditor code example public V1alpha1CatForAdoption add(V1alpha1CatForAdoption cat) throws ApiException { return PatchUtils.patch( V1alpha1CatForAdoption.class, () -> api.patchNamespacedCatForAdoptionCall( cat.getMetadata().getName(), cat.getMetadata().getNamespace(), new V1Patch("{"metadata":{"finalizers":["" + FINALIZER_STRING + ""]}}"), null, null, null, null), V1Patch.PATCH_FORMAT_JSON_MERGE_PATCH, api.getApiClient()); } 3 9
  • 40. Watch out when you uninstall 4 0 ● Resources pending delete without operator ● What to do? ○ Pre-delete hook in operator ○ Pre-delete hook in Helm or other packaging options ○ Cancel uninstallation ○ Carefully order the uninstall process ○ Just document as known issue
  • 42. Custom Resource Validation 4 2 Create/Update Custom Resource Request Request Decoding & Conversion Validation Storage Conversion etcd Response Encoding & Conversion
  • 43. Syntactic validation schema: openAPIV3Schema: … name: type: string description: The name of the cat dateOfBirth: type: string format: date description: Date of birth of the cat in the format defined in RFC 3339 description: type: string description: The description of the cat adoptionCenterName: type: string description: Name of the adoption center to register this cat to required: ["adoptionCenterName", "name"] 43
  • 44. Syntactic validation anyOf: - properties: spec: required: ["propertyA"] - properties: spec: properties: propertyB: items: required: ["propertyC"] 44
  • 45. Custom Resource Validation 4 5 Create/Update Custom Resource Request Request Decoding & Conversion Validation Storage Conversion etcd Response Encoding & Conversion
  • 46. Custom Resource Validation 4 6 Create/Update Custom Resource Request Request Decoding & Conversion Admission Storage Conversion etcd Response Encoding & Conversion Mutating webhooks Validation Validating webhooks
  • 47. Semantic validation public V1beta1AdmissionReviewValidation validate(V1beta1AdmissionReview request) { boolean isAllowed = validate(request.getRequest().getOldObject().get("spec")); V1beta1AdmissionReviewResponse response = new V1beta1AdmissionReviewResponse(); response.setAllowed(isAllowed); return new V1beta1AdmissionReviewValidation(response); } 47
  • 51. Testing ● Unit Tests ● Component Tests: Closed-box test from the Operator's perspective We do not assert correctness of the deployed application but assert on the values it was deployed with. 51
  • 53. @Autowired private CatFinalizerEditor finalizerEditor; @Autowired private TestK8sClient testK8sClient; @BeforeAll void createCrd() { testK8sClient.createCatCrd();} @Test void add_shouldAddFinalizerToCatResource () throws ApiException { V1alpha1CatForAdoption existing = testK8sClient.createCat(TEST_NAMESPACE, resourceName); V1alpha1CatForAdoption returned = finalizerEditor.add(existing); assertThat(returned.getMetadata().getFinalizers()).contains( FINALIZER_STRING); V1alpha1CatForAdoption catFromApiServer =api.readNamespacedCatForAdoption( resourceName, TEST_NAMESPACE, null, null); assertThat(catFromApiServer.getMetadata().getFinalizers()).contains( FINALIZER_STRING); } Component Tests 5 3
  • 54. Testing ● Unit Tests ● Component Tests ● Acceptance Tests: Testing the system as a whole Using a real environment and installing the product as a user would. 5 4
  • 55. @Test void journeyTest() throws Exception { V1alpha1AdoptionCenter adoptionCenter = testK8sClient.createAdoptionCenter(); assertThatSubResourcesAreDeployed(adoptionCenter); assertThatAdoptionCenterHasCat(adoptionCenter.getMetadata().getName(), 0); V1alpha1CatForAdoption cat = testK8sClient.createCat("default", "my-cat"); waitForReconciliationtoTriggerRestart(); assertThatAdoptionCenterHasCat(adoptionCenter.getMetadata().getName(), 1, cat); testK8sClient.deleteCat("default", "my-cat"); waitForReconciliationtoTriggerRestart(); assertThatAdoptionCenterHasCat(adoptionCenter.getMetadata().getName(), 0); testK8sClient.deleteAdoptionCenter(adoptionCenter.getMetadata().getName()); assertThatSubResourcesAreDeleted(adoptionCenter); } Acceptance tests 5 5
  • 58. Closing notes ● Operators are excellent for managing continuous reconciliation 5 8
  • 59. Closing notes ● Operators are excellent for managing continuous reconciliation 5 9 ● Operators are hard to maintain and develop
  • 61. Closing notes ● Generate your Java classes from CRD: https://github.com/building-k8s-operator/kubernetes-java-operator-sample#gen erating-java-classes-from-crd ● Use Statuses, Finalizers, Readiness gates and Owner references. ● They can be TDDed! 61
  • 62. Now it’s your turn to try! https://github.com/building-k8s-operator/kubernetes-java- operator-sample
  • 63. Any questions? #springone @SpringOne Thank you! Bella Bai @bellalleb_bai Alberto C. Ríos @Albertoimpl