SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Cloud Native Java Development
Patterns and Principles for Designing Kubernetes Applications
FOSDEM
February 2017
Bilgin Ibryam
Cloud Native Java Development2
Bilgin Ibryam
●
Architect at Red Hat
●
Apache Isis, Camel, OFBiz Committer
●
Author of Apache Camel books
●
Blogs about Cloud Native and Microservices
●
Twitter: @bibryam
●
Email: bibryam@gmail.com
●
Blog: http://ofbizian.com
●
Github: https://github.com/bibryam
Cloud Native Java Development3
The Move to Cloud Native
?
Cloud Native Java Development4
Are You Cloud Native?
Applications adopting the principles of
Microservices packaged as
Containers orchestrated by
Platforms running on top of
Cloud infrastructure
Cloud Native Java Development5
Cloud Native Platforms
Cloud Native Java Development6
How to Run k8s as a Dev (not Ops)
●
Google Container Engine (GKE) – Kubernetes as a service
●
Microsoft Azure Container Service (ACS) – DC/OS, Swarm, Kubernetes as a service
●
Red Hat OpenShift Online – The largest multi-tenanted Kubernetes cluster
●
Minikube – For local development and testing
●
Maven plugin - mvn fabric8:cluster-start
https://fabric8.io/
Cloud Native Java Development7
k8s Primitives for Devs
●
How to package apps? → Container
●
What is the deployment unit? → Pod
●
How to group artifacts? → Labels
●
How to isolate resources? → Namespaces
●
How to mange configs? → ConfigMap/Secret
●
How to get storage? → PC/PVC
●
How to do service discovery & load balancing? → Service & Route
●
How to update/rollback services? → Deployment
Cloud Native Java Development8
Java Runtimes and Packaging
●
Spring Boot – the most popular
●
DropWizard – the second most popular
●
WildFly-Swarm – for JEE compliance
●
Immutable Karaf – for OSGI addicts
●
Standalone Java – for NIHS
●
MicroProfile – new initiative
HTTP Server, REST, JSON, Health
Checks, Circuit Breaker, Service Discovery,
Metrics, Configuration, Logging...
Cloud Native Java Development9
Dockerizing Java Applications
●
Java - OpenJDK or Oracle JDK? JDK or JRE?
●
Licensing and Distribution - Does Running Java on Docker Violate
Agreements?
●
CPU - Runtime.availableProcessors() ignores Linux taskset (JDK-6515172)
● $ echo '0-1' > /tmp/online
$ mount --bind /tmp/online /sys/devices/system/cpu/online
●
Memory - XX:+UseCGroupLimits (JDK-8170888)
● -XX:MaxRAM=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
●
Many “Container Best Practices” to learn
●
Fabric8 docker-maven-plugin: mvn package fabric8:build
Common issues:
Cloud Native Java Development10
Interacting with k8s
How to tell Kubernetes to:
●
Keep 3 instances of my-service up
●
Use the command "/bin/echo", "hello", "world" to start
●
Allocate 512MiB memory and one core for it
●
Make port 80 accessible
●
Set foo environment variable with bar value
●
Mount configs with name my-service to location /my-service
●
Mount a 5GB R/W persistent volume
●
And for updates do rolling update by bringing only 30% of containers down
Cloud Native Java Development11
Generating Application Descriptor
Start Kubernetes: mvn fabric8:cluster-start
Build (maven artifacts and docker image): mvn package fabric8:build
Deploy a service to Kubernetes: mvn fabric8:json fabric8:apply
Cloud Native Java Development12
Observable Interior
In order to be a good cloud native citizen, every app should be able to report
its health status.
●
Spring Boot Actuator
●
Dropwizard Metrics
●
WildFly Swarm Monitor
●
MicroProfile Healthchecks Proposal (MP-0003)
Cloud Native Java Development13
Observable Interior
R E V I S E D
AGAIN
Cloud Native Java Development14
Life Cycle Conformance
Allows applications to do graceful shutdown and startup.
●
To stop a pod, Kubernetes will send SIGTERM 30 seconds before SIGKILL
●
PreStop lifecycle hook executed prior to sending SIGTERM.
●
PostStart sent immediately after a container is created.
●
Termination message - /dev/termination-log
Cloud Native Java Development16
Service Discovery & Load Balancing
Provided by the platform
Cloud Native Java Development18
Application Resilience on the JVM
Netflix Hystrix: Circuit Breaker, TimeOuts, BulkHead, Retry
Cloud Native Java Development19
For true resilience you must go
outside of the JVM!
●
Infinite loops: CPU shares and quotas
●
Memory leaks: OOM yourself
●
Disk hogs: Quotas
●
Fork bombs: Process limits
●
Process Bulkhead with Containers
●
Hardware Bulkhead through the Scheduler
●
Self Healing
●
AntiFragile
Cloud Native Java Development20
More Kubernetes Patterns
●
SideCar, Adapter, Ambassador - Pod
●
Managed Configurations – ConfigMaps/Secrets
●
Singleton Services (File, RDB, NoSQL, Message Queue) - replicas: 1
●
Batch Jobs (JDK Timer, JDK ScheduledExecutorService, Quartz Scheduler) - CronJob
●
Initializers, Daemon Services – Init Container, Daemon Sets
●
Self Healing – Containers, Pods, Health Checks, Scheduler
●
AntiFragile – Infrastructure and application Autoscaler
Cloud Native Java Development21
In Summary
✔ Let the platform handle the repeating boring tasks.
✔ Use Java to focus on the problem domain instead.
✔ Don't reinvent the wheel, use Fabric8 tools.
Q & A
@bibryam
Fabric8 https://fabric8.io
Kubernetes http://kubernetes.io
Kubernetes Patterns – book coming soon!

