Devops Intro
Devops Intro
INTRO TO DEVOPS
PAPARAO.C
3
4/27/2019
What is DevOps?
DEVOPS IS THE PRACTICE OF OPERATIONS AND DEVELOPMENT
ENGINEERS PARTICIPATING TOGETHER IN THE ENTIRE SERVICE
LIFECYCLE, FROM DESIGN THROUGH THE DEVELOPMENT PROCESS
TO PRODUCTION SUPPORT..
DevOps Philosophy
DEVOPS = AGILE?
“DEVOPS IS THE APPLICATION OF AGILE METHODOLOGY TO SYSTEM
ADMINISTRATION.”
6
4/27/2019
9
4/27/2019
10
INFRASTRUCTURE AS CODE
▸Automate everything
▸Infrastructure provisioning
▸Application deployment
▸Runtime orchestration
11
Dev workflow
▸ Write it in code
▸ Validate the code
▸ Unit test the code
▸ Built it into an artifact
▸ Deploy artifact to test
▸ Integration test it
▸ Deploy artifact to prod
12
4/27/2019
13
14
CONTINUOUS DELIVERY
‣ Integration (CI): Build and test
‣ Deployment (CD): Deploy and integration test
‣ Delivery: All the way to production
15
4/27/2019
CI
16
CD
17
18
4/27/2019
19
THE CD PIPELINE
▸ Only build artifacts once
▸ Artifacts should be immutable
▸ Deployment should go to a copy of production before going into
production
▸ Stop deploys if it a previous step fails
▸ Deployments should be idempotent
20
TOOLING
▸ Version Control (git, others, doesn’t matter as long as you use it)
▸ CI System (jenkins, bamboo, circleCI, travisCI)
▸ Build (whatever your platform needs - make/rake, maven, gulp,
packer)
▸ Test (*unit, robot/protractor, cucumber)
▸ Artifact Repository (artifactory, nexus, dockerhub, S3)
▸ Deployment (rundeck, ansible, your CM system)
21
4/27/2019
22
23
24
4/27/2019
25
26
27
4/27/2019
28
29
Tools
30
4/27/2019
31
Modern CD
(Cloud Native Apps)
32
Traditional CD
Immutable Infrastructure
– Wasted time and bandwidth. If your setup involves running a large amount of tasks,
then it would take a long time to bring up a new server.
– More complicated Service Discovery and integration issues as IP addresses change.
– You can no longer have any persistent data on the server, because the server will be
thrown away anytime. But this can be good or bad depending upon the context.
– OK for application servers. But for persistent data like Database, NFS, etc Immutable
servers are not easy.
– What if you need to run two applications on the same server for cost reasons?
Infrastructure is all about budgets too.
33
4/27/2019
34
Modern WebApps
In the modern era, software is commonly delivered as a service: called web apps, or software-as-a-
service. The twelve-factor app is a methodology for building software-as-a-service apps that:
Use declarative formats for setup automation, to minimize time and cost for new developers
joining the project;
Have a clean contract with the underlying operating system, offering maximum
portability between execution environments;
Are suitable for deployment on modern cloud platforms, obviating the need for servers and
systems administration;
Minimize divergence between development and production, enabling continuous deployment for
maximum agility;
And can scale up without significant changes to tooling, architecture, or development practices.
35
VI. Processes
Twelve-factor App Execute the app as one or more stateless
processes
I. Codebase VII. Port binding
Export services via port binding
One codebase tracked in revision control, VIII. Concurrency
many deploys
Scale out via the process model
II. Dependencies IX. Disposability
Explicitly declare and isolate dependencies Maximize robustness with fast startup and
graceful shutdown
III. Config
X. Dev/prod parity
Store config in the environment Keep development, staging, and production
IV. Backing services as similar as possible
XI. Logs
Treat backing services as attached resources Treat logs as event streams
V. Build, release, run XII. Admin processes
Run admin/management tasks as one-off
Strictly separate build and run stages
processes
36
4/27/2019
37
Cloud computing
– Central data centers for providing hosting services
– On-demand, scalable, unlimited computation and storage
38
Cloud Characteristics
Service
Elastic
HA
Unlimited Computation
39
4/27/2019
Managed by the
Managed by you
vendor
Cloud Service Delivery Model
40
Cloud PAAS
Google App Engine
Heroku
AppFog
Red Hat OpenShift
Service Fabric
Cloud Foundry
41
42
4/27/2019
43
DevOps Principles
44
DevOps Principles
“calms” model
• Culture
• Automation
• Lean
• Measurement
• Sharing
45
4/27/2019
CULTURE
• Create a culture of collaboration and ownership.
• Start small and scale out, not up.
46
Automation
• Fast feedback through automation.
• We need information to guide our decisions
47
LeanIT
• Lean approach to system’s thinking
• Localised optimisations are a mirage
48
4/27/2019
Measurement
• Measure the right things
• Be empirical, let the stats guide you.
• Beware of the cultural impact
49
Share
• Share goals to create a common purpose
• Share experiences to encourage learning
50
51
4/27/2019
52
53
Do IT Properly!!!!
54