SlideShare a Scribd company logo
1 of 40
Download to read offline
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
DevOps
Container Image :
“Kubernetes Operator with Java”
_
-
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Charles Sabourdin
https://github.com/shyrkaio - https://www.shyrka.io/
@kanedafromparis
Javaiste
Linuxien
Devoxx France
ParisJUG
OpenSource
Architect
Dev/Ops
https://github.com/kanedafromparis/
- 45:00
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
DevOps
Container Image :
“Kubernetes Operator with Java”
Episode I : What’s an operator
2021/10/12
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes Operator with Java
Part I : just watch
Part II : java operator sdk
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Charles Sabourdin
https://github.com/shyrkaio - https://www.shyrka.io/
@kanedafromparis
Javaiste
Linuxien
Devoxx France
ParisJUG
OpenSource
Architect
Dev/Ops
https://github.com/kanedafromparis/
- 45:00
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Operators
sources : https://operatorhub.io
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Operators
sources : https://operatorhub.io/getting-started
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
● Agile application creation and deployment: Increased ease and efficiency
of container image creation compared to VM image use.
● Continuous development, integration, and deployment
● Dev and Ops separation of concerns
● Environmental consistency across development, testing, and production
● Application-centric management: Raises the level of abstraction from
running an OS on virtual hardware to running an application on an OS
using logical resources.
● Loosely coupled, distributed, elastic, liberated micro-services
● Resource isolation: Predictable application performance.
● Resource utilization: High efficiency and density.
Kubernetes is a portable, extensible open-source platform for managing containerized workloads and services, that facilitates both
declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely
available.
Kubernetes
sources : https://kubernetes.io/docs/concepts/architecture/cloud-controller/
https://kubernetes.io/blog/2018/07/18/11-ways-not-to-get-hacked/
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes api-ressources & api-versions
sources : https://kubernetes.io/docs/reference/kubectl/overview/
I. Introduction
$ kubectl api-resources
NAME SHORTNAMES APIVERSION NAMESPACED KIND
bindings v1 true Binding
componentstatuses cs v1 false ComponentStatus
configmaps cm v1 true ConfigMap
endpoints ep v1 true Endpoints
events ev v1 true Event
limitranges limits v1 true LimitRange
namespaces ns v1 false Namespace
nodes no v1 false Node
persistentvolumeclaims pvc v1 true PersistentVolumeClaim
persistentvolumes pv v1 false PersistentVolume
pods po v1 true Pod
podtemplates v1 true PodTemplate
replicationcontrollers rc v1 true ReplicationController
resourcequotas quota v1 true ResourceQuota
secrets v1 true Secret
serviceaccounts sa v1 true ServiceAccount
services svc v1 true Service
ingressclasses networking.k8s.io/v1 false IngressClass
ingresses ing networking.k8s.io/v1 true Ingress
deployments deploy apps/v1 true Deployment
…
...
$ kubectl api-versions
admissionregistration.k8s.io/v1
apiextensions.k8s.io/v1
apiregistration.k8s.io/v1
apps/v1
authentication.k8s.io/v1
authorization.k8s.io/v1
autoscaling/v1
autoscaling/v2beta1
autoscaling/v2beta2
batch/v1
batch/v1beta1
...
node.k8s.io/v1
node.k8s.io/v1beta1
policy/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
scheduling.k8s.io/v1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Operators & Controller : Reconciliation loop
sources : https://speakerdeck.com/govargo/inside-of-kubernetes-controller
Actual state
.status
Desired state
.spec
Control
loop
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes ressources & API
sources : https://kubernetes.io/docs/reference/using-api/api-concepts/
I. Introduction
● Cluster-scoped resources:
○ GET /apis/GROUP/VERSION/RESOURCETYPE
return the collection of resources of the resource type
○ GET /apis/GROUP/VERSION/RESOURCETYPE/NAME
return the resource with NAME under the resource type
● Namespace-scoped resources:
○ GET /apis/GROUP/VERSION/RESOURCETYPE
return the collection of all instances of the resource type across all namespaces
○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE
return collection of all instances of the resource type in NAMESPACE
○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE/NAME
return the instance of the resource type with NAME in NAMESPACE
NAME SHORTNAMES APIVERSION NAMESPACED KIND
bindings v1 true Binding
componentstatuses cs v1 false ComponentStatus
configmaps cm v1 true ConfigMap
services svc v1 true Service
ingressclasses networking.k8s.io/v1 false IngressClass
ingresses ing networking.k8s.io/v1 true Ingress
deployments deploy apps/v1 true Deployment
…
...
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes ressources & API
sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
I. Introduction
$ kubectl api-resources
# Check all possible clusters, as your .KUBECONFIG may have multiple contexts:
kubectl config view -o jsonpath='{"Cluster nametServern"}{range .clusters[*]}{.name}{"t"}{.cluster.server}{"n"}{end}'
# Select name of cluster you want to interact with from above output:
export CLUSTER_NAME="op01"
# Point to the API server referring the cluster name
APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}")
# Gets the token value
TOKEN=$(kubectl get secrets -o
jsonpath="{.items[?(@.metadata.annotations['kubernetes.io/service-account.name']=='default')].data.token}"|base64 --decode)
# Explore the API with TOKEN
curl -X GET $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
$ kubectl get ns
# Select name of cluster you want to interact with from above output:
export CLUSTER_NAME="op01"
# Point to the API server referring the cluster name
APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}")
# Check all possible clusters, as your .KUBECONFIG may have multiple contexts:
curl -X GET $APISERVER/api/v1/namespaces?limit=500 
--cert ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.crt 
--key ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.key 
--cacert ${HOME}/.minikube/ca.crt
| jq .items[].metadata.name
Kubernetes ressources & API
sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
$ kubectl get deploy
# Create deployment resources:
kubectl apply -f src/main/hypnos-scenarios/usecase-012/012-sample-deploy.yaml
# Select name of cluster you want to interact with from above output:
export CLUSTER_NAME="op01"
# Point to the API server referring the cluster name
APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}")
# Check all possible clusters, as your .KUBECONFIG may have multiple contexts:
curl -X GET $APISERVER/apis/apps/v1/namespaces/hypnos-smp-012/deployments?limit=500 
--cert ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.crt 
--key ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.key 
--cacert ${HOME}/.minikube/ca.crt
| jq .items[].metadata.name
Kubernetes ressources & API
sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes Java library
I. Introduction
https://github.com/fabric8io/
kubernetes-client
https://github.com/
kubernetes-client/java
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
try (KubernetesClient client = new DefaultKubernetesClient()) {
...
ServiceAccount fabric8 = new ServiceAccountBuilder().withNewMetadata().withName("fabric8").endMetadata().build();
client.serviceAccounts().inNamespace(NAMESPACE).createOrReplace(fabric8);
try {
Deployment deployment = new DeploymentBuilder()
.withNewMetadata()
.withName("nginx")
.endMetadata()
….
.endSpec()
.build();
deployment = client.apps().deployments().inNamespace(NAMESPACE).create(deployment);
...
client.apps().deployments().inNamespace(NAMESPACE).withName(”nginx").scale(2, true);
...
client.resource(deployment).delete();
...
Kubernetes ressources & API
sources : https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples
/src/main/java/io/fabric8/kubernetes/examples/DeploymentExamples.java#L46
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Operators & Controller : Reconciliation loop
sources : https://speakerdeck.com/govargo/inside-of-kubernetes-controller
Actual state
.status
Desired state
.spec
Control
loop
II. Operator and CRD
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes CustomResourceDefinition (CRD)
CustomResourceDefinition represents a resource that should be exposed on the API server.
Let’ introduce Hypnos.
The purpose of `shyrka-hypnos-operator` is to create an operator that will scale up and down resources (deployment,
statefullsate, deploymentConfig).
It is written in “pure” java using fabric8, quarkus, quartz
sources : kubectl explain crd
II. Operator and CRD
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
En pratique (et Yaml)
II. Operator and CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
...
name: hypnox.shyrkaio.github.io
spec:
group: shyrkaio.github.io
names:
kind: Hypnos
listKind: HypnosList
plural: hypnox
singular: hypnos
scope: Cluster
versions:
- ...
- name: v1alpha3
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
storage: true
schema:
openAPIV3Schema:
#https://swagger.io/docs/specification/data-models/data-types/
type: object
properties:
spec:
type: object
properties:
namespaceTargetedLabel:
type: string
nullable: false
#@TODO pattern: ... or switch to a match selector
targetedLabel:
type: string
nullable: true
#@TODO pattern: ... or switch to a match selector
resourceType:
type: array
nullable: false
items:
type: string
enum: [Deployment, StatefulSet, DeploymentConfig]
...
sources : https://github.com/shyrkaio/shyrka-hypnos-operator/blob/main/src/main/jkube/hypnos.crd.yaml
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
En pratique (et Yaml)
II. Operator and CRD
sources : https://github.com/shyrkaio/shyrka-hypnos-operator/blob/main/src/main/jkube/hypnos.crd.yaml
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
En pratique (et Yaml)
II. Operator and CRD
- name: v1alpha3
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
storage: true
schema:
openAPIV3Schema:
...
additionalPrinterColumns:
- name: NameSpace Targeted Label
type: string
description: The label used to select targeted namespace
jsonPath: .spec.namespaceTargetedLabel
- name: Targeted Label
type: string
description: The label used to select resource to touch
jsonPath: .spec.targetedLabel
- name: Resource
type: string
description: The resource type to be scale up / scale down
jsonPath: .spec.resourceType
- name: WakeUp
type: string
description: The Cron Definition for the wake-up call
jsonPath: .spec.wakeup-cron
- name: comments
type: string
description: some comments on this hypnos definition
jsonPath: .spec.comments
sources : https://github.com/shyrkaio/shyrka-hypnos-operator/blob/main/src/main/jkube/hypnos.crd.yaml
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
$ kubectl get hypox
# Create hypnox resources definition:
kubectl apply -f src/main/jkube/hypnos.crd.yaml
# Select name of cluster you want to interact with from above output:
export CLUSTER_NAME="op1"
# Point to the API server referring the cluster name
APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}")
# Check all possible clusters, as your .KUBECONFIG may have multiple contexts:
curl -X GET $APISERVER/apis/shyrkaio.github.io/v1alpha3/hypnox?limit=500 
--cert ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.crt 
--key ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.key 
--cacert ${HOME}/.minikube/ca.crt
| jq .items[].metadata.name
Kubernetes get new resource type
sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
$ kubectl get hypox
# start quarkus in dev mode
mvn quarkus:dev
MVN quarkus:dev
sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
$ mvn package
# Create shyrka-erebus-operators namespace
kubectl create ns shyrka-erebus-operators
kubens shyrka-erebus-operators
# Create local build
mvn package k8s:build -Pkubernetes
# apply server resources definition to the cluster
mvn k8s:resource -Pkubernetes
# apply server resources definition to the cluster
mvn k8s:apply -Pkubernetes
MVN create build
sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Thank you
● Questions ?
- 00:00
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
DevOps
Container Image :
“Kubernetes Operator with Java”
Episode II : java operator sdk
2021/10/12
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes Operator with Java
Part I : just watch
Part II : java operator sdk
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Charles Sabourdin
https://github.com/shyrkaio - https://www.shyrka.io/
@kanedafromparis
Javaiste
Linuxien
Devoxx France
ParisJUG
OpenSource
Architect
Dev/Ops
https://github.com/kanedafromparis/
- 45:00
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Operators
sources : https://operatorhub.io/getting-started
I. Introduction - reminder
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.
Les opérateurs sont des programmes utilisant les mécanismes d’extensions de Kubernetes (custom resources)
pour automatiser la gestion d’applications et leurs composants.
Les opérateurs respectent les principes de développement de Kubernetes, notamment la boucle de contrôle
(control loop).
Actual state
.status
Desired state
.spec
Control
loop
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Operators
sources : https://operatorhub.io/getting-started
I. Introduction - reminder
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Kubernetes resources & API
sources : https://kubernetes.io/docs/reference/using-api/api-concepts/
I. Introduction - reminder
A resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind;
● Cluster-scoped resources:
○ GET /apis/GROUP/VERSION/RESOURCETYPE
return the collection of resources of the resource type
○ GET /apis/GROUP/VERSION/RESOURCETYPE/NAME
return the resource with NAME under the resource type
● Namespace-scoped resources:
○ GET /apis/GROUP/VERSION/RESOURCETYPE
return the collection of all instances of the resource type across all namespaces
○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE
return collection of all instances of the resource type in NAMESPACE
○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE/NAME
return the instance of the resource type with NAME in NAMESPACE
Custom resources are extensions of the Kubernetes API
NAME SHORTNAMES APIVERSION NAMESPACED KIND
bindings v1 true Binding
componentstatuses cs v1 false ComponentStatus
configmaps cm v1 true ConfigMap
services svc v1 true Service
ingressclasses networking.k8s.io/v1 false IngressClass
ingresses ing networking.k8s.io/v1 true Ingress
deployments deploy apps/v1 true Deployment
…
...
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Java Operator SDK
sources : https://javaoperatorsdk.io/
II. Java Operator SDK
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Java Operator SDK
sources : https://javaoperatorsdk.io/
II. Java Operator SDK
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Java Operator SDK
sources : https://github.com/java-operator-sdk/java-operator-sdk
II. Java Operator SDK
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Tom Operator
sources : https://operatorhub.io/getting-started
I. Introduction
● Create a tomcat deployment
● Use CRD to limit configuration
● Keep the deployment event when deleted
● Create IT test
● Create GithubAction IT test (local via act)
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
$ mvn archetype
# create project folder
mkdir sample-operator &&
cd sample-operator
# localy install jk8ps archetype
git clone https://github.com/shyrkaio/jk8ps-mvn-archetype.git && 
cd jk8ps-mvn-archetypedefault && 
mvn clean install archetype:update-local-catalog
Maven Archetype : jk8ps-mvn-archetype
sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
$ mvn archetype
# create project folder
mkdir sample-operator &&
cd sample-operator
# localy install jk8ps archetype
git clone https://github.com/shyrkaio/jk8ps-mvn-archetype.git && 
cd jk8ps-mvn-archetypedefault && 
mvn clean install archetype:update-local-catalog
Maven Archetype : jk8ps-mvn-archetype
I. Introduction
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Maven Archetype : jk8ps-mvn-archetype
$ mvn archetype
# create project folder
cd ../
mkdir tomop && 
cd tomop
# localy install jk8ps archetype
mvn archetype:generate -DarchetypeGroupId=io.github.shyrkaio.archetypes 
-DarchetypeArtifactId=default 
-DarchetypeVersion=0.0.1-SNAPSHOT 
-DgroupId=io.github.shyrkaio.sample 
-DartifactId=tom 
-Dversion=1.0-SNAPSHOT 
-Dcrd-name=Tom 
-Dcrd-name-lowercase=tom
I. Introduction
https://github.com/kanedafromparis/khool-simpleoperator
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Tom Operator
I. Introduction
● create a tomcat deployment and it’s service
● only take tomcat version in it’s CRD
● keep the deployment
https://github.com/kanedafromparis/khool-simpleoperator
Kubernetes Operator with Java
(operators in java)
2021/11/18
#J2K
Thank you
● Questions ?
- 00:00

More Related Content

Similar to DevOpSec_KubernetesOperatorUsingJava.pdf

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
 
Shakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformShakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformMinku Lee
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibilityDocker, Inc.
 
client-go: The Good, The Bad and The Ugly
client-go: The Good, The Bad and The Uglyclient-go: The Good, The Bad and The Ugly
client-go: The Good, The Bad and The UglyLili Cosic
 
Kubernetes @ Nanit
Kubernetes @ NanitKubernetes @ Nanit
Kubernetes @ NanitChen Fisher
 
Ports, pods and proxies
Ports, pods and proxiesPorts, pods and proxies
Ports, pods and proxiesLibbySchulze
 
Deploying Flink on Kubernetes - David Anderson
 Deploying Flink on Kubernetes - David Anderson Deploying Flink on Kubernetes - David Anderson
Deploying Flink on Kubernetes - David AndersonVerverica
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacySteve Wong
 
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 Cloud-native applications with Java and Kubernetes - Yehor Volkov Cloud-native applications with Java and Kubernetes - Yehor Volkov
Cloud-native applications with Java and Kubernetes - Yehor VolkovKuberton
 
Kubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen FisherKubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen FisherDoiT International
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudMassimiliano Dessì
 
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCome costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCodemotion
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpToshiaki Maki
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-finalMichel Schildmeijer
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB
 
Containerizing your Security Operations Center
Containerizing your Security Operations CenterContainerizing your Security Operations Center
Containerizing your Security Operations CenterJimmy Mesta
 
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
 
Web scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannelWeb scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannelpurpleocean
 
DCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDocker, Inc.
 

Similar to DevOpSec_KubernetesOperatorUsingJava.pdf (20)

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
 
Shakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformShakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud Platform
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
client-go: The Good, The Bad and The Ugly
client-go: The Good, The Bad and The Uglyclient-go: The Good, The Bad and The Ugly
client-go: The Good, The Bad and The Ugly
 
Kubernetes @ Nanit
Kubernetes @ NanitKubernetes @ Nanit
Kubernetes @ Nanit
 
Ports, pods and proxies
Ports, pods and proxiesPorts, pods and proxies
Ports, pods and proxies
 
Deploying Flink on Kubernetes - David Anderson
 Deploying Flink on Kubernetes - David Anderson Deploying Flink on Kubernetes - David Anderson
Deploying Flink on Kubernetes - David Anderson
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacy
 
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 Cloud-native applications with Java and Kubernetes - Yehor Volkov Cloud-native applications with Java and Kubernetes - Yehor Volkov
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 
Kubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen FisherKubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen Fisher
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCome costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjp
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
Containerizing your Security Operations Center
Containerizing your Security Operations CenterContainerizing your Security Operations Center
Containerizing your Security Operations Center
 
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)
 
Web scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannelWeb scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannel
 
DCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDCEU 18: Docker Container Networking
DCEU 18: Docker Container Networking
 

More from kanedafromparis

DevOpSec_DockerNPodMan-20230220.pdf
DevOpSec_DockerNPodMan-20230220.pdfDevOpSec_DockerNPodMan-20230220.pdf
DevOpSec_DockerNPodMan-20230220.pdfkanedafromparis
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Dockerkanedafromparis
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019kanedafromparis
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_
Dev opsec dockerimage_patch_n_lifecyclemanagement_Dev opsec dockerimage_patch_n_lifecyclemanagement_
Dev opsec dockerimage_patch_n_lifecyclemanagement_kanedafromparis
 
Java in docker devoxx ma 2018
Java in docker devoxx ma 2018Java in docker devoxx ma 2018
Java in docker devoxx ma 2018kanedafromparis
 
Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018kanedafromparis
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introductionkanedafromparis
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introductionkanedafromparis
 

More from kanedafromparis (8)

DevOpSec_DockerNPodMan-20230220.pdf
DevOpSec_DockerNPodMan-20230220.pdfDevOpSec_DockerNPodMan-20230220.pdf
DevOpSec_DockerNPodMan-20230220.pdf
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_
Dev opsec dockerimage_patch_n_lifecyclemanagement_Dev opsec dockerimage_patch_n_lifecyclemanagement_
Dev opsec dockerimage_patch_n_lifecyclemanagement_
 
Java in docker devoxx ma 2018
Java in docker devoxx ma 2018Java in docker devoxx ma 2018
Java in docker devoxx ma 2018
 
Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
 

Recently uploaded

Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsPriya Reddy
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiMonica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查ydyuyu
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...kumargunjan9515
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Balliameghakumariji156
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 

Recently uploaded (20)

Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 

DevOpSec_KubernetesOperatorUsingJava.pdf

  • 1. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K DevOps Container Image : “Kubernetes Operator with Java” _ -
  • 2. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Charles Sabourdin https://github.com/shyrkaio - https://www.shyrka.io/ @kanedafromparis Javaiste Linuxien Devoxx France ParisJUG OpenSource Architect Dev/Ops https://github.com/kanedafromparis/ - 45:00
  • 3. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K DevOps Container Image : “Kubernetes Operator with Java” Episode I : What’s an operator 2021/10/12
  • 4. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes Operator with Java Part I : just watch Part II : java operator sdk
  • 5. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Charles Sabourdin https://github.com/shyrkaio - https://www.shyrka.io/ @kanedafromparis Javaiste Linuxien Devoxx France ParisJUG OpenSource Architect Dev/Ops https://github.com/kanedafromparis/ - 45:00
  • 6. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Operators sources : https://operatorhub.io I. Introduction
  • 7. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Operators sources : https://operatorhub.io/getting-started I. Introduction
  • 8. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K ● Agile application creation and deployment: Increased ease and efficiency of container image creation compared to VM image use. ● Continuous development, integration, and deployment ● Dev and Ops separation of concerns ● Environmental consistency across development, testing, and production ● Application-centric management: Raises the level of abstraction from running an OS on virtual hardware to running an application on an OS using logical resources. ● Loosely coupled, distributed, elastic, liberated micro-services ● Resource isolation: Predictable application performance. ● Resource utilization: High efficiency and density. Kubernetes is a portable, extensible open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available. Kubernetes sources : https://kubernetes.io/docs/concepts/architecture/cloud-controller/ https://kubernetes.io/blog/2018/07/18/11-ways-not-to-get-hacked/ I. Introduction
  • 9. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes api-ressources & api-versions sources : https://kubernetes.io/docs/reference/kubectl/overview/ I. Introduction $ kubectl api-resources NAME SHORTNAMES APIVERSION NAMESPACED KIND bindings v1 true Binding componentstatuses cs v1 false ComponentStatus configmaps cm v1 true ConfigMap endpoints ep v1 true Endpoints events ev v1 true Event limitranges limits v1 true LimitRange namespaces ns v1 false Namespace nodes no v1 false Node persistentvolumeclaims pvc v1 true PersistentVolumeClaim persistentvolumes pv v1 false PersistentVolume pods po v1 true Pod podtemplates v1 true PodTemplate replicationcontrollers rc v1 true ReplicationController resourcequotas quota v1 true ResourceQuota secrets v1 true Secret serviceaccounts sa v1 true ServiceAccount services svc v1 true Service ingressclasses networking.k8s.io/v1 false IngressClass ingresses ing networking.k8s.io/v1 true Ingress deployments deploy apps/v1 true Deployment … ... $ kubectl api-versions admissionregistration.k8s.io/v1 apiextensions.k8s.io/v1 apiregistration.k8s.io/v1 apps/v1 authentication.k8s.io/v1 authorization.k8s.io/v1 autoscaling/v1 autoscaling/v2beta1 autoscaling/v2beta2 batch/v1 batch/v1beta1 ... node.k8s.io/v1 node.k8s.io/v1beta1 policy/v1 policy/v1beta1 rbac.authorization.k8s.io/v1 scheduling.k8s.io/v1 storage.k8s.io/v1 storage.k8s.io/v1beta1 v1
  • 10. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Operators & Controller : Reconciliation loop sources : https://speakerdeck.com/govargo/inside-of-kubernetes-controller Actual state .status Desired state .spec Control loop I. Introduction
  • 11. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes ressources & API sources : https://kubernetes.io/docs/reference/using-api/api-concepts/ I. Introduction ● Cluster-scoped resources: ○ GET /apis/GROUP/VERSION/RESOURCETYPE return the collection of resources of the resource type ○ GET /apis/GROUP/VERSION/RESOURCETYPE/NAME return the resource with NAME under the resource type ● Namespace-scoped resources: ○ GET /apis/GROUP/VERSION/RESOURCETYPE return the collection of all instances of the resource type across all namespaces ○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE return collection of all instances of the resource type in NAMESPACE ○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE/NAME return the instance of the resource type with NAME in NAMESPACE NAME SHORTNAMES APIVERSION NAMESPACED KIND bindings v1 true Binding componentstatuses cs v1 false ComponentStatus configmaps cm v1 true ConfigMap services svc v1 true Service ingressclasses networking.k8s.io/v1 false IngressClass ingresses ing networking.k8s.io/v1 true Ingress deployments deploy apps/v1 true Deployment … ...
  • 12. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes ressources & API sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ I. Introduction $ kubectl api-resources # Check all possible clusters, as your .KUBECONFIG may have multiple contexts: kubectl config view -o jsonpath='{"Cluster nametServern"}{range .clusters[*]}{.name}{"t"}{.cluster.server}{"n"}{end}' # Select name of cluster you want to interact with from above output: export CLUSTER_NAME="op01" # Point to the API server referring the cluster name APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}") # Gets the token value TOKEN=$(kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes.io/service-account.name']=='default')].data.token}"|base64 --decode) # Explore the API with TOKEN curl -X GET $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
  • 13. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K $ kubectl get ns # Select name of cluster you want to interact with from above output: export CLUSTER_NAME="op01" # Point to the API server referring the cluster name APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}") # Check all possible clusters, as your .KUBECONFIG may have multiple contexts: curl -X GET $APISERVER/api/v1/namespaces?limit=500 --cert ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.crt --key ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.key --cacert ${HOME}/.minikube/ca.crt | jq .items[].metadata.name Kubernetes ressources & API sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ I. Introduction
  • 14. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K $ kubectl get deploy # Create deployment resources: kubectl apply -f src/main/hypnos-scenarios/usecase-012/012-sample-deploy.yaml # Select name of cluster you want to interact with from above output: export CLUSTER_NAME="op01" # Point to the API server referring the cluster name APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}") # Check all possible clusters, as your .KUBECONFIG may have multiple contexts: curl -X GET $APISERVER/apis/apps/v1/namespaces/hypnos-smp-012/deployments?limit=500 --cert ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.crt --key ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.key --cacert ${HOME}/.minikube/ca.crt | jq .items[].metadata.name Kubernetes ressources & API sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ I. Introduction
  • 15. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes Java library I. Introduction https://github.com/fabric8io/ kubernetes-client https://github.com/ kubernetes-client/java
  • 16. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K try (KubernetesClient client = new DefaultKubernetesClient()) { ... ServiceAccount fabric8 = new ServiceAccountBuilder().withNewMetadata().withName("fabric8").endMetadata().build(); client.serviceAccounts().inNamespace(NAMESPACE).createOrReplace(fabric8); try { Deployment deployment = new DeploymentBuilder() .withNewMetadata() .withName("nginx") .endMetadata() …. .endSpec() .build(); deployment = client.apps().deployments().inNamespace(NAMESPACE).create(deployment); ... client.apps().deployments().inNamespace(NAMESPACE).withName(”nginx").scale(2, true); ... client.resource(deployment).delete(); ... Kubernetes ressources & API sources : https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples /src/main/java/io/fabric8/kubernetes/examples/DeploymentExamples.java#L46 I. Introduction
  • 17. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Operators & Controller : Reconciliation loop sources : https://speakerdeck.com/govargo/inside-of-kubernetes-controller Actual state .status Desired state .spec Control loop II. Operator and CRD
  • 18. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes CustomResourceDefinition (CRD) CustomResourceDefinition represents a resource that should be exposed on the API server. Let’ introduce Hypnos. The purpose of `shyrka-hypnos-operator` is to create an operator that will scale up and down resources (deployment, statefullsate, deploymentConfig). It is written in “pure” java using fabric8, quarkus, quartz sources : kubectl explain crd II. Operator and CRD
  • 19. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K En pratique (et Yaml) II. Operator and CRD apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: ... name: hypnox.shyrkaio.github.io spec: group: shyrkaio.github.io names: kind: Hypnos listKind: HypnosList plural: hypnox singular: hypnos scope: Cluster versions: - ... - name: v1alpha3 # Each version can be enabled/disabled by Served flag. served: true # One and only one version must be marked as the storage version. storage: true schema: openAPIV3Schema: #https://swagger.io/docs/specification/data-models/data-types/ type: object properties: spec: type: object properties: namespaceTargetedLabel: type: string nullable: false #@TODO pattern: ... or switch to a match selector targetedLabel: type: string nullable: true #@TODO pattern: ... or switch to a match selector resourceType: type: array nullable: false items: type: string enum: [Deployment, StatefulSet, DeploymentConfig] ... sources : https://github.com/shyrkaio/shyrka-hypnos-operator/blob/main/src/main/jkube/hypnos.crd.yaml
  • 20. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K En pratique (et Yaml) II. Operator and CRD sources : https://github.com/shyrkaio/shyrka-hypnos-operator/blob/main/src/main/jkube/hypnos.crd.yaml
  • 21. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K En pratique (et Yaml) II. Operator and CRD - name: v1alpha3 # Each version can be enabled/disabled by Served flag. served: true # One and only one version must be marked as the storage version. storage: true schema: openAPIV3Schema: ... additionalPrinterColumns: - name: NameSpace Targeted Label type: string description: The label used to select targeted namespace jsonPath: .spec.namespaceTargetedLabel - name: Targeted Label type: string description: The label used to select resource to touch jsonPath: .spec.targetedLabel - name: Resource type: string description: The resource type to be scale up / scale down jsonPath: .spec.resourceType - name: WakeUp type: string description: The Cron Definition for the wake-up call jsonPath: .spec.wakeup-cron - name: comments type: string description: some comments on this hypnos definition jsonPath: .spec.comments sources : https://github.com/shyrkaio/shyrka-hypnos-operator/blob/main/src/main/jkube/hypnos.crd.yaml
  • 22. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K $ kubectl get hypox # Create hypnox resources definition: kubectl apply -f src/main/jkube/hypnos.crd.yaml # Select name of cluster you want to interact with from above output: export CLUSTER_NAME="op1" # Point to the API server referring the cluster name APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name=="$CLUSTER_NAME")].cluster.server}") # Check all possible clusters, as your .KUBECONFIG may have multiple contexts: curl -X GET $APISERVER/apis/shyrkaio.github.io/v1alpha3/hypnox?limit=500 --cert ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.crt --key ${HOME}/.minikube/profiles/$CLUSTER_NAME/client.key --cacert ${HOME}/.minikube/ca.crt | jq .items[].metadata.name Kubernetes get new resource type sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ I. Introduction
  • 23. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K $ kubectl get hypox # start quarkus in dev mode mvn quarkus:dev MVN quarkus:dev sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ I. Introduction
  • 24. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K $ mvn package # Create shyrka-erebus-operators namespace kubectl create ns shyrka-erebus-operators kubens shyrka-erebus-operators # Create local build mvn package k8s:build -Pkubernetes # apply server resources definition to the cluster mvn k8s:resource -Pkubernetes # apply server resources definition to the cluster mvn k8s:apply -Pkubernetes MVN create build sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ I. Introduction
  • 25. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Thank you ● Questions ? - 00:00
  • 26. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K DevOps Container Image : “Kubernetes Operator with Java” Episode II : java operator sdk 2021/10/12
  • 27. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes Operator with Java Part I : just watch Part II : java operator sdk
  • 28. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Charles Sabourdin https://github.com/shyrkaio - https://www.shyrka.io/ @kanedafromparis Javaiste Linuxien Devoxx France ParisJUG OpenSource Architect Dev/Ops https://github.com/kanedafromparis/ - 45:00
  • 29. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Operators sources : https://operatorhub.io/getting-started I. Introduction - reminder 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. Les opérateurs sont des programmes utilisant les mécanismes d’extensions de Kubernetes (custom resources) pour automatiser la gestion d’applications et leurs composants. Les opérateurs respectent les principes de développement de Kubernetes, notamment la boucle de contrôle (control loop). Actual state .status Desired state .spec Control loop
  • 30. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Operators sources : https://operatorhub.io/getting-started I. Introduction - reminder
  • 31. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Kubernetes resources & API sources : https://kubernetes.io/docs/reference/using-api/api-concepts/ I. Introduction - reminder A resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; ● Cluster-scoped resources: ○ GET /apis/GROUP/VERSION/RESOURCETYPE return the collection of resources of the resource type ○ GET /apis/GROUP/VERSION/RESOURCETYPE/NAME return the resource with NAME under the resource type ● Namespace-scoped resources: ○ GET /apis/GROUP/VERSION/RESOURCETYPE return the collection of all instances of the resource type across all namespaces ○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE return collection of all instances of the resource type in NAMESPACE ○ GET /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE/NAME return the instance of the resource type with NAME in NAMESPACE Custom resources are extensions of the Kubernetes API NAME SHORTNAMES APIVERSION NAMESPACED KIND bindings v1 true Binding componentstatuses cs v1 false ComponentStatus configmaps cm v1 true ConfigMap services svc v1 true Service ingressclasses networking.k8s.io/v1 false IngressClass ingresses ing networking.k8s.io/v1 true Ingress deployments deploy apps/v1 true Deployment … ...
  • 32. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Java Operator SDK sources : https://javaoperatorsdk.io/ II. Java Operator SDK
  • 33. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Java Operator SDK sources : https://javaoperatorsdk.io/ II. Java Operator SDK
  • 34. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Java Operator SDK sources : https://github.com/java-operator-sdk/java-operator-sdk II. Java Operator SDK
  • 35. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Tom Operator sources : https://operatorhub.io/getting-started I. Introduction ● Create a tomcat deployment ● Use CRD to limit configuration ● Keep the deployment event when deleted ● Create IT test ● Create GithubAction IT test (local via act)
  • 36. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K $ mvn archetype # create project folder mkdir sample-operator && cd sample-operator # localy install jk8ps archetype git clone https://github.com/shyrkaio/jk8ps-mvn-archetype.git && cd jk8ps-mvn-archetypedefault && mvn clean install archetype:update-local-catalog Maven Archetype : jk8ps-mvn-archetype sources : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ I. Introduction
  • 37. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K $ mvn archetype # create project folder mkdir sample-operator && cd sample-operator # localy install jk8ps archetype git clone https://github.com/shyrkaio/jk8ps-mvn-archetype.git && cd jk8ps-mvn-archetypedefault && mvn clean install archetype:update-local-catalog Maven Archetype : jk8ps-mvn-archetype I. Introduction
  • 38. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Maven Archetype : jk8ps-mvn-archetype $ mvn archetype # create project folder cd ../ mkdir tomop && cd tomop # localy install jk8ps archetype mvn archetype:generate -DarchetypeGroupId=io.github.shyrkaio.archetypes -DarchetypeArtifactId=default -DarchetypeVersion=0.0.1-SNAPSHOT -DgroupId=io.github.shyrkaio.sample -DartifactId=tom -Dversion=1.0-SNAPSHOT -Dcrd-name=Tom -Dcrd-name-lowercase=tom I. Introduction https://github.com/kanedafromparis/khool-simpleoperator
  • 39. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Tom Operator I. Introduction ● create a tomcat deployment and it’s service ● only take tomcat version in it’s CRD ● keep the deployment https://github.com/kanedafromparis/khool-simpleoperator
  • 40. Kubernetes Operator with Java (operators in java) 2021/11/18 #J2K Thank you ● Questions ? - 00:00