By Tony Pai
tonyxpai@twitter / tonypai@medium / tpai@github
--guide
--help
--info
man
define
有一天,有個老闆聽說了有 DevOps 工程師這種新職業。
馬上去 google DevOps,就看到這張圖
馬上拿起公司電話撥了分機給人資
過沒多久產品部門接到電話
人資說:「公司近期會找一位 DevOps 工程師進來」
產品部所有人都非常的開心
維運說:「我們終於要有自動化部署了!」
測試說:「我們終於要有自動化測試了!」
人資接著說:「所以維運跟測試麻煩你們收拾一下東西。」
Source: wiki
https://goo.gl/qDCYkK
By Tony Pai
Monolithic 架構,前人自幹的 PHP Framework,由遠端團隊維護。
PHP
mycompany.com/admin/*
mycompany.com/services/*
sub.hiscompany.com/admin/*
sub.hiscompany.com/services/*
/admin/*
/service/*
Service
F
Load Balancer
Routing Rules
or
*
mycompany.com/admin/*
sub.hiscompany.com/service/*
Monolithic 架構,前人自幹的 PHP Framework,由遠端團隊維護,服務 Z 的 API 由服務 F 提供。
Microservice 架構,使用 Next.js Server Rendering Framework。
PHP
Next.js
API
mycompany.com/admin/*
mycompany.com/services/*
mycompany.com/api/*
mycompany.com/page/*
sub.hiscompany.com/admin/*
sub.hiscompany.com/services/*
sub.hiscompany.com/api/*
sub.hiscompany.com/page/*
/m/*
/admin/*
/services/*
/_next/*
/static/*
/page/*
/api/*
Service
F
Service
Z
Load Balancer
Routing Rules
mycompany.com/api/*
mycompany.com/page/*
HTTP 80
HTTPS 443
SSL
Certificate
https://sub.newcompany.com
SSL Certificate
Listener Rules
Load Balancer
SSL Certificate
HTTP 80
HTTPS 443
SSL
Certificate
Listener Rules
Load Balancer
https://sub.newcompany.com
Load Balancer A
SSL Certificate
Load Balancer B
SSL Certificate
Routing Rules
Routing Rules
Load Balancer
SSL Certificate*
SSL Certificate
Routing Rules
$ ssh -i my.pem me@server
$ git checkout master; git pull --rebase
$ yarn
$ jest
$ node server.js
Source: draw.io
1.
2.
3.
4.
5.
6.
Unit Tests
Build
Deploy to
Stage
Acceptance
Tests
Deploy to
Production
Continuous Delivery
Continuous Deployment
Continuous Integration
Manual
Auto
Unit Tests
Build
Deploy to
Stage
Acceptance
Tests
Deploy to
Production
Continuous Delivery
Continuous Deployment
Continuous Integration
Manual
Auto
Manual
Cluster Name
Service Name
Who
Revision Number
Commit Hash
Platform
Task Name
High Concurrency
Source: draw.io
Source: draw.io
Source: draw.io
Source: Free docker icon source
EC2 (T2-Small): 1CPU, 2GB RAM
Memory: 300MB per task
70%: 1 50%: 4 30%: 5 10%: 16