Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products...

43
munz & more Docker Live Hacking: From Raspberry Pi to Kubernetes Hong Kong Meetup + Oracle CODE 2018 Shenzhen Dr. Frank Munz

Transcript of Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products...

Page 1: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

munz & more

Docker Live Hacking: From Raspberry Pi to Kubernetes

Hong Kong Meetup + Oracle CODE 2018 Shenzhen

Dr. Frank Munz

Page 2: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

2

Dr. Frank Munz

• Founded munz & more in 2007• 17 years Oracle Middleware,Cloud, and Distributed Computing•Consulting and High-End Training•Wrote two Oracle WLS andone Cloud book• Twitter: @frankmunz

Page 3: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

3 things aboutDocker

Page 4: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Solves the “Worked For Me!” issue

munz & more #4

OS tools, JDK, patches, database

driver, libs, appserver, domain, deployment, tools,

scripts

Docker

OS utils, JDK, patches, database driver, libs, appserver, domain, deployment, tools, scripts

Integration,Performance,Acceptance

Testing

Production

dockerize it!

You can pass environment variables for specific settings e.g. in prod

Docker Registry

Page 5: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Docker in the Cloud?

Supported by every major cloud provider:

munz & more #5

On premise -> all clouds

DockerRegistry

Docker Container Service

EC2 Container Service

Google Container Engine

Azure Container Service

Bluemix Containers

Page 6: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Docker Registry

Page 7: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

fancy a demo?

Page 8: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Security

Page 9: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

docker run -d –P fmunz/micro

Page 10: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

vs.

Page 11: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

A stranger gives you a box at night and asks you to connect it to your company network:

Would you do it?

what should be your biggest nightmare:

unknown and unofficial images10s of thousands

Page 12: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

DB or WebLogicin a Docker Container!

Page 13: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Oracle Docker Images

You have three main options

1.DIY: Dockerfile from Oracle github

2.Oracle Container Registry

3.Docker Hubmunz & more #13

https://github.com/oracle/docker-images

https://container-registry.oracle.com

Page 14: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

http://www.oracle.com/us/products/middleware/cloud-app-foundation/weblogic/weblogic-server-on-docker-wp-2742665.pdf

Oracle Whitepaper WebLogic on Docker

Page 15: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Orchestration /Cluster Manager

Page 16: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Orchestration Options

• On premises: – Docker Swarm, Kubernetes

• Oracle Cloud, easy: – Container Cloud Service (OCCS)

• Oracle Cloud Enterprise: Kubernetes– Container Engine (OCE)– Free CI/CD Wercker included

munz & more #16

Page 17: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Welcome Mini J

Page 18: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Design Goals for Mini

• Hands-on Raspi experience• Distributed Kubernetes setup

& Docker Swarm setup • HA / failover / rolling updates• Have a fun project

munz & more #18

Others have build Raspi clusters as well. A lot of credit goes to Roland Huss, Alex

Ellis etc

Page 19: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

DIY Raspi Docker Cluster

munz & more #20

Component Price

Raspi 4x 38€

Micro SD 4x 11€

Power 28€

Wifi 22€

Case 30€

Wires 10€

Page 20: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

K8s

• YAML configuration, declarative, uses labels• Pod: Containers sharing IP, network, filesystem

– IP is ephemeral• Replica Set (was Replication Controller)

– Manages PODs: restarts replicas• Services

– Like a proxy, exposes pod– Permanent IP

munz & more #22

Page 21: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Docker Swarm

• Native Docker cluster with same API asa single engine -> part of Docker

• Fast provisioning, about 500 msec• Various scheduling algorithms:

spread, binpack, rand• No insecure mode J

munz & more #23

Page 22: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Kubernetes or Swarm?

• Swarm wasn’t impressive when released,but this has changed

• Swarm is much easier to understand and to operate

• Swarm covers a lot of what K8s does• Industry standard: Kubernetes– See Oracle, AWS, Azure, Google cloud– Kubernetes supported by Docker

munz & more #24

Page 23: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Kubernetes

munz & more #25https://blog.docker.com/2016/03/swarmweek-docker-swarm-exceeds-kubernetes-scale/

K8s components run as

Docker containers

Page 24: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Could you debug it?

munz & more #26

Page 25: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Docker Swarm

munz & more #27

https://blog.docker.com/2016/03/swarmweek-docker-swarm-exceeds-kubernetes-scale/

Page 26: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Managed Enterprise Solution for running

Docker?

Page 27: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

OCCS

Page 28: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

OCCS Walkthrough

Page 29: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

OCCS

• Easy way to run Docker container in Oracle cloud

• No need to install Docker, Kubernetes, buy machines etc.

• Integrates with Docker hub and Oracle Container registry

• Does neither use Kubernetes nor Docker Swarm

Page 30: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

OCEManaged Kubernetes

Page 31: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Standard Kubernetes

munz & more #33

kubectl run microg--image=fmunz/microg--port 5555

kubectl CLI K8s admin

Page 32: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Cloud Native Compute Foundation

munz & more #34

Page 33: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

https://app.wercker.com

munz & more #35

Page 34: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Wercker

Page 35: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Wercker

• Recently acquired by Oracle• Pipelines execute steps on code

– Pipelines == series of steps– Execute inside Docker container

• Workflows == chained and branched pipelines• Quickly provision ready to run infrastructure

– Push images to any registry– Restart OCCS via webhooks

munz & more #37

Page 36: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

fancy a demo?

Page 37: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier
Page 38: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

Predictions

• Kubernetes is now de-facto standard for enterprises.

• You will not dockerize 80% of your enterprise IT in the next 24 months.

• Docker is somehow like the new Linux:Be ready to experience that cutting edge feeling we had with Linux 12 years ago J

• Kubernetes is (sometimes) the new PaaS.munz & more #40

Page 39: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

TL;DR @docker #cloudDocker is used in production / many products offered as Docker images / cross cloud /Docker orchestration is needed /#swarm is the easier #k8s / OCE or OCCS & Wercker removes heavy lifting / Oracle caught the trend! / if Kubernetes then cloud service? / emerging CNCF: Jaeger, Graphana, Prometheus + also: Fn Project

@frankmunz

Page 40: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

munz & more #42

Page 41: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier
Page 42: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

3 Membership Tiers• Oracle ACE Director• Oracle ACE• Oracle ACE Associate

bit.ly/OracleACEProgram

500+ Technical Experts Helping Peers Globally

Connect:

Nominate yourself or someone you know: acenomination.oracle.com

@oracleaceFacebook.com/oracleaces

[email protected]

Page 43: Docker Live Hacking - Oracle...TL;DR @docker#cloud Docker is used in production /many products offered as Docker images/cross cloud/ Docker orchestration is needed/ #swarm is the easier

www.munzandmore.com/blog

facebook.com/cloudcomputingbookfacebook.com/weblogicbook

@frankmunz

https://www.linkedin.com/in/frankmunz/

youtube.com/weblogicbook-> more than 50 web casts

Don’t be shy J