Más contenido relacionado

La actualidad más candente

The evolving container landscape
The evolving container landscapeThe evolving container landscape
The evolving container landscapeNilesh Trivedi
 
Google Cloud Platform and Kubernetes
Google Cloud Platform and KubernetesGoogle Cloud Platform and Kubernetes
Google Cloud Platform and KubernetesKasper Nissen
 
High Performance Cloud-Native Microservices With Distributed Caching
High Performance Cloud-Native Microservices With Distributed CachingHigh Performance Cloud-Native Microservices With Distributed Caching
High Performance Cloud-Native Microservices With Distributed CachingMesut Celik
 
Webinar: End-to-End CI/CD with GitLab and DC/OS
Webinar: End-to-End CI/CD with GitLab and DC/OSWebinar: End-to-End CI/CD with GitLab and DC/OS
Webinar: End-to-End CI/CD with GitLab and DC/OSMesosphere Inc.
 
Episode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OSEpisode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OSMesosphere Inc.
 
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
3 - Delen Private Bank: FOSS adventures in a Cloud Native world3 - Delen Private Bank: FOSS adventures in a Cloud Native world
3 - Delen Private Bank: FOSS adventures in a Cloud Native worldKangaroot
 
Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Bilgin Ibryam
 
Serverless stream processing of Debezium data change events with Knative | De...
Serverless stream processing of Debezium data change events with Knative | De...Serverless stream processing of Debezium data change events with Knative | De...
Serverless stream processing of Debezium data change events with Knative | De...Red Hat Developers
 
Cncf storage-final-filip
Cncf storage-final-filipCncf storage-final-filip
Cncf storage-final-filipJuraj Hantak
 
Cloud Native Development
Cloud Native DevelopmentCloud Native Development
Cloud Native DevelopmentManuel Garcia
 
WebSphere 20th - Application modernization
WebSphere 20th - Application modernizationWebSphere 20th - Application modernization
WebSphere 20th - Application modernizationArthur De Magalhaes
 
Storage os kubernetes clusters need persistent data
Storage os   kubernetes clusters need persistent dataStorage os   kubernetes clusters need persistent data
Storage os kubernetes clusters need persistent dataLibbySchulze
 
PKS - Solving Complexity for Modern Data Workloads
PKS - Solving Complexity for Modern Data Workloads PKS - Solving Complexity for Modern Data Workloads
PKS - Solving Complexity for Modern Data Workloads Carlos Andrés García
 
Persist your data in an ephemeral k8 ecosystem
Persist your data in an ephemeral k8 ecosystemPersist your data in an ephemeral k8 ecosystem
Persist your data in an ephemeral k8 ecosystemLibbySchulze
 
Google Anthos - Azure Stack - AWS Outposts :Comparison
Google Anthos - Azure Stack - AWS Outposts :ComparisonGoogle Anthos - Azure Stack - AWS Outposts :Comparison
Google Anthos - Azure Stack - AWS Outposts :ComparisonKrishna-Kumar
 
Modernizing Traditional Applications with Docker EE: From PoC to Production
Modernizing Traditional Applications with Docker EE: From PoC to ProductionModernizing Traditional Applications with Docker EE: From PoC to Production
Modernizing Traditional Applications with Docker EE: From PoC to ProductionDocker, Inc.
 
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAPCloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAPKrishna-Kumar
 
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...Mesosphere Inc.
 

La actualidad más candente (20)

The evolving container landscape
The evolving container landscapeThe evolving container landscape
The evolving container landscape
 
Google Cloud Platform and Kubernetes
Google Cloud Platform and KubernetesGoogle Cloud Platform and Kubernetes
Google Cloud Platform and Kubernetes
 
High Performance Cloud-Native Microservices With Distributed Caching
High Performance Cloud-Native Microservices With Distributed CachingHigh Performance Cloud-Native Microservices With Distributed Caching
High Performance Cloud-Native Microservices With Distributed Caching
 
Webinar: End-to-End CI/CD with GitLab and DC/OS
Webinar: End-to-End CI/CD with GitLab and DC/OSWebinar: End-to-End CI/CD with GitLab and DC/OS
Webinar: End-to-End CI/CD with GitLab and DC/OS
 
Episode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OSEpisode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OS
 
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
3 - Delen Private Bank: FOSS adventures in a Cloud Native world3 - Delen Private Bank: FOSS adventures in a Cloud Native world
3 - Delen Private Bank: FOSS adventures in a Cloud Native world
 
Microservices with Spring
Microservices with SpringMicroservices with Spring
Microservices with Spring
 
Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...
 
Serverless stream processing of Debezium data change events with Knative | De...
Serverless stream processing of Debezium data change events with Knative | De...Serverless stream processing of Debezium data change events with Knative | De...
Serverless stream processing of Debezium data change events with Knative | De...
 
Cncf storage-final-filip
Cncf storage-final-filipCncf storage-final-filip
Cncf storage-final-filip
 
Cloud Native Development
Cloud Native DevelopmentCloud Native Development
Cloud Native Development
 
WebSphere 20th - Application modernization
WebSphere 20th - Application modernizationWebSphere 20th - Application modernization
WebSphere 20th - Application modernization
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
Storage os kubernetes clusters need persistent data
Storage os   kubernetes clusters need persistent dataStorage os   kubernetes clusters need persistent data
Storage os kubernetes clusters need persistent data
 
PKS - Solving Complexity for Modern Data Workloads
PKS - Solving Complexity for Modern Data Workloads PKS - Solving Complexity for Modern Data Workloads
PKS - Solving Complexity for Modern Data Workloads
 
Persist your data in an ephemeral k8 ecosystem
Persist your data in an ephemeral k8 ecosystemPersist your data in an ephemeral k8 ecosystem
Persist your data in an ephemeral k8 ecosystem
 
Google Anthos - Azure Stack - AWS Outposts :Comparison
Google Anthos - Azure Stack - AWS Outposts :ComparisonGoogle Anthos - Azure Stack - AWS Outposts :Comparison
Google Anthos - Azure Stack - AWS Outposts :Comparison
 
