Slide 1

Slide 1 text

1@bryantebeek Intranet Spawner Application

Slide 2

Slide 2 text

1@bryantebeek The Backstory "Spawn an instance of the Intranet application with minimal effort" - Joe

Slide 3

Slide 3 text

1@bryantebeek The Backstory The Intranet Application

Slide 4

Slide 4 text

1@bryantebeek The Backstory The Intranet Application Build-in chat Timeline of updates Groups Events Articles Colleagues

Slide 5

Slide 5 text

1@bryantebeek The Backstory The Intranet Application Mobile app Android / iOS Focus around chat Notifications, etc.

Slide 6

Slide 6 text

1@bryantebeek The Backstory The Stack Meteor + Docker

Slide 7

Slide 7 text

1@bryantebeek The Backstory The Stack DigitalOcean Meteor + Docker → Ansible →

Slide 8

Slide 8 text

1@bryantebeek The Challenge Build an application that lets Joe spawn an instance of his intranet application with minimal effort

Slide 9

Slide 9 text

1@bryantebeek The Challenge So what now? • We need to build an application for Joe to manage his instances • Every instance spawned will need • a url .intranet.io • a place to run • custom environment variables "I can do all of this for you, and more..." - mr. Kubernetes

Slide 10

Slide 10 text

1@bryantebeek The Solution We stick to the existing solution and make an abstraction on top of it

Slide 11

Slide 11 text

1@bryantebeek The Solution The Spawner Application

Slide 12

Slide 12 text

1@bryantebeek The Solution The Spawner Application Build with Laravel

Slide 13

Slide 13 text

1@bryantebeek The Solution The Spawner Application • Provisioning was originally done with Ansible • Integrating this in Laravel feels like reinventing the wheel

Slide 14

Slide 14 text

1@bryantebeek The Solution We need something to run Ansible for us

Slide 15

Slide 15 text

1@bryantebeek The Solution So I thought ... ... let's call one of our old friends

Slide 16

Slide 16 text

1@bryantebeek The Implementation Putting everything together

Slide 17

Slide 17 text

1@bryantebeek Spawning an instance

Slide 18

Slide 18 text

1@bryantebeek Spawning an instance Contact details Application details e.g. slug, domain What happens now?

Slide 19

Slide 19 text

1@bryantebeek Spawning an instance Request a droplet using the DigitalOcean API +

Slide 20

Slide 20 text

1@bryantebeek Spawning an instance 1. Request a droplet Poll DigitalOcean API to see if droplet is ready +

Slide 21

Slide 21 text

1@bryantebeek Spawning an instance + + Start droplet provisioning job in Jenkins Also create a DNS record for the application 1. Request a droplet 2. Poll; is droplet ready?

Slide 22

Slide 22 text

1@bryantebeek Spawning an instance Poll the instance on the provided domain to see if it's ready 1. Request a droplet 2. Poll; is droplet ready? 3. Provision droplet + DNS

Slide 23

Slide 23 text

1@bryantebeek Spawning an instance Email Joe that the application instance is ready 1. Request a droplet 2. Poll; is droplet ready? 3. Provision droplet + DNS 4. Poll; is application ready?

Slide 24

Slide 24 text

1@bryantebeek "Bryan, I messed up the url, can I destroy this instance easily?" - Joe

Slide 25

Slide 25 text

1@bryantebeek Destroying an instance Queue a snapshot of the droplet using the DigitalOcean API +

Slide 26

Slide 26 text

1@bryantebeek 1. Queue snapshot Remove the DNS record, again using the DigitalOcean API + Destroying an instance

Slide 27

Slide 27 text

1@bryantebeek 1. Queue snapshot 2. Remove DNS record Destroy the droplet using the in DigitalOcean API + Destroying an instance

Slide 28

Slide 28 text

1@bryantebeek "One last thing.. what about backups?" - Joe

Slide 29

Slide 29 text

1@bryantebeek A backup / restore can be started on demand + Backup / restoring an instance

Slide 30

Slide 30 text

1@bryantebeek A backup / restore can be started on demand + Backup / restoring an instance

Slide 31

Slide 31 text

1@bryantebeek Thank you