You are on page 1of 68

Introduction to

DevOps
and the
Practical Use Cases
at

Presented by Kriangkrai Chaonithi @spicydog


11/11/2019 | KMUTT | Computer Engineer | Software Engineer
Download the Updated Slide

http://bit.ly/spicydog-devops-cpe
Hello! My name is Gap
Education
● MS Computer Engineering (KMUTT)
● BS Applied Computer Science (KMUTT)

Work Experience
● CTO & co-founder at Credit OK
● Former R&D Manager at Insightera
● Former Android, iOS & PHP Developer at Longdo.COM

Fields of Interests
● Software Engineering
● Cloud Architecture & Distributed Computing
● Computer Security
● Machine Learning & NLP https://spicydog.me
Agenda
● What is DevOps?
○ Why DevOps is so popular?
○ What do DevOps engineers do?
○ DevOps Skill Set

● Where & how we deploy web application?


● DevOps Technologies
○ Version Control Software
○ CI/CD Pipeline
○ Container Technology
○ Container Orchestration
○ Logging & Monitoring

● DevOps at Credit OK
○ Technology Stack
○ Cloud Technologies & DevOps Integration

● The modern software development obstacles


● Summary
What is DevOps?

https://www.pexels.com/photo/colorful-toothed-wheels-171198/
Dear
Ops What is DevOps?
mourners nu NErags
8osesoo n
mo
Ujome d
radio
Ionng

https://www.redmineup.com/pages/blog/devops-in-redmine
DevOps relationships
softwane development

https://www.smartsheet.com/devops
Why DevOps is so HOT?
improve Quality I putinto Git d others
bout automatic an automation
● Directly improve dev productivity

● Technology advancement

● Open source communities nor instead ofthe


decker
● Modern technology hype

https://unsplash.com/photos/0VwOXfSbBNY
What do DevOps engineers do?

● Build Docker images for the team mr buildthespit

● Develop CI/CD pipeline

● Create and maintain deployment environment

● Deploy applications to the cluster

● Monitor errors, bugs and report to the team

https://unsplash.com/photos/QBpZGqEMsKg
DevOps Skill Set
● Cloud & Server Infrastructure

● Tools & Technology Embracement

● Computer Security

● Communication soft skill


Lforcusing on this

https://unsplash.com/photos/842ofHC6MaI
Where and How we
Deploy Web Application?

https://unsplash.com/photos/NVnU0WIhC28
How to Deploy a Web Application?

Compiled Languages

-
rrTnion8n irTs
Compile the codes to executable

non .q
- Upload executable to the server

un
Interpreted Languages mm application line by
line
- Upload (or `git pull`) source codes on the server
Physical server
gp
Bare Metal Server
● Pre-cloud era

● Install OS and dependencies to the machine

● One machine / one customer

● Groom
Expose network to the internet

● Colocation/on-premise UInnoetuerhnonodog

● SSH/FTP/Git to the server

theProblem is the server is very fast


that a lot of customer that the waste
Um
Virtualization
● One machine, many servers

● One machine / multiple customers

● VPS / Cloud


wyserner
SSH/FTP/Git to the server
Infra structure for you
bIaaS

SonuInnisnisadovos
Nowriormoot
Containers
● Docker / Kubernetes / KNative

● Several containers in one node (server)

● Auto deploymentmotions

● Auto scale

● Cost based on number of nodes

● Infrastructure as code! (IaC)

Platform
for
PaaS/ CaaS
mroemolisquiruvvoo Cloud
Serverless Functions

λ
● Write your code and deploy!

● Auto deploy

● Auto scale

● Pay per request/computation

● No infrastructure!!

FaaS

note infrastructure ions doing w


Some Interesting Deployment Platforms

Platform as a Service Container as a Service Function as a service


PaaS CaaS FaaS
Eand user to develop virtualization Theconcept of
g microservice

no considering infra

lercontentthe server
customer to deploy
DevOps Technologies

https://unsplash.com/photos/8KfCR12oeUM
Version Control Software
Git Workflow

https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
CI/CD Pipeline
What is CI/CD?
Continuous Integration Conti hus Deline y

run the unittesting

Note
repository girosJu
https://dev.to/markoa/continuous-integration-explained-59f9
repository

https://dev.to/markoa/continuous-integration-explained-59f9
GitLab CI/CD

Auto comunicate
https://about.gitlab.com/product/continuous-integration/
https://gitlab.com/gitlab-org/gitlab-ce/pipelines
Docker

Engine misnastasEnons r
doo Sm Wha odorsFionn
ournode server

Container Technology
Virtualization vs Containers
Benefits of using Docker
riiaoanfog.TW
● Consistent development, testing, and production environments

● Docker Engine can run on Linux, (MacOS, and Windows)

● Language and application dependencies are


Pre-install from docker images

● Run different versions of same programming language


on the same machine
Docker Container
wondocket

image undoorts
j RAM CPU
config file Iw
roometros

https://cultivatehq.com/posts/docker/
Docker Image
Metonoursuu no container

application
rinsing
1
https://subscription.packtpub.com/book/application_development/9781788992329/1/
ch01lvl1sec14/understanding-docker-images-and-layers
Docker Compose
file nouqnmesoso.no Container mournoption

