Skip to content

Instantly share code, notes, and snippets.

@thevirtualbuddy
Created August 7, 2021 12:06
Show Gist options
  • Save thevirtualbuddy/0d3ce22ef8dcff59934a3e968ec2017b to your computer and use it in GitHub Desktop.
Save thevirtualbuddy/0d3ce22ef8dcff59934a3e968ec2017b to your computer and use it in GitHub Desktop.
A summary of DevOps Foundation by LinkedIn Learning.
## DevOps Foundations
* What is DevOps?
The practice of operations and development engineers participating together in the entire service lifecycle, from design through the development process of production support.
* The Five Levels of DevOps:
1. Values
2. Principles
3. Methods
4. Practices
5. Tools
* DevOps Core Values - CAMS
C - Culture: driven by behavior, attitude and sharing thoughts and ideas to people from different departments/fields.
A - Automation: People over Process over Tools; the accelerator (Priority)
M - Measurement: measure key metrics across organization
S - Sharing: sharing ideas and problems is the heart collaboration; openess and transparency.
* DevOps principles: The three ways
Model developed by Gene Kim and Mike Orzen
1. Systems Thinking: Dev -> Ops : Success of overall system and not of a particular team
2. Amplifying feedback loops: Dev <-> Ops :
3. Culture of continuous experimentation and learning: Dev <<->> Ops :
* Use the three ways to do the following:
1. Create team processes
2. Create team standards
3. Incorporate as part of management style
* DevOps Playbook: 5 methodologies
1. People over Process over Tools
2. Continuously Delivery: Coding, testing and releasing software frequenty in small batches to increase velocity and quality.
3. Lean management: Work in small batches, work in progress limits, feedback loops, visualization.
4. Change control: (Visible Ops - Style Change Control): Eliminate fragile artifacts, Create a repeatable build process, manage dependencies, Create an environment of continuous improvement
5. Infrastructure as Code: System treated like code, Checked into source control, Reviewed build and tested, Managed programatically
* 10 practices for DevOps success
1. Incident command system
2. Developers on call
3. Public status pages
4. Blameless postmortems
5. Embedded Teams
6. The Cloud
7. Andon Cords: to halt an process to fix the bug that one saw.
8. Dependency injection (Inversion of control): Loosely coupled
9. Blue/Green deployment: Load balancer(Live and System)
10. The chaos monkey: technology management, increase reliability
* DevOps Tools
DevOps tool chain: No single tool can do everything.
So, we need chain of tools to work in an efficient way to operate the system.
# Tool Criteria:
1. Programmable
2. Verifiable (Trust, but verify)
3. Well behaved.
----------------------------------------------------------------------------------
* Use your words
Blameless postmortems and transparent uptime.
* Blameless postmortems:
1. Do it within 48 hours.
2. Have the team build a teamline.
3. Have a third party run the meeting.
* Run Blameless postmortems
1. Description of the incident.
2. " of the root cause.
3. How the incident was stabilized or fixed.
4. Timeline of events and actions taken.
5. How customers were affected.
6. Remediations and corrections.
* Transparent uptime
Communicate with customers during outage.
1. Admit failure.
2. Sound like a human.
3. Have a communication channel.
4. Be authentic.
* Do unto others.
1. Lack of context.
2. Open it up
* Management best practices
1. Independent, cross-functional teams
2. Help people through change
3. Agile, & lean management
* Conway's Law
Conway’s law is an adage stating that organizations design systems that mirror their own communication structure.
* Kaizen: Continuous improvement
-> Good processes brings good results
-> Go see for yourself (gemba)
-> Speak with data and manage by facts
-> Take action to contain and correct root causes
-> Work as a team
-> Kaizen is everybody's business
* Gemba: The real place - the locus; where the things happen
Management by walking around
* Plan Do Check Act cycle.
* The 5 Whys
Ask five whys for the cause of failure.
-> Focus on underlying causes, not symptoms
-> Don't accept answers like "not enough time"
-> Track the forks in your five Whys
-> Do not accept human error as root cause of the error.
-> People don't fail, processes do.
----------------------------------------------------------------------------------
### The Building Blocks of DevOps
Agile, Lean, ITIL
* Manifesto for Agile Software development
We are uncovering better ways of developing software by doing it and help others do it
Through this work we have come to value
- individuals and interactions over processes and tools
- working software over comprehensive documentation
- Customers collaboration over contract negotiation
- Responding to change over following a plan
That is, while there is value in the items on the right, we value the items on the left
Agile does not mention anything about ops part.
* Lean
A systematic process for eliminating waste
* 7 principles of Lean Software
1. Eliminate waste: activities which doesnt add value are waste. 3 types of waste (Muda, Muri, Mura)
2. Amplify learning
3. Decide as late as possible
4. Decide as fast as possible.
5. Empower the team
6. Build in the integrity
7. See the whole
* Types of waste
1. Muda - work that absorbs resources, but adds no value
2. Muri - unreasonable work imposed on workers and machines.
3. Mudra - work coming in unevenly instead of constant or regular flow
* Forms of waste
1. Partially work done.
2. Extra features.
3. Relearning.
4. Handoffs.
5. Delays.
6. Task switching.
7. Defects
* Build, Measure, Learn
1. Build the minimum viable product.
2. Measure the outcome and internal metrics.
3. Learn about your problems and your solution.
4. Repeat. Go deep where it's needed.
* ITIL - IT Infrastructure Library
* ITSM - IT Service Management
* ITIL Phases
1. Service strategy
2. Service design
3. Service transition
4. Service operation
----------------------------------------------------------------------------------
### Infrastructure Automation
* IaC - Infrastructure as code
* Configuration Management
_____________________________
* important terminologies:
-> Provisioning - making a server ready for operation, including hardware, OS, system services, and network connectivity.
-> Deployment - automatically deploying and upgrading applications on a server
-> Orchestration - the art of performing coordinated operations across multiple systems
-> Configuration Management - Management of change control for systems configuration after initial provision; maintaining and upgrading the application and its dependencies.
-> Imperative (procedural) - commands necessary to produce a desired state are defined and executed.
-> Declarative (functional) - a desired state is defined, relying on the tool to configure a system to match the state.
-> Idempotent - ability to repeat same procedure repeatedly, resulting in the same outcome.
-> Self-Service: ability for an end user to initiate a process without having to go through other people.
* Canary (Staged) Deployment
* Blue/Green Deployment (Load balancer)
* Immutable Deployment
_____________________________
* The configuration management Pipeline
* The Container Pipeline
* The Bakery Pipeline - Netflix example
* Infrastructure Toolchain
----------------------------------------------------------------------------------
### CICD
Small + Fast = Better
* Continuous Integration
Practice of automatically building and unit testing the entire application frequently ideally on every source code check in.
* Continuous Delivery
Deploying every change to a production-like environment, and performing automated integration and acceptance testing.
* Continuous Deployment
After testing every change, automatically deploying to production.
* Top 5 benefits of CICD
1. Time to market goes down
2. Quality increases, not decreases.
3. This limits your work in progress.
4. Shortens lead times for changes.
5. Improves mean time to recover.
" Cease dependence on inspection to achieve quality "
* Continuous Integration Practices
1. Builds should pass the coffee test. (less than 5 minutes)
2. Commit really small bits. (Atomic Commits.)
3. Don't leave the build broken.
4. Use a trunk-based development flow. (No long-running branches)
5. Don't allow flaky tests. Fix them.
6. The build should return a status, a log and an artifact.
* The continuous delivery pipeline.
It is the practice of deploying every change to a production like environment and performing automated integration and acceptance testing along the way.
* Continuous Delivery Practices:
1. Only build artifacts once.
2. Artifacts should be immutable. ( 1st and 2nd practices ensures integrity and trust )
Code -> Version Control -> CI system creates build -> Artifact added to central repo -> Staging(Pre-prod) -> Testing -> Ready for production
3. Staging should be a copy of production.
4. Stop deploys if a previous step fails.
5. Deployment should be idempotent.
* Types of Testing:
1. Unit Testing: test done at lowest level of the application
2. Code hygiene: best practices, linting
3. Integration Testing: testinf done with all components of the application
4. TDD, BDD, ATDD :
Test-Driven Development(State desired outcome as a test, write code to pass the test, repeat)
Behavior-Driven Development(Work with stakeholders, describes business functionality, base tests on natural language descriptions)
Acceptance-Test Driven Development(Scenarios are from end user perspective, Use cases are the basis of automated testing, Testing is continuous during development)
5. Infrastructure Testing: config and test related to it.
6. Performance Testing : load test, pressure test
7. Security Testing: Security aspects
* Dealing with Slow Tests
1. Use non blocking tests in your pipeline.
2. Use time-scheduled testing (for example nightly)
3. Use monitoring to accomplish some test goals.
* 6 key phases for continuous delivery
1. Version Control (Git)
2. Continuous Integration systems (Jenkins)
3. Build (language dependent: make or rake, Maven, Gulf for front-end)
4. Test: Unit Test (JUnit, Pylint, GoLint), Integration Testing (robot, protractor, cucumber), Local testing (docker compose)
5. Artifact repository (Artifactory, Nexus, DockerHub, Amazon S3)
6. Deployment (Rundeck, Urbancode, deployinator)
----------------------------------------------------------------------------------
* Reliability
The ability of a system or component to function under stated conditions for a specified period of time.
* MTTR (Mean Time to Recovery)
How quickly a service can recover from a disruption and restore service.
* MTBF (Mean time between failure)
The average time between service disruption
* Design for operations
* Cascading Failure Pattern
* Circuit Breaker Pattern
* Hystrix - netflix open source project
* factorish github app
* Follow martinfowler
* All systems fail.
* github.com/Netflix/chaosmonkey
* Cassandra - big data solution
* Operate for design - Metric & Measurement
* How complex system fails
-> Change introduces new forms of failure.
-> Complex systems contain changing mixtures of failures laten within them.
-> All complex systems are always running in degraded mode.
* 6 areas of Monitoring
1. Service Performance and Uptime - simplest form of monitoring to check if my service working.
2. Software component metric - is this particulat host working.
3. System Metrics - is the service functioning normally.
4. App metrics - account of all errors occured etc.
5. Performance - APM(Application performance management) , RUM(real user monitoring)
6. Security monitoring - system security, application security, custom application events, anamolies.
* Lean Approach
1. Build
2. Measure
3. Learn
4. Repeat
* Logging
Five Ws of Logging.
1. What happened?
2. When did it happen?
3. Where did it happen?
4. Who was involved?
5. Where did the entity come from?
* Centralized logging (syslogs)
1. Don't collect log data that you won't use.
2. Keep logs for as long as they can be used.
3. Alert only on what you must respond to.
4. Don't exceed business security needs.
5. Logs change.
Check : Rerun scripts on Github
* SRE Toolchain
1. Monitoring - SaaS (Software as a Service Monitoring) - Librato, Open-Source Monitoring - Graphite, Prometheus
2. Logging & Management tools
3. Security
----------------------------------------------------------------------------------
* Unicorns - startups, trendsetters, hire top talent
* Horses - enterprise it, large budgets, large scale
* Donkeys - IT worker, truly benefit from Devops, small teams
* Conferences
DevOpsDays conference - Donkeys
Velocity - unicorns, and horses
DevOps Enterprise Summit
ChefCon
PuppetConf
* Top 10 books to read in DevOps space
1. The visible Ops
2. Continuous Delivery - Jez Humble & David Farley
3. Release It! - Michael T. Nygard.
4. Effective DevOps
5. Lean Software Development: An agile toolkit
6. Web operations
7. The practice of Cloud System Administration
8. The DevOps Handbook -- Check
9. Leading the transformation
10. The Phoenix Project -- Check
* Twitter handles and blogs
devopsweekly.com - newsletter
@garethr
@devopsdotcom
@ashimmy
dzone.com/devops-tutorials-tools-news
infoq/devops
devopscafe.org
@botchgalupe
@damonedwards
arresteddevops.com/
foodfightshow.org
@nathenharvey
kitchensoap.com
itrevolution.com/devops-blog
dev2ops.org
@ernestmueller
@wickett
@iteration1
DevOps : it's a way of thinking about your job and about collaborating with others.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment