get your mobile app in production in 3 months: devops and infrastructure

22
Get your app into production in 3 months Josef Gattermayer, co-founder

Upload: ackee

Post on 21-Jan-2018

315 views

Category:

Technology


2 download

TRANSCRIPT

Get your app into production in 3 months

Josef Gattermayer, co-founder

Case study: App4Fest

https://app4fest.com

Case study: App4Fest

Mobile apps (Android, iOS)

Backend (Node.Js API server)

Web administration (React)

Web app (React)

DevOps and Infrastructure

Josef Gattermayer, CIO

The worst thing that can happen to a startup are users

Code repository

Google Cloud source repositories

Github

Bitbucket

Gitlab

Continuous integration

Essential process

Single point where all kind of apps get build

Jenkins is the swiss knife

Jenkins pipeline as a code

stage 'Checkout' checkout scm stage 'Build Docker image' sh("docker build -t ${imageTag} .") stage 'Run Docker tests' … stage 'Run Docker lint' … stage 'Push image to registry' sh("gcloud docker push ${imageTag}") stage 'Create namespace for app'

Jenkins pipeline as a code

buildNodejs{ // MODIFY projectName = ‘node-template' slackChannel = '#ci-nodetemplate' appName = ‘node-template' cloudProject = [development: 'infrastruktura-1307', master: ‘ackee-production'] buildCommand = 'npm install && npm run postinstall' // MODIFY ONLY IF YOU KNOW WHAT YOU ARE DOING nodeImage = 'node:5.12.0' nodeEnv = "-e NODE_PATH=./app:./config" nodeTestEnv = '-e NODE_ENV=test -e NODE_PATH=./app:./

How to run the apps

Monolithic VPS

Application platform (such as Cloud Foundry)

Containers (…Docker)

Dockerfile

FROM node:5.12.0ENV NODE_PATH=./config:./appWORKDIR /usr/src/app

# Bundle app sourceCOPY . /usr/src/appEXPOSE 3000CMD [ "npm", "start" ]

Orchestration

Way to manage containers

Docker Compose

Kubernetes

Kubernetes

Open-source or hosted

Run / Stop / Restart a container

(Auto) Scale up / down

Manage resources

Load balance traffic

Manage logs

Kubernetes

apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: APP_NAMEspec: replicas: 2 spec: containers: - name: APP_NAME image: IMAGE_URL env: - name: TZ value: "Europe/Prague"

Kubernetes

resources: requests: memory: "128Mi" cpu: "5m" limits: memory: "256Mi" cpu: "80m" ports: - name: frontend containerPort: 3000

Where to run the apps

Own HW/VPS

Amazon EC2

Google Container Engine

Google Container Engine

Built-in Kubernetes support

WebGUI + command line interface

Health Checks

Container Registry

Monitoring

Alerts

Ready for DevOps!

www.ackee.de

WE CREATE MOBILE APPS