Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

54
munz & more Docker Live Hacking From Raspi to OCCS & Wercker Oracle CODE 2017 SFO Dr. Frank Munz

Transcript of Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Page 1: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

munz & more

Docker Live HackingFrom Raspi to OCCS & Wercker

Oracle CODE 2017 SFO Dr. Frank Munz

Page 2: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

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

Page 3: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

3 things aboutDocker

Page 4: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Solves the “Worked For Me!” issue

munz & more #4

OStools,JDK,patches,database

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

scripts

Docker

OSutils,JDK,patches,databasedriver,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: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Docker in the Cloud?

Supported by every major cloud provider:

munz & more #5

On premise -> all clouds

DockerRegistry

DockerContainerService

EC2ContainerService

GoogleContainerEngine

AzureContainerService

Bluemix Containers

Page 6: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Docker Registry

Page 7: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

fancy a demo?

Page 8: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Security

Page 9: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

$ docker run -d –p 8080:9999 fmunz/micro

Page 10: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

vs.

Page 11: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

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: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Oracle Options

Page 13: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

WebLogicin a DockerContainer!

Page 14: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Official Support

#14^

Oracle support does not require you to use the provided Docker files

OracleProduct OfficialSupport

GlassFish

MySQL yes

NoSQL

OpenJDK

OracleLinux yes

OracleCoherence yes

OracleDatabase yes

OracleHTTPServer yes

OracleJDK yes

OracleTuxedo yes

OracleWebLogic yes

Page 15: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Oracle and Docker

Get Oracle images:• Docker registry • DIY: Dockerfile from Oracle github

To run Oracle Docker containers• Build and deploy with Wercker• Oracle Container Cloud Service

munz & more #15

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

Page 16: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Just Drop Server JRE and WLS Installer

munz & more #16

$ cd java-8$ docker build -t oracle/jdk:8 .Sending build context to Docker daemon 4.096 kBStep 1 : FROM oraclelinux:latestlatest: Pulling from library/oraclelinux10ec637c060c: Downloading 4.865 MB/97.84 MB...

$ sh buildDockerImage.sh -g -v 12.2.1.1...

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

Page 17: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

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

Oracle Whitepaper WebLogiconDocker

Page 18: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Orchestration /Cluster Manager

Page 19: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Cluster Manager Options

OnPremise CloudDocker Swarm Docker1.12 DockerDC(EE)Kubernetes DIY Google/MSOracle Oracle Registry

OracleGitOracle CCS

munz & more #19

Page 20: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

localhost is usually the wrong setting in a distributed system

Page 21: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Welcome

Mini J

Page 22: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

DIY Raspi Docker Cluster

munz & more #22

Component Price

Raspi 4x38€

MicroSD 4x11€

Power 28€

Wifi 22€

Case 30€

Wires 10€

Page 23: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Kubernetes (K8s)

• Kicked off by Google’s Borg • Most active github project• Orchestration for containers, e.g. Docker• Declarative configuration• Service discovery• Rolling upgrades

munz & more #23

Page 24: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

K8s

• YAML configuration• Pod: Container(s) sharing IP, network, filesystem

– IP is ephemeral– Uses Labels

• Replication Controller -> Replica Set– Manages PODs (restarts replicas based on labels)

• Services– Proxy for pod– Permanent IP

munz & more #24

Page 25: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Docker Swarm

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

• Fast provisioning, about 500 msec• Scheduling: spread, binpack, rand• No insecure mode J

munz & more #25

Page 26: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Design Goals for Mini

• Hands-on Raspi experience• Distributed Kubernetes setup

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

munz & more #26

Others have build Raspi clusters as well and a lot of credit goes to them, e.g. to Roland Huss, Alex Ellis

etc

Page 27: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Design Decisions for Mini

• Hypriot Linux• 4 node cluster• ARM based -> runs ARM Docker images• Better I/O throughput due to separate WIFI chip • Wifi router in hotspot mode

– Mac OS issue with NAT • DIY: github

https://github.com/fmunz/raspicluster

munz & more #27

Page 28: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Paper bag Computer Raspberry Pi

• 1.2 GHz Quad Core ARM cortex-a53• RAM: 1 GB LPDDR2 Speicher• Dual Core VideoCore, 1920x1080• Bluetooth• 802.11 B/G WIFI• Boots from micro SD card• 38 €

munz & more #28

Page 29: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

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• Swarm is tightly linked to Docker API

-> harder to replace Docker with e.g. Rocket

munz & more #29

Page 30: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Google Kubernetes

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

Page 31: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Docker Containers in Kubernetes

munz & more #31

Page 32: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Docker Swarm

munz & more #32

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

Page 33: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Managed Enterprise Solution for running

Docker?

Page 34: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

OCCS

Page 35: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

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 not use Kubernetes or Docker Swarm

Page 36: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

fancy a demo?

Page 37: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Dashboard

Page 38: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Services

munz & more #38

Page 39: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Ressource Pools

munz & more #39

Page 40: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Service Editor

Page 41: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Deployment Pulls Image

munz & more #41

Page 42: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Running Grafana in OCCS

munz & more #42

Page 43: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Grafana Example

• Grafana Docker image• Runs on OCCS• Measures Oracle Cloud DNS/ping from

worldwide locations• Run it on OCCS without knowing much

about Docker or Grafana!

munz & more #43

Page 44: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Webcasts on Youtube

munz & more #44

https://www.youtube.com/watch?v=YFWAUEjtTpk https://www.youtube.com/watch?v=aRj0WK6uids

Page 45: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

How to create and deploy Docker images in an enterprise

environment?

Page 46: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Wercker

Page 47: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

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 #47

Page 48: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

https://app.wercker.com

munz & more #48

Page 49: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

fancy a demo?

Page 50: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Predictions

• Swarm will take its share from Kubernetes.• OCCS is an easy solution in OPC • You will not dockerize 90% of your enterprise IT

in the next 24 months.• Docker is like the new Linux.

Be ready to experience that feeling we had with Linux 13 years ago J

• Docker is (sometimes) the new PaaS.munz & more #50

Page 51: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

TL;DR @docker #cloudDocker is used in production /cross cloud / just Docker is not enough / #swarm is the easier #k8s / not a security risk / many products offered as images / OCCS & Wercker saves you from heavy lifting / Oracle caught the trend! / consider cloud services.

@frankmunz

Page 52: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

3MembershipTiers• OracleACEDirector• OracleACE• OracleACEAssociate

bit.ly/OracleACEProgram

500+TechnicalExpertsHelpingPeersGlobally

Connect:

Nominateyourselforsomeoneyouknow:acenomination.oracle.com

@oracleace

Facebook.com/oracleaces

[email protected]

Page 53: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

Sign up for Free Trial

http://cloud.oracle.com

Page 54: Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS

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