Modernizing Traditional Applications with Docker EE: From PoC to Production
Modernizing Traditional Applications with Docker EE: From PoC to ProductionModernizing Traditional Applications with Docker EE: From PoC to Production
Modernizing Traditional Applications with Docker EE: From PoC to Production
 
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAPCloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
 
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
 

Destacado

Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design PatternsBilgin Ibryam
 
Kubernetes networking in AWS
Kubernetes networking in AWSKubernetes networking in AWS
Kubernetes networking in AWSZvika Gazit
 
Achieving Cost and Resource Efficiency through Docker, OpenShift and Kubernetes
Achieving Cost and Resource Efficiency through Docker, OpenShift and KubernetesAchieving Cost and Resource Efficiency through Docker, OpenShift and Kubernetes
Achieving Cost and Resource Efficiency through Docker, OpenShift and KubernetesDean Delamont
 
Extend and build on Kubernetes
Extend and build on KubernetesExtend and build on Kubernetes
Extend and build on KubernetesStefan Schimanski
 
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsCamel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsBilgin Ibryam
 
RackN DevOps meetup NYC
RackN DevOps meetup NYCRackN DevOps meetup NYC
RackN DevOps meetup NYCBob Sokol
 
Welcome talk for Moscow Kubernetes Meetup 1
Welcome talk for Moscow Kubernetes Meetup 1Welcome talk for Moscow Kubernetes Meetup 1
Welcome talk for Moscow Kubernetes Meetup 1MoscowKubernetes
 
Opening: builderscon tokyo 2016
Opening: builderscon tokyo 2016Opening: builderscon tokyo 2016
Opening: builderscon tokyo 2016lestrrat
 
Net core, mssql, container und kubernetes
Net core, mssql, container und kubernetesNet core, mssql, container und kubernetes
Net core, mssql, container und kubernetesThomas Fricke
 
Mirantis Contributions to Kubernetes Ecosystem
Mirantis Contributions to Kubernetes EcosystemMirantis Contributions to Kubernetes Ecosystem
Mirantis Contributions to Kubernetes EcosystemMoscowKubernetes
 
Ростислав Фридман: “Kubernetes как средство управления микросервисами"
Ростислав Фридман: “Kubernetes как средство управления микросервисами"Ростислав Фридман: “Kubernetes как средство управления микросервисами"
Ростислав Фридман: “Kubernetes как средство управления микросервисами"Provectus
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31Varun Talwar
 
Keeping up with Tech
Keeping up with Tech Keeping up with Tech
Keeping up with Tech Elana Krasner
 
Docker Containers in Azure
Docker Containers in AzureDocker Containers in Azure
Docker Containers in AzureAarno Aukia
 
Deploy your favorite apps on Kubernetes
Deploy your favorite apps on KubernetesDeploy your favorite apps on Kubernetes
Deploy your favorite apps on KubernetesAdnan Abdulhussein
 
Kubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerKubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerAkshay Mathur
 
Google Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKEGoogle Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKESimon Su
 
Kubernetes API - deep dive into the kube-apiserver
Kubernetes API - deep dive into the kube-apiserverKubernetes API - deep dive into the kube-apiserver
Kubernetes API - deep dive into the kube-apiserverStefan Schimanski
 
Bangalore Container Conference - Sponsor Deck
Bangalore Container Conference - Sponsor DeckBangalore Container Conference - Sponsor Deck
Bangalore Container Conference - Sponsor DeckCodeOps Technologies LLP
 

Destacado (20)

Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design Patterns
 
Kubernetes networking in AWS
Kubernetes networking in AWSKubernetes networking in AWS
Kubernetes networking in AWS
 
