Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Spring Boot on Kubernetes/OpenShift

1,336 views

Published on

Spring Boot is the defacto framework for building microservices with Java. These slides walk you though how to get started, deploy and debug, perform service discovery and do canary deployments with Spring Boot apps on OpenShift

Published in: Technology
  • If you’re struggling with your assignments like me, check out ⇒ www.HelpWriting.net ⇐. My friend sent me a link to to tis site. This awesome company. After I was continuously complaining to my family and friends about the ordeals of student life. They wrote my entire research paper for me, and it turned out brilliantly. I highly recommend this service to anyone in my shoes. ⇒ www.HelpWriting.net ⇐.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Hi there! I just wanted to share a list of sites that helped me a lot during my studies: .................................................................................................................................... www.EssayWrite.best - Write an essay .................................................................................................................................... www.LitReview.xyz - Summary of books .................................................................................................................................... www.Coursework.best - Online coursework .................................................................................................................................... www.Dissertations.me - proquest dissertations .................................................................................................................................... www.ReMovie.club - Movies reviews .................................................................................................................................... www.WebSlides.vip - Best powerpoint presentations .................................................................................................................................... www.WritePaper.info - Write a research paper .................................................................................................................................... www.EddyHelp.com - Homework help online .................................................................................................................................... www.MyResumeHelp.net - Professional resume writing service .................................................................................................................................. www.HelpWriting.net - Help with writing any papers ......................................................................................................................................... Save so as not to lose
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Spring Boot on Kubernetes/OpenShift

  1. 1. 1 @kamesh_sampath kamesh.sampath@hotmail.com bit.ly/springboot-on-openshift
  2. 2. developers.redhat.com
  3. 3. Who am I ? ● Active Open Source Contributor ● Creator vert.x-maven-plugin → https://vmp.fabric8.io/ ● Contributor fabric8 platform → https://fabric8.io/ kameshsampath Kamesh Sampath Director of Developer Experience at Red Hat @kamesh_sampath ksampath@hotmail.com
  4. 4. The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. Martin Fowler What is a microservice ?
  5. 5. Microservices Properties MyService Monitoring Tracing Discovery API Invocation Resilience Pipeline Authentication Logging Elasticity
  6. 6. Short History of Microservices Continuous Integration via XP 1999 AWS EC2 2006 DropWizard May 2011 Agile Manifesto Feb 2001 NETFLIX to AWS 2010 Ribbon March 2012 Hystrix March 2012 Eureka July 2012 Microservices Access Thoughtworks Radar March 2012 Spring Boot Sept 2013 Microservices Defined Thoughtworks Fowler, Lewis March 2014 Kubernetes June 2014 Java EE6 2009 DevOps 2009 Containers Docker 2013
  7. 7. java -jar myapp.jar DropWizard www.dropwizard.io JAX-RS API First to market DropWizard Metrics Embeddable servers: Jetty Spring Boot projects.spring.io/spring- boot Spring API (@RestController) ‘Starter’ POMs: start.spring.io Embeddable servers: Tomcat, Jetty, Undertow WildFly Swarm wildfly-swarm.io Java EE 7 APIs ‘Starter’ POMs: wildfly- swarm.io/generator Embeddable servers: WildFly (Undertow) Vert.x vertx.io Reactive Async/non-blocking vertx run myhttp.java HTTP, HTTP/2, TCP, UDP, Websockets, etc. (out of the box)
  8. 8. @kamesh_sampath Java Microservices Platform circa 2014 Config Server NETFLIX Ribbon
  9. 9. @kamesh_sampath Caveman’s Spring Boot How to ScaleHow to avoid Port conflicts Manage on multiple hosts How to manage when hosts in trouble ? How to update them ? How to keep up Desired vs Actual states? Where are my containers ??
  10. 10. @kamesh_sampath
  11. 11. Open Container Initiative (OCI) ImageSpecRuntime Spec (cri-o) https://cri-o.io https://www.opencontainers.org/ https://www.opencontainers.org/image-spec e.g. Docker , rkt e.g. Docker formatted Images docker.io/busybox The Runtime Specification outlines how to run a “filesystem bundle” that is unpacked on disk A container image package with required metadata that will be used by runtimes to run the container images
  12. 12. ▪ Greek for “Helmsman,” also the root of the word “Governor” (from latin: gubernator) ▪ Container orchestrator ▪ Supports multiple cloud and bare-metal environments ▪ Inspired by Google’s experience with containers ▪ Open source, written in Go ▪ Manage applications, not machines Meet Kubernetes
  13. 13. Pods A group of whales is commonly referred to as a pod and a pod usually consists a group of whales that have bonded together either because of biological reasons or through friendships developed between two or more whales. In many cases a typical whale pod consists of anywhere from 2 to 30 whales or more.* *http://www.whalefacts.org/what-is-a-group-of-whales-called/
  14. 14. OpenShift is Enterprise Kubernetes
  15. 15. Pod Replication Controller/ Deployment Service Label ✓ 1+ containers ✓ Shared IP ✓ Shared storage volume ✓ Shared resources ✓ Shared lifecycle ✓ Ensures that a specified number of pod replicas are running at any one time ✓ Grouping of pods (acting as one) has stable virtual IP and DNS name ✓ Key/Value pairs associated with Kubernetes objects (env=production) Kubernetes Cluster
  16. 16. My Boot is Kube Awesome JVM Configurations Operating System MyApp.jar OCI
  17. 17. DEMO (Hello Boot k8s deployment)
  18. 18. @kamesh_sampath Better Spring Boot Microservices Platform circa 2016 Config Server NETFLIX Ribbon
  19. 19. ▪ Service Discovery Spring Discovery Client using Kubernetes Service Discovery ▪ ConfigMap Property Source How to use Kubernetes ConfigMap as Spring Property source ▪ Zipkin Service Discovery Using Zipkin with Kubernetes for distributed tracing Spring Cloud Kubernetes
  20. 20. @kamesh_sampath How to add to My Project? <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-kubernetes-discovery</artifactId> <version>0.2.0.RELEASE</version> </dependency> Spring Cloud Kubernetes Discovery Spring Cloud Kubernetes Config Spring Cloud Kubernetes Archaius Spring Cloud Kubernetes Netflix Spring Cloud Kubernetes Zipkin https://github.com/spring-cloud-incubator/spring-cloud-kubernetes <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-kubernetes-config</artifactId> <version>0.2.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-kubernetes-archaius</artifactId> <version>0.2.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-kubernetes-netflix</artifactId> <version>0.2.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-kubernetes-config</artifactId> <version>0.2.0.RELEASE</version> </dependency>
  21. 21. DEMO (Discovery)
  22. 22. @kamesh_sampath Better Spring Boot Microservices Platform circa 2017 Config Server NETFLIX Ribbon
  23. 23. @kamesh_sampath Better Spring Boot Microservices Platform circa 2018 Config Server NETFLIX Ribbon Jaeger Istio
  24. 24. Canary release is a technique to reduce the risk of introducing a new software version in production by slowly rolling out the change to a small subset of users before rolling it out to the entire infrastructure and making it available to everybody. Source: https://martinfowler.com/bliki/CanaryRelease.html Microservice Architecture - Principles Canary Release
  25. 25. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  26. 26. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  27. 27. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  28. 28. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  29. 29. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  30. 30. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  31. 31. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  32. 32. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  33. 33. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  34. 34. Canary Deployment DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS SCM
  35. 35. Demo
  36. 36. ▪ Minishift and Minikube ▪ Fabric8 Maven Plugin ▪ Eureka & Ribbon not required with Kubernetes ▪ Demos ○bit.ly/springboot-on-openshift ○Spring Cloud Brewery Application Migration ■bit.ly/green-cloud-demo ■bit.ly/green-cloud-demo-sources ○Stateful Canary leveraging Infinispan ■bit.ly/popdemo ●Open Containers Initiative ○ Runtime Spec - http://cri-o.io/ ○ Image Spec – https://github.com/opencontainers/image-spec Summary @kamesh_sampath
  37. 37. 38 @kamesh_sampath kamesh.sampath@hotmail.com bit.ly/springboot-on-openshift

×