O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Next-gen engineering with
Docker and Kubernetes
Please post #JavaDay2015
:~ whoami:
Antons Kranga
Cloud architect and full-stack developer
with ~15 years in Java technology
Docker and Java
Motivation
dev
Chuck Norris
app ops
deploy
Docker
Guest OS
VM
Guest OS
Container
engine
Container
engine
Hypervisor
VM
Applications isolated inside containers
Rapid ...
Dockerfile
Dockerfile
FROM java:jdk
COPY chnorr.jar /app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]
Workflow
Dockerfile
FROM java:jdk
COPY chnorr.jar /app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]
dev
Java co...
Things to remember
Containers have ephemeral. Persistent
volumes should be managed separately
App logs > /dev/stdout. Logs...
Rugged Docker
Kubernetes
Cluster manager for your containers
Docker needs Platform
Guest OS
VM
Guest OS
Container
engine
Container
engine
Hypervisor
VM
Docker is just a container engi...
Kubernetes Architecutre
Logical view
Service
ports
80,443
10.0.1.10
container container
10.0.1.11
container container
load balancer services pods ...
Chuck Norris pod example
Service
apiVersion: v1
kind: Service
metadata:
name: chuck-norris
labels:
name: chuck-norris-serv...
Things to remember
DIND makes you naked
needs privileged mode
Do not abuse etcd of kubernetes
you can brake the platform
Jenkins
Better continuous delivery model
CI with Kubernetes
dev
push
push
ops
pullgit
master
Compile &
Unit test app.jar build
private
registry Create pod
Chuck No...
Putting all together
jenkins
ports
80 jenkins_master
load balancer services pods storage
jenkins_java_slave
jenkins_kube_s...
Things to remember
Workflows can be part of app-baseline
Share workspace between slaves
Don’t forget private docker regist...
Questions?
Próximos SlideShares
Carregando em…5
×

Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga

Docker is in font of container madness that forces us to rethink our entire architecture and development practices. This session will be focusing around building Java runtimes on Docker containers and running it with Kubernetes. We will focus on different deployment aspects specific to the Docker and Kubernetes and utilise DevOps engineering managed by Jenkins.

Some previous knowledge of docker is not required however advised

  • Seja o primeiro a comentar

Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga

  1. 1. Next-gen engineering with Docker and Kubernetes Please post #JavaDay2015
  2. 2. :~ whoami: Antons Kranga Cloud architect and full-stack developer with ~15 years in Java technology
  3. 3. Docker and Java
  4. 4. Motivation dev Chuck Norris app ops deploy
  5. 5. Docker Guest OS VM Guest OS Container engine Container engine Hypervisor VM Applications isolated inside containers Rapid deployment Focuses on service is inside container dev ops Focuses on env outside container Dockerfile is a contract
  6. 6. Dockerfile Dockerfile FROM java:jdk COPY chnorr.jar /app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app.jar"]
  7. 7. Workflow Dockerfile FROM java:jdk COPY chnorr.jar /app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app.jar"] dev Java code & Dockerfile Compile & Unit test chnorr.jar build registry (private or public) push ops pull Container engine docker run
  8. 8. Things to remember Containers have ephemeral. Persistent volumes should be managed separately App logs > /dev/stdout. Logs will be streamed to log collector service Use environment variables to inject configuration parameters inside container Do not use ENV vars for secrets Use private registry to distribute containers Containers != VM (!!!)
  9. 9. Rugged Docker
  10. 10. Kubernetes Cluster manager for your containers
  11. 11. Docker needs Platform Guest OS VM Guest OS Container engine Container engine Hypervisor VM Docker is just a container engine many things are not there • Networking • Storage • Service discovery • Container scheduling • Placement and load balancing • Routing • Self healing ...
  12. 12. Kubernetes Architecutre
  13. 13. Logical view Service ports 80,443 10.0.1.10 container container 10.0.1.11 container container load balancer services pods rc
  14. 14. Chuck Norris pod example Service apiVersion: v1 kind: Service metadata: name: chuck-norris labels: name: chuck-norris-serv selector: chuck: norris spec: type: LoadBalancer clusterIP: 10.0.1.10 ports: - name: http port: 80 Replication Controller apiVersion: v1 kind: ReplicationController metadata: name: chuck-norris labels: chuck: norris spec: replicas: 3 selector: name: chuck-norris template: metadata: labels: name: chuck-norris spec: containers: - name: chuck image: akranga/chnorr:1.0.0 ports: - name: http containerPort: 8080 port exposed in Dockerfile
  15. 15. Things to remember DIND makes you naked needs privileged mode Do not abuse etcd of kubernetes you can brake the platform
  16. 16. Jenkins Better continuous delivery model
  17. 17. CI with Kubernetes dev push push ops pullgit master Compile & Unit test app.jar build private registry Create pod Chuck Norris app pull
  18. 18. Putting all together jenkins ports 80 jenkins_master load balancer services pods storage jenkins_java_slave jenkins_kube_slave jenkins_docker_slave jenkins ports 80 private_registry chnorr green ports 80 chucknorris:b24 chucknorris:b25 chnorr latest ports 80 cloud storage cloud storage
  19. 19. Things to remember Workflows can be part of app-baseline Share workspace between slaves Don’t forget private docker registry DIND is evil but unavoidable
  20. 20. Questions?

×