Achieving Cost and Resource Efficiency through Docker, OpenShift and Kubernetes
Achieving Cost and Resource Efficiency through Docker, OpenShift and KubernetesAchieving Cost and Resource Efficiency through Docker, OpenShift and Kubernetes
Achieving Cost and Resource Efficiency through Docker, OpenShift and Kubernetes
 
Extend and build on Kubernetes
Extend and build on KubernetesExtend and build on Kubernetes
Extend and build on Kubernetes
 
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsCamel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
 
Serverless on Kubernetes
Serverless on KubernetesServerless on Kubernetes
Serverless on Kubernetes
 
RackN DevOps meetup NYC
RackN DevOps meetup NYCRackN DevOps meetup NYC
RackN DevOps meetup NYC
 
Welcome talk for Moscow Kubernetes Meetup 1
Welcome talk for Moscow Kubernetes Meetup 1Welcome talk for Moscow Kubernetes Meetup 1
Welcome talk for Moscow Kubernetes Meetup 1
 
Opening: builderscon tokyo 2016
Opening: builderscon tokyo 2016Opening: builderscon tokyo 2016
Opening: builderscon tokyo 2016
 
Net core, mssql, container und kubernetes
Net core, mssql, container und kubernetesNet core, mssql, container und kubernetes
Net core, mssql, container und kubernetes
 
Mirantis Contributions to Kubernetes Ecosystem
Mirantis Contributions to Kubernetes EcosystemMirantis Contributions to Kubernetes Ecosystem
Mirantis Contributions to Kubernetes Ecosystem
 
Ростислав Фридман: “Kubernetes как средство управления микросервисами"
Ростислав Фридман: “Kubernetes как средство управления микросервисами"Ростислав Фридман: “Kubernetes как средство управления микросервисами"
Ростислав Фридман: “Kubernetes как средство управления микросервисами"
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31
 
Keeping up with Tech
Keeping up with Tech Keeping up with Tech
Keeping up with Tech
 
Docker Containers in Azure
Docker Containers in AzureDocker Containers in Azure
Docker Containers in Azure
 
Deploy your favorite apps on Kubernetes
Deploy your favorite apps on KubernetesDeploy your favorite apps on Kubernetes
Deploy your favorite apps on Kubernetes
 
Kubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerKubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning Controller
 
Google Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKEGoogle Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKE
 
Kubernetes API - deep dive into the kube-apiserver
Kubernetes API - deep dive into the kube-apiserverKubernetes API - deep dive into the kube-apiserver
Kubernetes API - deep dive into the kube-apiserver
 
Bangalore Container Conference - Sponsor Deck
Bangalore Container Conference - Sponsor DeckBangalore Container Conference - Sponsor Deck
Bangalore Container Conference - Sponsor Deck
 

Similar a Cloud Native Java Development Patterns

Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus IntroReactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus IntroFabio Tiriticco
 
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Mario Ishara Fernando
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionJohn Archer
 
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...NETWAYS
 
Cloud Native Practice
Cloud Native PracticeCloud Native Practice
Cloud Native PracticePhilip Zheng
 