is
one

oaf
o
database

https://www.kinamo.be/fr/support/faq/faire-le-setup-d-un-environnement-de-developpement-avec-docker-compose
platform toothmo Deploy A scale
gp container

software Info Container


Orchestration
software noun
so

Deployment & Container Orchestration


What is Kubernetes?
deploy to theserver
going to
Infrastructure as Code
Hgw
(IaC)
Infra
Design Principles structure
deploy the
- Workload Scalability
- High Availability
- Security container for
- Portability
When
you
some node down another
Key Components work instead
- Pod
- Deployment
mfrioooronioniq
- Replica onin sins podcousasoins https://blog.risingstack.com/what-is-kubernetes-how-to-get-started/
podrrnw
ng's

mood
no

https://thenewstack.io/kubernetes-an-overview/
Warning! Kubernetes Services are Complicated
Please read and understand this link before your first deployment!
https://medium.com/@metaphorical/internal-and-external-connectivity-in-kubernetes-space-a25cba822089
Logging & Monitoring
www.mooofsoofoysenuos Cloud system
Credit Scoring Platform on Big Data Analytics

creditok.co
Our Technology Team

Data Application
Science Development

Data Engineer
&
DevOps
How Credit OK Deploys Application with
Use Container on Development Env
Dev Computer docker-compose Container Registry

mount
Source Code Source Code

volume

expose Container load


DEV Web Browser Base Image
(nginx + php)

network

Sidecar Container load Service Image


(MySQL) (MySQL)
volume

MySQL Storage
Use Container on GitLab CI
GitLab GitLab Runner Container Registry

push clone
Git Source Code

volume

Container load
DEV Result Base Image
(nginx + php)
network

Sidecar Container load Service Image


(MySQL) (MySQL)
volume

MySQL Storage
the tester

buildthe
docker
image
Build Docker Image for Production
GitLab GitLab Runner Container Registry

push clone
Git Source Code

volume

DEV Container
(nginx + php)
load
Result Base Image
COPY ./ ./

Container
App Image
(nginx + php + src)
Deploy the Docker Image
Container Registry GitLab Runner Kubernetes (GKE)

Google Cloud
SDK
Google Cloud Container
SDK Image auth kubectl
Patch
New App Image
Deployment
Prev App
Container

New App
App Image
Container
Our Infrastructure is on
The Modern Software
Development Obstacles

https://unsplash.com/photos/Cd2QnIKU6dk
Warning! What to concern before going Container
● Environment variables are crucial, make your application flexible with .env

● Never use persistent storage on Container if you don't truly understand what you are doing!

○ Use GCS to store users’ files

○ Store session and cache in a centralized database

○ If you can design application logic w/o cache invalidation, caching in the Pod is okay

● Write log to external logging service is a must

● Enforce Git Workflow (develop, staging, production branches)

● Please read how to make Docker Image best practice. Beware of Docker Image cache!
At least, DO NOT use latest tag , it might be a time bomb, pin the version if possible.
Warning! What to concern before using CI/CD Pipeline

● Write unit testing as much as possible, you will never sleep without it

● Every git push, the pipeline run, you have to wait

● Every time you want to deploy, you have to wait


(no more save and upload to deploy right away)

● Make sure you do good logging for debugging

● Make sure you can rollback the wrong deployment quickly


Summary
● DevOps is about automating development operation
● DevOps can ensure software quality by automated testing
● DevOps can improve team productivity with CI/CD
● At large scale, there is no more manual deploy
● Therefore we do IaC to automate infrastructure
● When infrastructure is automated, we need robust logging system, plan thoroughly
● Systematic logging leads to great monitoring system
● Systematic logging drives data driven culture where we make decision based on data
● DevOps engineer is in high demand with specialized skills
● GCP is free $300 first 1st year, GitLab is free forever, go register and practice.

Learning DevOps is free!


https://www.reddit.com/r/LateStageCapitalism/comments/cnqzv8/capitalism_is_a_pyramid_scheme_2019/
https://www.reddit.com/r/LateStageCapitalism/comments/cnqzv8/capitalism_is_a_pyramid_scheme_2019/
https://www.reddit.com/r/LateStageCapitalism/comments/cnqzv8/capitalism_is_a_pyramid_scheme_2019/
https://www.reddit.com/r/LateStageCapitalism/comments/cnqzv8/capitalism_is_a_pyramid_scheme_2019/
https://www.reddit.com/r/LateStageCapitalism/comments/cnqzv8/capitalism_is_a_pyramid_scheme_2019/
https://www.reddit.com/r/LateStageCapitalism/comments/cnqzv8/capitalism_is_a_pyramid_scheme_2019/
STABLE JOB is UNREAL
STABLE COMPANY is UNREAL
What REAL are YOUR SKILLS
Your skills VALUED by SOCIETY
FIND OUT who YOU ARE
BE the BEST of YOURSELF
always PRACTICE and IMPROVE
CONTRIBUTE back to SOCIETY
Qu s o & An er
Time is short, let’s utilize the networks.
Feel free to connect with me via spicydog.me

You might also like