Presentation is loading. Please wait.

Presentation is loading. Please wait.

Container technology, Microservices, and DevOps

Similar presentations


Presentation on theme: "Container technology, Microservices, and DevOps"— Presentation transcript:

1 Container technology, Microservices, and DevOps
Digital Innovation Workshop April 2019 Henrik Bærbak Christensen

2 Henrik Bærbak Christensen
Goal Deploy a SkyCave horizontally scaled server system using a database as storage/session cache. By writing a ‘docker stack’ file (compose file) Architecture: Docker swarm orchestration (just in your M51 vm) One dedicated network Two ‘daemon’ instances, exposed on port 4567 One database storage (memcached) Optional: docker visualizer Henrik Bærbak Christensen

3 Henrik Bærbak Christensen
Initialization But I have no swarm??? Dispair not... Just docker swarm init in your M51 And now you have a swarm of ... one node! And it should work perfectly ok... Henrik Bærbak Christensen

4 Henrik Bærbak Christensen
Hints Docker compose file version ‘3’ Remember that nodes are named on the network ! Thus a node in the compose file defined by name ‘db’ will have that name on the network – you may ‘ping db’ if on that network Remember that ‘localhost’ means just that Ie. Never use localhost in a container’s connection string! Remember that services cannot connect over port mapping You need to have named images in your compose file Bug in the daemon image? You will have to build it again! You will need to modify the CPF file ‘localhost’ is not the nodename of the storage Henrik Bærbak Christensen

5 Henrik Bærbak Christensen
Hints You need to issue another command than the default one in the docker file Because your CPF of the daemon is different Take small steps Build the compose file incrementally, test, and iterate Henrik Bærbak Christensen

6 Anatomy of compose file
Override CMD in dockerfile State dependency on other service Henrik Bærbak Christensen

7 More microservice like...
Exercise 2 More microservice like...

8 Henrik Bærbak Christensen
Add Subscription A fully containerized subscription service is available on docker hub henrikbaerbak/subscription:1 Exposes the port ‘7654’ which is the service entry point. It has a hard coupling to its database service: mongo:3.2.5 Must be named ‘mongodb’ in the network. Henrik Bærbak Christensen

9 Henrik Bærbak Christensen
Hints You need to change the CPF for the skycave daemon to something similar to: As... Your daemon must use an implementation of the subscription interface that contacts a real serviceI Copy the above _IMPLEMENTATION verbatim! And it must contact it on the proper node on the network Use whatever name you give your container/service... Henrik Bærbak Christensen

10 Henrik Bærbak Christensen
Additional Of course the database must be persisted between deployments. Have a look at ‘volumes’ Mongodb stores all database files in ‘/data/db’ so you have to mount a named volume in this path in the container. And you have to deploy the DB container on the same node in the swarm... Henrik Bærbak Christensen

11 Henrik Bærbak Christensen
More Additional Have a look at portainer.io Use it to get a ‘dashboard’ of your swarm… Henrik Bærbak Christensen


Download ppt "Container technology, Microservices, and DevOps"

Similar presentations


Ads by Google