├── .gitignore ├── docker-orchestration-frameworks.adoc ├── managed-container-service.adoc ├── readme.adoc ├── scripts └── jdays-keynote.adoc └── slides ├── 2016-Devoxx-Migrate-VM-to-Containers.key ├── 2016-Devoxx-Migrate-VM-to-Containers.pdf ├── container-orchestration-aws.key ├── container-orchestration-aws.pdf ├── course ├── chapter1.key ├── chapter2.key ├── chapter3.key ├── chapter4.key ├── chapter5.key ├── chapter6.key └── pre.key ├── docker-introduction.key ├── docker-introduction.pdf ├── docker-kubernetes-recipes.key ├── docker-kubernetes-recipes.pdf ├── docker-kubernetes.key ├── docker-kubernetes.pdf ├── ecs-introduction.key ├── jdays-keynote.key ├── jdays-keynote.pdf ├── mesos-introduction.key ├── mesos-introduction.pdf ├── service-discovery-oscon2017.key ├── service-discovery-oscon2017.pdf ├── service-discovery.key └── service-discovery.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | -------------------------------------------------------------------------------- /docker-orchestration-frameworks.adoc: -------------------------------------------------------------------------------- 1 | = Docker vs Kubernetes vs DC/OS vs ECS 2 | 3 | This document compares the four container orchestration frameworks: http://github.com/docker/docker[Docker Engine w/ Swarm Mode], https://github.com/kubernetes/kubernetes[Kubernetes], https://github.com/dcos/dcos[DC/OS], and https://aws.amazon.com/ecs/[ECS]. 4 | 5 | 6 | [width="100%", options="header"] 7 | |================== 8 | | Feature | http://github.com/docker/docker[Docker] | https://github.com/kubernetes/kubernetes[Kubernetes] | https://github.com/dcos/dcos[DC/OS] | https://aws.amazon.com/ecs/[ECS] 9 | | Local Development | https://www.docker.com/community-edition[Docker Community Edition] | https://github.com/kubernetes/minikube[minikube] | https://dcos.io/docs/1.8/administration/installing/local[DC/OS Vagrant] | https://github.com/blox/blox[Blox] 10 | | Multiple clouds | https://docs.docker.com/docker-cloud/overview/[Docker Cloud], https://docs.docker.com/machine/drivers/[Docker Machine Drivers], https://www.docker.com/products/overview[Docker for AWS/Azure] | http://kubernetes.io/docs/getting-started-guides/#turn-key-cloud-solutions[Turn Key Cloud] | https://dcos.io/install/[Mulitple clouds] | AWS 11 | | Service Discovery and Load Balancer | Docker-compse: DNS + 12 | Docker Swarm: (https://docs.docker.com/engine/swarm/services/[Service]) | `Service` | Yes (https://dcos.io/docs/1.8/usage/service-discovery/[multiple]: DNS-based and proxy-based/L4 load balancer) | https://github.com/awslabs/service-discovery-ecs-dns[DNS-based], https://github.com/awslabs/ecs-refarch-service-discovery[ELB-based], https://github.com/awslabs/ecs-refarch-cloudformation[ALB-based] 13 | | Dynamic Scaling | http://blog.couchbase.com/2016/july/docker-services-stack-distributed-application-bundle[Services, Distributed Application Bundle, Stack] | `Replica Set`, `Replication Controller`, `Deployment`, `Horizontal Pod Autoscaling` | Marathon app spec (instance count) and https://dcos.io/docs/1.8/usage/tutorials/autoscaling/[multiple options] | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html[Service Auto Scaling] 14 | | Exposing a service | Routing mesh | `type=LoadBalancer` in `Deployment` | Multiple (direct placement on public agent or, preferred, via https://dcos.io/docs/1.8/usage/service-discovery/marathon-lb/marathon-lb-basic-tutorial/[Marathon-LB] | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html[Classic and Application Load Balancer] 15 | | Run-once job | `docker run` | `Job` | https://docs.mesosphere.com/1.8/usage/jobs/[Jobs] | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_run_task.html[Tasks] 16 | | Namespace | `docker-compose -p ` | `Namespace` | via labels in System Marathon | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes[Custom Attributes] 17 | | Global service| `--mode=global` | `DaemonSet` | Unique Attribute | 'distinctInstance' http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#constraint-types[Task Placement Constraint] 18 | | Maven | https://github.com/fabric8io/docker-maven-plugin[fabric8-maven-plugin] | https://github.com/fabric8io/docker-maven-plugin[fabric8-maven-plugin] | https://github.com/dcos-labs/dcos-maven-plugin[dcos-maven-plugin] | No 19 | | Volumes | https://docs.docker.com/engine/tutorials/dockervolumes/[Docker Volumes] | http://kubernetes.io/docs/user-guide/persistent-volumes/[Persistent Volumes] | https://dcos.io/docs/1.8/usage/storage/persistent-volume/[local persistent volumes] as well as https://dcos.io/docs/1.8/usage/storage/external-storage/[external persistent volumes] | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html[Using Data Volumes in Tasks] 20 | | Multiple Master | Yes | link:https://github.com/kubernetes/kops[Yes] | Yes | Yes (default) 21 | | Multi-host networking | Yes | Yes | Yes | https://github.com/aws/amazon-ecs-agent/pull/701[Proposed implementation] 22 | | Rolling Update | https://github.com/arun-gupta/docker-scripts/blob/master/rolling-updates.adoc | https://github.com/arun-gupta/kubernetes-java-sample/tree/master/rolling-update | https://github.com/mhausenblas/zdd-lab[ZDD Lab] | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/update-service.html[Updating a Service] 23 | | Container distribution strategies | Automatic? | Automatic, but custom schedulers supported. | Automatic | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html[Task Placement Strategies] 24 | | Affinity | Labels | Node (1.2) and Pod (1.4) affinity http://kubernetes.io/docs/user-guide/node-selection/ | https://mesosphere.github.io/marathon/docs/constraints.html[Marathon constraints] and pods (in 1.9) | Via Task Placement Strategies and Constraints 25 | | Constraints | `-c`, `-m` | `Labels` | https://mesosphere.github.io/marathon/docs/constraints.html[Marathon constraints] | http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html[Task Placement Constraints] 26 | | On-premise | Yes | Yes | Yes | No 27 | | Cluster across multiple clouds | Yes | Yes (http://kubernetes.io/docs/admin/multiple-zones/[partly]) | Yes (agents) | No (Can span multiple AZ) 28 | | Commercially supported | https://www.docker.com/enterprise-edition[Docker Enterprise Edition] | Google, Apprenda, Canonical, CoreOS, link:http://cloud-rti.com[Cloud RTI] others? | https://mesosphere.com/product/[Mesosphere Enterprise DC/OS] | https://aws.amazon.com/premiumsupport/[AWS Support] 29 | | Creating Couchbase Cluster | http://blog.couchbase.com/2016/may/couchbase-cluster-docker-swarm-compose-machine[blog] | http://blog.kubernetes.io/2016/08/create-couchbase-cluster-using-kubernetes.html[blog] | http://blog.couchbase.com/2016/november/couchbase-cluster-mesos-dcos[blog] | https://blog.couchbase.com/couchbase-docker-container-amazon-ecs/[blog] (one node) 30 | |================== 31 | -------------------------------------------------------------------------------- /managed-container-service.adoc: -------------------------------------------------------------------------------- 1 | = Managed Container Service 2 | 3 | This document compares managed container services. 4 | 5 | . https://www.docker.com/products/docker-datacenter[Docker Data Center] or https://docs.docker.com/docker-for-aws/[Docker for AWS] / https://docs.docker.com/docker-for-azure/[Azure] 6 | . https://cloud.google.com/container-engine/[Google Container Engine] (GCE) 7 | . https://dcos.io/[DC/OS] 8 | . https://azure.microsoft.com/en-us/services/container-service/[Azure Container Service] (Azure) 9 | . https://aws.amazon.com/ecs/[Amazon Elastic Container Service] (ECS) 10 | . https://www.openshift.org/[Red Hat OpenShift] 11 | . https://cloud.oracle.com/container[Oracle Cloud Container Service] 12 | 13 | [width="100%", options="header"] 14 | |================== 15 | | Feature | Docker | GCE | DC/OS | Azure | ECS | OpenShift | Oracle 16 | | Company | Docker | Google | Mesosphere | Microsoft | Amazon | Red Hat | Oracle 17 | | Orchestration Framework | Docker Engine | Kubernetes | Apache Mesos | Kubernetes | Closed source | Kubernetes | Closed source 18 | | Docker version | | | | | | | 19 | | CI/CD | | | | | | | 20 | | REST API | | | | | | | 21 | | Console | | | | | | | 22 | |================== 23 | 24 | -------------------------------------------------------------------------------- /readme.adoc: -------------------------------------------------------------------------------- 1 | = Docker and Kubernetes for Java Developers 2 | 3 | https://github.com/docker/labs/tree/master/developer-tools/java[Docker for Java developers] 4 | 5 | https://github.com/arun-gupta/kubernetes-java-sample/[Kubernetes for Java developers] 6 | 7 | == Software Requirements 8 | 9 | . Docker for Java: https://github.com/docker/labs/blob/master/developer-tools/java/chapters/ch01-setup.adoc 10 | . Kubernetes for Java 11 | .. Install: https://github.com/arun-gupta/kubernetes-java-sample/blob/master/workshop.adoc#initial-setup 12 | .. An Amazon Web Services account 13 | .. Clone: https://github.com/arun-gupta/kubernetes-java-sample 14 | -------------------------------------------------------------------------------- /scripts/jdays-keynote.adoc: -------------------------------------------------------------------------------- 1 | = JDays Keynote Script 2 | 3 | == Docker (local dev) 4 | 5 | . `docker swarm init` 6 | . `docker node ls` 7 | . `docker info` 8 | . 9 | . Use `docker-compose.yml`: 10 | + 11 | ``` 12 | version: "3" 13 | services: 14 | db: 15 | image: arungupta/couchbase:travel 16 | ports: 17 | - 8091:8091 18 | - 8092:8092 19 | - 8093:8093 20 | - 11210:11210 21 | web: 22 | image: arungupta/wildfly-couchbase-javaee:travel 23 | environment: 24 | - COUCHBASE_URI=db 25 | ports: 26 | - 8080:8080 27 | - 9990:9990 28 | ``` 29 | + 30 | . Deploy the app: `docker deploy --compose-file=docker-compose.yml webapp` 31 | . `docker stack ls` 32 | . `docker service ls` 33 | . `docker service logs webapp_web` 34 | 35 | == Kubernetes 36 | 37 | . Register a domain: `kubernetes.arungupta.me` 38 | . Create Route53 records 39 | . Create NS records in GoDaddy 40 | . Create a cluster: 41 | + 42 | ``` 43 | kops create cluster \ 44 | --name=kubernetes.arungupta.me \ 45 | --cloud=aws \ 46 | --zones=us-west-2a,us-west-2b,us-west-2c \ 47 | --master-size=m3.medium \ 48 | --node-count=3 \ 49 | --node-size=m3.xlarge \ 50 | --master-zones=us-west-2a,us-west-2b,us-west-2c \ 51 | --state=s3://kops2 \ 52 | --yes 53 | ``` 54 | 55 | == DC/OS 56 | 57 | . Launch https://downloads.dcos.io/dcos/stable/aws.html?_ga=1.207445715.1510362819.1478208859[DC/OS CloudFormation template] 58 | . If not done already, download CLI 59 | . `dcos config set core.dcos_url http://DCOS-ElasticLoadBa-OG73USRXKTX-912507967.us-west-1.elb.amazonaws.com` 60 | . `dcos auth login` 61 | . `dcos config show core.dcos_acs_token` 62 | .. Copy the value in `.dcos-token` 63 | . `dcos package install marathon-lb` 64 | . Update `app-definition.json` with `PublicSlaveDnsAddress` 65 | . Update `pom.xml` with `DnsAddress` 66 | . Deploy app: `mvn install -Pdcos` 67 | . Show services deployed at http:// 68 | . Access application: curl http:///airlines/resources/airline 69 | 70 | == AWS ECS 71 | 72 | Show how to create a cluster and talk about service discovery 73 | -------------------------------------------------------------------------------- /slides/2016-Devoxx-Migrate-VM-to-Containers.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/2016-Devoxx-Migrate-VM-to-Containers.key -------------------------------------------------------------------------------- /slides/2016-Devoxx-Migrate-VM-to-Containers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/2016-Devoxx-Migrate-VM-to-Containers.pdf -------------------------------------------------------------------------------- /slides/container-orchestration-aws.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/container-orchestration-aws.key -------------------------------------------------------------------------------- /slides/container-orchestration-aws.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/container-orchestration-aws.pdf -------------------------------------------------------------------------------- /slides/course/chapter1.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/course/chapter1.key -------------------------------------------------------------------------------- /slides/course/chapter2.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/course/chapter2.key -------------------------------------------------------------------------------- /slides/course/chapter3.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/course/chapter3.key -------------------------------------------------------------------------------- /slides/course/chapter4.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/course/chapter4.key -------------------------------------------------------------------------------- /slides/course/chapter5.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/course/chapter5.key -------------------------------------------------------------------------------- /slides/course/chapter6.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/course/chapter6.key -------------------------------------------------------------------------------- /slides/course/pre.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/course/pre.key -------------------------------------------------------------------------------- /slides/docker-introduction.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/docker-introduction.key -------------------------------------------------------------------------------- /slides/docker-introduction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/docker-introduction.pdf -------------------------------------------------------------------------------- /slides/docker-kubernetes-recipes.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/docker-kubernetes-recipes.key -------------------------------------------------------------------------------- /slides/docker-kubernetes-recipes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/docker-kubernetes-recipes.pdf -------------------------------------------------------------------------------- /slides/docker-kubernetes.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/docker-kubernetes.key -------------------------------------------------------------------------------- /slides/docker-kubernetes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/docker-kubernetes.pdf -------------------------------------------------------------------------------- /slides/ecs-introduction.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/ecs-introduction.key -------------------------------------------------------------------------------- /slides/jdays-keynote.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/jdays-keynote.key -------------------------------------------------------------------------------- /slides/jdays-keynote.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/jdays-keynote.pdf -------------------------------------------------------------------------------- /slides/mesos-introduction.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/mesos-introduction.key -------------------------------------------------------------------------------- /slides/mesos-introduction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/mesos-introduction.pdf -------------------------------------------------------------------------------- /slides/service-discovery-oscon2017.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/service-discovery-oscon2017.key -------------------------------------------------------------------------------- /slides/service-discovery-oscon2017.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/service-discovery-oscon2017.pdf -------------------------------------------------------------------------------- /slides/service-discovery.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/service-discovery.key -------------------------------------------------------------------------------- /slides/service-discovery.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arun-gupta/docker-java/e2738aa2bbe4ae11c248ded20d63d0c551fad480/slides/service-discovery.pdf --------------------------------------------------------------------------------