DevOps - everything as code
After participating in the DevOps course at Tikal,
It’s time to add some toturials and info on what I learned.
What are the chalenges of DevOps:
- Fast development on 3 axis: Scale - Complexity - velocity
- How to make all the tools available to the developers.
Some DevOps key concepts
- Everything as code
- Similarity of environments
- Developers Operations
- Operation development
- Continuous everything
The idea is to make everything (in the development cycle) as code and to handle it as code.
plan -> code -> build -> test -> release -> deploy -> operate -> monitor -> plan (next iteration).
A source control sould help with the following points: blame + diff + merge + who, what, when, where and why.
there are several brunching themas:
- brunch by release
- brunch by feature
- brunch by team
- single branch
There are several source control technologies that are popular CVS, SVN, GIT etc’.
The main attributes of git are:
- Everything is done locally.
- Make the change & share the change
- brunch & merge
- control your history
A build is the process of compiling, linking packing etc’
- compile - generate code
- link - get 3rd parties (libraries etc’)
- pack - binaries, archives, list packages, runtime, container.
- Test - unit / other
- static code analysis
- The make file
- incremental build
- Tasks and lifecycle
- make for java
- xml base
- can be extended by java
- task dependency
- well defined lifecycle
- convention over configuration
- dependency by binary
- inheritance of configuration
- the reactor (module set by profile)
- general purpose build system
- DSL (build on groovy)
- “build by convention”
- flexible / extensible
- built in plugins for java groovy ant maven
There are many methodologies for testing
- blackbox testing
- functional testing
- flow driven tests
- TDD and more.
I will focus on 2 tools
A cucumber is a tool based on Behavior Driven Development (BDD) framework which is used to write acceptance tests for the web application. It allows automation of functional validation in easily readable and understandable format (like plain English) to Business Analysts, Developers, Testers, etc.
Behavior Driven Development is an extension of Test Driven Development and it is used to test the system rather than testing the particular piece of code.
Cucumber can be used along with Selenium, Watir, and Capybara etc. Cucumber supports many other languages like Perl, PHP, Python, .Net and Java etc.
Selenium automates browsers. That’s it!
Selenium WebDriver tool is used to automate web application testing to verify that it works as expected. It supports all major browsers.
We configure a Jenkins server to automatically handle our deployments and we create Ansible roles and playbooks to easily spin up and configure new servers.
automation, manage complex deployments and speed productivity.
Jenkins provides hundreds of plugins to support building, deploying and automating any project.
Docker provides an additional layer of abstraction and automation of operating-system-level virtualization
Docker include swarm mode for natively managing a cluster of Docker Engines called a swarm.
- Cluster management integrated with Docker Engine
- Decentralized design
- Declarative service model
- Desired state reconciliation
- Multi-host networking
- Service discovery
- Load balancing
- Secure by default
- Rolling updates more info
Our DevOps is going the way of Prometheus, Alertmanager, node-exporter, CAdvisor & Grafana etc’.
Prometheus is an open-source systems monitoring and alerting toolkit.
It is now a standalone open source project and maintained independently of any company.
Prometheus’s main features are:
- a multi-dimensional data model with time series data identified by metric name and key/value pairs
- a flexible query language to leverage this dimensionality
- no reliance on distributed storage; single server nodes are autonomous
- time series collection happens via a pull model over HTTP
- pushing time series is supported via an intermediary gateway
- targets are discovered via service discovery or static configuration
- multiple modes of graphing and dashboarding support
The Alertmanager handles alerts sent by client applications such as the Prometheus server. It takes care of deduplicating, grouping, and routing them to the correct receiver integration such as email, PagerDuty, or OpsGenie. It also takes care of silencing and inhibition of alerts.
The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More
Exporter for machine metrics
Analyzes resource usage and performance characteristics of running containers.