Craftsmanship Open Community Session #2

Capgemini Craftsmanship Community
Wrocław, 28th of April 2017

Krzysztof Sobkowiak (@ksobkowiak)

The Apache Software Foundation Member
Senior Solution Architect at Capgemini

feather

Your Speaker

  • FOSS enthusiast, evangelist & architect

  • Senior Solution Architect at Capgemini

  • The Apache Software Foundation

    • Member

    • Apache ServiceMix commiter & PMC chair (V.P. Apache ServiceMix)

    • active at Apache Karaf, CXF, Camel, ActiveMQ

  • Member/developer at OASP, OPS4J

kso1

warn

Views in this presentation are my personal views and do not necessarily reflect the views of Capgemini.

AppsEvolve Summit Report

apps evolve 2017 photo
  • Mörfelden, 23-25 March 2017

  • Service Orchestration Stream

    • Capgemini EiPaaS — current state

    • PaaS Shootout (EiPaaS, PCF, OpenShift, Fabric8)

  • devonfw — a year after AppsEvolve 2016

comming soon

Fabric8 your Services with Kubernetes & OpenShift

turbo camel

Creating business value through software is about speed, safety, iteration, and continuous improvement

java microservices frameworks

  • Simple configuration

  • Curated dependencies and transitive dependencies

  • Built in metrics, monitoring

  • Slim profile for deployment (…​micro even?)

    #microprofile

netflix java logo

  • Distributed configuration

  • Service Discovery

  • Loadbalancing

  • Circuit Breakers

  • Bulkheading

  • Versioning/Routing

  • Based on AWS

docker logo

What is Docker?

  • Open source project and company (not 100% true)

    docker github
  • Used to create containers for software applications

FROM openjdk

COPY target/hello.jar /usr/src/hello.jar

CMD java -cp /usr/src/hello.jar org.example.App
$ docker build -t username/hello
$ docker run -it -p 8080:8080 username/hello
  • WORA = Write Once Run Anywhere

wora
  • PODA = Package Once Deploy Anywhere

poda

Additional Docker Components

  • Docker Compose

version: “3”
services:
  db:
    image: couchbase:latest
    ports:
      - 8091:8091
      - 8092:8092
      - 8093:8093
      - 11210:11210
  web:
    image: username/hello:latest
    environment:
      - COUCHBASE_URI=db
    ports:
      - 8080:8080
$ docker-compose up -d
  • Docker Machine

docker-machine create --driver=virtualbox myhost
docker machine providers

DevOps challenges for multiple containers

  • How to scale?

  • How to avoid port conflicts?

  • How to manage them in multiple hosts?

  • What happens if a host has a trouble?

  • How to keep them running?

  • How to update them?

  • Where are my containers?

Netflix — What about non-java?

non java languages

Swarm Mode

  • New in 1.12

  • Natively managing a cluster of Docker Engines called a Swarm

  • Docker CLI to create a swarm, deploy apps, and manage swarm

    • Optional feature, need to be explicitly enabled

  • No Single Point of Failure (SPOF)

  • Declarative state model

  • Self-organizing, self-healing

  • Service discovery, load balancing and scaling

  • Rolling updates

docker swarm mode logo

Swarm Mode

swarm mode replicated service
$ docker service create --replicas 2 --name web jboss/wildfly
$ docker service scale web=3
version: “3”
services:
  web:
    image: jboss/wildfly
    environment:
      - COUCHBASE_URI=db
    ports:
      - 8080:8080
    deploy:
      replicas: 3
      update_config:
        parallelism: 2
      restart_policy:
        condition: on-failure
$ docker stack deploy --compose-file=docker-compose.yml web

Kubernetes

kubernetes logo
  • Container orchestrator

  • Supports multiple cloud and bare-metal environments

  • Inspired by Google’s experience with containers

  • Provides:

    • Distributed configuration

    • Service Discovery, Loadbalancing

    • Versioning/Routing

    • Deployments, Scaling/Autoscaling

    • Liveness/Health checking, Self healing

Kubernetes Concepts

Pods

colocated group of containers that share an IP, namespace, storage volume, resources, lifecycle

Replica Set

manages the lifecycle of pods and ensures specified number are running (next gen Replication Controller)

Service

Single, stable name for a set of pods, also acts as LB

Label

used to organize and select group of objects

Kubernetes Concepts

Node

Machine or VM in the cluster

Master

Central control plane, provides unified view of the cluster

  • etcd: distributed key-value store used to persist Kubernetes system state

Worker

Docker host running kubelet (node agent) and proxy services

  • Runs pods and containers

kubernetes master
kubernetes worker
kubernetes cluster

OpenShift is Kubernetes

  • Team self service application deployment

  • Developer workflow

  • Enterprise focused (LDAP, RBAC, Oauth, etc)

  • Integrated Docker registry

  • Jenkins Pipeline out of the box

  • Build/deployment triggers

  • Software Defined Networking (SDN)

  • Docker native format/packaging

  • CLI/IDE/Web based tooling

openshift stack

Fabric8 all the things!

  • Built on top of Kubernetes

  • Wizards to create microservices

  • Package as immutable containers

  • Rolling upgrade across environments

  • 1-Click install of fully configured CI/CD (Jenkins Pipeline, Nexus, Git)

  • Feedback loops

  • Lots of developer tooling

  • ChatOps

  • iPaaS/Integration

  • Chaos Monkey

fabric8 logo

Topics proposal

  • Package your Application using Docker & Kubernetes

  • Resilient Services with Spring Cloud, Docker & Kubernetes

  • xPaaS with OpenShift & fabric8

Topics proposal

  • Spring Boot

  • WildFly Swarm

  • Vert.x

  • Dropwizard

i want you