SlideShare une entreprise Scribd logo
1  sur  63
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Amazon EKS によるスマホゲームのバックエンド運用事例
Amazon EKS によるスマホゲームのバックエンド運用事例Amazon EKS によるスマホゲームのバックエンド運用事例
Amazon EKS によるスマホゲームのバックエンド運用事例gree_tech
 
クラウド時代に必要とされる組織と人材育成について
クラウド時代に必要とされる組織と人材育成についてクラウド時代に必要とされる組織と人材育成について
クラウド時代に必要とされる組織と人材育成についてTrainocate Japan, Ltd.
 
とにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるとにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるMasatoshi Tada
 
The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発Amazon Web Services Japan
 
ソフトウェア構成管理入門
ソフトウェア構成管理入門ソフトウェア構成管理入門
ソフトウェア構成管理入門智治 長沢
 
Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)
Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)
Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)Takeshi Fukuhara
 
Spring Cloud Gateway on Kubernetes
Spring Cloud Gateway on KubernetesSpring Cloud Gateway on Kubernetes
Spring Cloud Gateway on KubernetesTakeshi Ogawa
 
アジャイル開発とメトリクス
アジャイル開発とメトリクスアジャイル開発とメトリクス
アジャイル開発とメトリクスRakuten Group, Inc.
 
DeNAの分析を支える分析基盤
DeNAの分析を支える分析基盤DeNAの分析を支える分析基盤
DeNAの分析を支える分析基盤Kenshin Yamada
 
パフォーマンス ボトルネック 国内あるある事例
パフォーマンス ボトルネック 国内あるある事例パフォーマンス ボトルネック 国内あるある事例
パフォーマンス ボトルネック 国内あるある事例日本Javaユーザーグループ
 
Domain Modeling Made Functional (DevTernity 2022)
Domain Modeling Made Functional (DevTernity 2022)Domain Modeling Made Functional (DevTernity 2022)
Domain Modeling Made Functional (DevTernity 2022)Scott Wlaschin
 
Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)
Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)
Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)Keigo Suda
 
ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]
ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]
ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]Koichiro Matsuoka
 
VMware の Tanzu の OSS の TUNA ???
VMware の Tanzu の OSS の TUNA ???VMware の Tanzu の OSS の TUNA ???
VMware の Tanzu の OSS の TUNA ???Hirotaka Sato
 
JJUG CCC リクルートの Java に対する取り組み
JJUG CCC リクルートの Java に対する取り組みJJUG CCC リクルートの Java に対する取り組み
JJUG CCC リクルートの Java に対する取り組みRecruit Technologies
 
Google Cloud のネットワークとロードバランサ
Google Cloud のネットワークとロードバランサGoogle Cloud のネットワークとロードバランサ
Google Cloud のネットワークとロードバランサGoogle Cloud Platform - Japan
 

Tendances (20)

Amazon EKS によるスマホゲームのバックエンド運用事例
Amazon EKS によるスマホゲームのバックエンド運用事例Amazon EKS によるスマホゲームのバックエンド運用事例
Amazon EKS によるスマホゲームのバックエンド運用事例
 
クラウド時代に必要とされる組織と人材育成について
クラウド時代に必要とされる組織と人材育成についてクラウド時代に必要とされる組織と人材育成について
クラウド時代に必要とされる組織と人材育成について
 
とにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるとにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みる
 
The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発
 
ソフトウェア構成管理入門
ソフトウェア構成管理入門ソフトウェア構成管理入門
ソフトウェア構成管理入門
 
KafkaとPulsar
KafkaとPulsarKafkaとPulsar
KafkaとPulsar
 
Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)
Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)
Part 4: Power Platform 概説 (製造リファレンス・アーキテクチャ勉強会)
 
Keycloak入門
Keycloak入門Keycloak入門
Keycloak入門
 
Spring Cloud Gateway on Kubernetes
Spring Cloud Gateway on KubernetesSpring Cloud Gateway on Kubernetes
Spring Cloud Gateway on Kubernetes
 
アジャイル開発とメトリクス
アジャイル開発とメトリクスアジャイル開発とメトリクス
アジャイル開発とメトリクス
 
DeNAの分析を支える分析基盤
DeNAの分析を支える分析基盤DeNAの分析を支える分析基盤
DeNAの分析を支える分析基盤
 
パフォーマンス ボトルネック 国内あるある事例
パフォーマンス ボトルネック 国内あるある事例パフォーマンス ボトルネック 国内あるある事例
パフォーマンス ボトルネック 国内あるある事例
 
Domain Modeling Made Functional (DevTernity 2022)
Domain Modeling Made Functional (DevTernity 2022)Domain Modeling Made Functional (DevTernity 2022)
Domain Modeling Made Functional (DevTernity 2022)
 
Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)
Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)
Apache Kafka & Kafka Connectを に使ったデータ連携パターン(改めETLの実装)
 
ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]
ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]
ドメイン駆動設計のプラクティスでカバーできること、できないこと[DDD]
 
今さら聞けない人のためのKubernetes超入門
今さら聞けない人のためのKubernetes超入門今さら聞けない人のためのKubernetes超入門
今さら聞けない人のためのKubernetes超入門
 
VMware の Tanzu の OSS の TUNA ???
VMware の Tanzu の OSS の TUNA ???VMware の Tanzu の OSS の TUNA ???
VMware の Tanzu の OSS の TUNA ???
 
保守運用コストの適正化事例 20120725
保守運用コストの適正化事例 20120725保守運用コストの適正化事例 20120725
保守運用コストの適正化事例 20120725
 
JJUG CCC リクルートの Java に対する取り組み
JJUG CCC リクルートの Java に対する取り組みJJUG CCC リクルートの Java に対する取り組み
JJUG CCC リクルートの Java に対する取り組み
 
Google Cloud のネットワークとロードバランサ
Google Cloud のネットワークとロードバランサGoogle Cloud のネットワークとロードバランサ
Google Cloud のネットワークとロードバランサ
 

Similaire à A Series of Fortunate Events: Building an Operator in Java

DevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdfDevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdfkanedafromparis
 
Extending Kubernetes with Operators
Extending Kubernetes with OperatorsExtending Kubernetes with Operators
Extending Kubernetes with Operatorspeychevi
 
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 BakkerPROIDEA
 
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, 2020VMware 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 HeavenJoshua 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 PythonIvan Ma
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developerPaul Czarkowski
 
Drools 6 deep dive
Drools 6 deep diveDrools 6 deep dive
Drools 6 deep diveMario 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 K8sVMware Tanzu
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricksJavier 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 ExtendedToru 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 CTOAltinity Ltd
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with KubernetesSatnam Singh
 

Similaire à 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
 

Plus de 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 ItVMware 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 2023VMware 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 ScaleVMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware 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 ProductVMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware 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.pdfVMware 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 2023VMware 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 2023VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptxVMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchVMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishVMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - FrenchVMware 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 2023VMware 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 BootVMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerVMware 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 PracticeVMware Tanzu
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsVMware Tanzu
 

Plus de VMware Tanzu (20)

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
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Dernier

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 

Dernier (20)

2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 

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