[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetes[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetesGlobalLogic Ukraine
 
DevEx | there’s no place like k3s
DevEx | there’s no place like k3sDevEx | there’s no place like k3s
DevEx | there’s no place like k3sHaggai Philip Zagury
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101Vishwas N
 
CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...
CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...
CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...CodiLime
 
Kubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mablKubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mablJoseph Lust
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Binary Studio
 
Java and Container - Make it Awesome !
Java and Container - Make it Awesome !Java and Container - Make it Awesome !
Java and Container - Make it Awesome !Dinakar Guniguntala
 
Introduction to openshift
Introduction to openshiftIntroduction to openshift
Introduction to openshiftMamathaBusi
 
Kubernetes is all you need
Kubernetes is all you needKubernetes is all you need
Kubernetes is all you needVishwas N
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivRon Perlmuter
 
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...javier ramirez
 
20141111_SOS3_Gallo
20141111_SOS3_Gallo20141111_SOS3_Gallo
20141111_SOS3_GalloAndrea Gallo
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkSVDevOps
 

Similar a Cloud Native Java Development Patterns (20)

Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus IntroReactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
 
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
 
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
 
Cloud Native Practice
Cloud Native PracticeCloud Native Practice
Cloud Native Practice
 
[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetes[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetes
 
DevEx | there’s no place like k3s
DevEx | there’s no place like k3sDevEx | there’s no place like k3s
DevEx | there’s no place like k3s
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...
CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...
CodiLime Tech Talk - Dawid Trzebiatowski i Wojciech Urbański: Opening the Flo...
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Kubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mablKubernetes & Google Container Engine @ mabl
Kubernetes & Google Container Engine @ mabl
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
 
Java and Container - Make it Awesome !
Java and Container - Make it Awesome !Java and Container - Make it Awesome !
Java and Container - Make it Awesome !
 
Introduction to openshift
Introduction to openshiftIntroduction to openshift
Introduction to openshift
 
Kubernetes is all you need
Kubernetes is all you needKubernetes is all you need
Kubernetes is all you need
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
 
20141111_SOS3_Gallo
20141111_SOS3_Gallo20141111_SOS3_Gallo
20141111_SOS3_Gallo
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 

Último

Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfkalichargn70th171
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxRTS corp
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxSasikiranMarri
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 

Último (20)

Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptx
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 

Cloud Native Java Development Patterns

  • 1. Cloud Native Java Development Patterns and Principles for Designing Kubernetes Applications FOSDEM February 2017 Bilgin Ibryam
  • 2. Cloud Native Java Development2 Bilgin Ibryam ● Architect at Red Hat ● Apache Isis, Camel, OFBiz Committer ● Author of Apache Camel books ● Blogs about Cloud Native and Microservices ● Twitter: @bibryam ● Email: bibryam@gmail.com ● Blog: http://ofbizian.com ● Github: https://github.com/bibryam
  • 3. Cloud Native Java Development3 The Move to Cloud Native ?
  • 4. Cloud Native Java Development4 Are You Cloud Native? Applications adopting the principles of Microservices packaged as Containers orchestrated by Platforms running on top of Cloud infrastructure
  • 5. Cloud Native Java Development5 Cloud Native Platforms
  • 6. Cloud Native Java Development6 How to Run k8s as a Dev (not Ops) ● Google Container Engine (GKE) – Kubernetes as a service ● Microsoft Azure Container Service (ACS) – DC/OS, Swarm, Kubernetes as a service ● Red Hat OpenShift Online – The largest multi-tenanted Kubernetes cluster ● Minikube – For local development and testing ● Maven plugin - mvn fabric8:cluster-start https://fabric8.io/
  • 7. Cloud Native Java Development7 k8s Primitives for Devs ● How to package apps? → Container ● What is the deployment unit? → Pod ● How to group artifacts? → Labels ● How to isolate resources? → Namespaces ● How to mange configs? → ConfigMap/Secret ● How to get storage? → PC/PVC ● How to do service discovery & load balancing? → Service & Route ● How to update/rollback services? → Deployment
  • 8. Cloud Native Java Development8 Java Runtimes and Packaging ● Spring Boot – the most popular ● DropWizard – the second most popular ● WildFly-Swarm – for JEE compliance ● Immutable Karaf – for OSGI addicts ● Standalone Java – for NIHS ● MicroProfile – new initiative HTTP Server, REST, JSON, Health Checks, Circuit Breaker, Service Discovery, Metrics, Configuration, Logging...
  • 9. Cloud Native Java Development9 Dockerizing Java Applications ● Java - OpenJDK or Oracle JDK? JDK or JRE? ● Licensing and Distribution - Does Running Java on Docker Violate Agreements? ● CPU - Runtime.availableProcessors() ignores Linux taskset (JDK-6515172) ● $ echo '0-1' > /tmp/online $ mount --bind /tmp/online /sys/devices/system/cpu/online ● Memory - XX:+UseCGroupLimits (JDK-8170888) ● -XX:MaxRAM=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) ● Many “Container Best Practices” to learn ● Fabric8 docker-maven-plugin: mvn package fabric8:build Common issues:
  • 10. Cloud Native Java Development10 Interacting with k8s How to tell Kubernetes to: ● Keep 3 instances of my-service up ● Use the command "/bin/echo", "hello", "world" to start ● Allocate 512MiB memory and one core for it ● Make port 80 accessible ● Set foo environment variable with bar value ● Mount configs with name my-service to location /my-service ● Mount a 5GB R/W persistent volume ● And for updates do rolling update by bringing only 30% of containers down
  • 11. Cloud Native Java Development11 Generating Application Descriptor Start Kubernetes: mvn fabric8:cluster-start Build (maven artifacts and docker image): mvn package fabric8:build Deploy a service to Kubernetes: mvn fabric8:json fabric8:apply
  • 12. Cloud Native Java Development12 Observable Interior In order to be a good cloud native citizen, every app should be able to report its health status. ● Spring Boot Actuator ● Dropwizard Metrics ● WildFly Swarm Monitor ● MicroProfile Healthchecks Proposal (MP-0003)
  • 13. Cloud Native Java Development13 Observable Interior R E V I S E D AGAIN
  • 14. Cloud Native Java Development14 Life Cycle Conformance Allows applications to do graceful shutdown and startup. ● To stop a pod, Kubernetes will send SIGTERM 30 seconds before SIGKILL ● PreStop lifecycle hook executed prior to sending SIGTERM. ● PostStart sent immediately after a container is created. ● Termination message - /dev/termination-log
  • 15. Cloud Native Java Development16 Service Discovery & Load Balancing Provided by the platform
  • 16. Cloud Native Java Development18 Application Resilience on the JVM Netflix Hystrix: Circuit Breaker, TimeOuts, BulkHead, Retry
  • 17. Cloud Native Java Development19 For true resilience you must go outside of the JVM! ● Infinite loops: CPU shares and quotas ● Memory leaks: OOM yourself ● Disk hogs: Quotas ● Fork bombs: Process limits ● Process Bulkhead with Containers ● Hardware Bulkhead through the Scheduler ● Self Healing ● AntiFragile
  • 18. Cloud Native Java Development20 More Kubernetes Patterns ● SideCar, Adapter, Ambassador - Pod ● Managed Configurations – ConfigMaps/Secrets ● Singleton Services (File, RDB, NoSQL, Message Queue) - replicas: 1 ● Batch Jobs (JDK Timer, JDK ScheduledExecutorService, Quartz Scheduler) - CronJob ● Initializers, Daemon Services – Init Container, Daemon Sets ● Self Healing – Containers, Pods, Health Checks, Scheduler ● AntiFragile – Infrastructure and application Autoscaler
  • 19. Cloud Native Java Development21 In Summary ✔ Let the platform handle the repeating boring tasks. ✔ Use Java to focus on the problem domain instead. ✔ Don't reinvent the wheel, use Fabric8 tools.
  • 20. Q & A @bibryam Fabric8 https://fabric8.io Kubernetes http://kubernetes.io Kubernetes Patterns – book coming soon!

Notas del editor

  1. Architect Committer Blog books Middleware architect at RH consulting ½ day to over a year. Bug fix, healthcheck, design, implemented, POC Camel committer, contribited compoents such as aws-ses, aws-cloudwatch, aws- swf, aws-sdb, aws-ddb, solr, cmis, fop, redis, infinispan, jbpm, circuit breaker EIP, hystrix components Blogger about opensource, integration and came and author...Camel messages routing book which is an introduction to Camel and more recent book about Camel Design Patterns… which is the topic of this presentation. The goal today is to cover half of the more popular patterns from this book
  2. microservices - my blog about MSA years ago. But now there is a formalized, recognized, vocabulary