[go: up one dir, main page]

100% encontró este documento útil (1 voto)
469 vistas101 páginas

Devops v5

Este documento presenta una introducción a DevOps. Brevemente describe algunos conceptos clave como Value Stream, Continuous Delivery, Infraestructura como código, herramientas de automatización como Vagrant, Terraform y Ansible, y diferentes capas de automatización. También explora brevemente algunos patrones y anti-patrones de topologías DevOps.

Cargado por

Javier Guerrero
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
100% encontró este documento útil (1 voto)
469 vistas101 páginas

Devops v5

Este documento presenta una introducción a DevOps. Brevemente describe algunos conceptos clave como Value Stream, Continuous Delivery, Infraestructura como código, herramientas de automatización como Vagrant, Terraform y Ansible, y diferentes capas de automatización. También explora brevemente algunos patrones y anti-patrones de topologías DevOps.

Cargado por

Javier Guerrero
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
Está en la página 1/ 101

D e v p s

@inicopaez

v5.0
Taller de Prácticas

Dev ps
@inicopaez

v5.0
A bit about me
A bit about you
D e v p s
Culture Technical
Process Practices

Tools
D e v p s
Culture Technical
Process Practices

Tools
Value Stream
Value Stream

Development Operations
Value Stream

Development Operations
Interests mismatch

speed stability

Development Operations
Value Stream

Development

Operations
D e v p s
Value Stream

Development

Operations
Humans

Beasts
Vampires Werewolves
Blade
Vampires + Humans
Business

IT
Development Operations

developers sysadmins

software hardware
Agile
Development + Business
Continuous Information
integration radiators

Acceptance Frequent
environments releases
D e v p s
D e v p s
A role or a mindset?
https://www.linkedin.com/jobs/search/?keywords=devops
https://www.linkedin.com/search/results/people/?keywords=devops
Búsqueda laboral
Búsqueda DevOps publicada en una lista de informáticos Desarrollar herramientas, en Ruby y Java, que automaticen procesos
de backend / backoffice.
Buscamos profesionales recibidos o estudiantes avanzados de
carreras informáticas o afines, que estén interesados tanto en Desarrollar scripts de deployment para ejecutar desde Jenkins.
programación como en aspectos de infraestructura y administración:
SaaS, Elasticsearch, Cassandra, Nginx, HaProxy, Apache Storm, Redis, Capacidad para poder llevar adelante múltiples tareas de forma
Tomcat, Passenger, etc. simultánea.

Comprender con profundidad la configuración de productos Open Source Tener excelente predisposición para solucionar problemas en el dia
y velar por el correcto uso de estos productos por parte de los a dia.
desarrolladores.
REQUISITOS
Tener conocimientos de Sistemas Operativos y Redes, se valorará tener - Tenés que ser estudiante avanzado o graduado de carreras de
aprobadas ambas materias si es estudiante avanzado. sistemas o
afines.
Capacidad para analizar con rigurosidad la utilización de recursos de - Experiencia con Java, Ruby o Python.
un programa / proceso java o ruby , identificando causa raíz y - Experiencia en Linux.
oportunidades de mejoras, tanto a nivel de dimensionamiento de - Tener pensamiento analitico y capacidad aprendizaje.
recursos como así tambièn a nivel del código. - Ser proactivo y tener actitud para solucionar problemas de
distinta índole.
Experiencia en el uso y configuración de herramientas de monitoreo:
newrelic, nagios, opsview.

Configurar aplicaciones de backend / backoffice según requerimientos


de clientes.
D e v p s
DevOps Engineer Skills?
DevOps is a set of practices
intended to reduce the time between
committing a change to a system and
the change being placed into normal
production while ensuring high
quality.
Len Bass, SEI-CMU

https://www.amazon.com/DevOps-Software-Architects-Perspective-Engineering/dp/0134049845
DevOps by SEI-CMU

> Operations as first-class citizen

> Make dev responsible for prod incidents

> Formal deployment process

> Continuous Delivery

> Infrastructure as code

https://www.amazon.com/DevOps-Software-Architects-Perspective-Engineering/dp/0134049845
Continuous Delivery Optimez Value Stream

Automated deployments Self-Organization

Automated acceptance Specificación by


tests Example

Automated unit tests Early Operations

Smoke tests On-site customer

Formal test cases time-boxing

Continuous Integration Backlog management

Versioning
Retrospectives
Glossary
Infrastructure models
On Premises IaaS PaaS SaaS

Application Application Application Application

Data Data Data Data

Runtime Runtime Runtime Runtime

Middleware Middleware Middleware Middleware

OS OS OS OS

Virtualization Virtualization Virtualization Virtualization

Networking Networking Networking Networking

Servers Servers Servers Servers


Virtualization
Hypervisors*:
OS OS OS OS OS OS
Hypervisor
Hypervisor OS
Hardware Hardware
Type 1 Type 2
(native, bare-metal) (hosted)

*VMMs: Virtual Machine Monitors


Virtualization
Hypervisors Type 1:
=> Oracle VM server
=> Microsoft Hyper-V
=> VMWare ESX

Hypervisors Type 2:
=> VirtualBox
=> VMWare Workstation
Infrastructure as Code
Mutable vs. Inmutable
Mutable infrastructure tools
Mutable Infrastructure
You package your app and make it run on different infrastructure

app-v1 app-v1 app-v1

Win10 Win2012 win2012

Test Prod
Mutable Infrastructure
You package your app and make it run on different infrastructure

app-v2
app-v1 app-v2
app-v1 app-v2
app-v1

Win10 Win2012 win2012

Test Prod
Immutable Infrastructure
You package your app with its infrastructure

App-v1 App-v1 App-v1


+ + +
Win2016 Win2016 Win2016

Test Prod
Immutable Infrastructure
You package your app with its infrastructure

App-v1 App-v1 App-v1


+ + +
Win2016 Win2016 Win2016

App-v2 App-v2 App-v1


+ + +
Win2016 Win2016 Win2016

Test Prod
Vagrant is tool for creation and configuration of virtualized environments. (more)
Vagrant exercise

> vagrant box add devopsv5 devopsv5.box


> vagrant box list
> vagrant up

Navegar http://localhost:8080

> vagrant ssh


> cd /vagrant
> echo "prueba" > file.xt
> exit
Vagrant exercise

8080 80

Guest: ubuntu

Host: Mac OS + vagrant + Virtual Box


Vagrantfile
Vagrant.configure(2) do |config|

config.vm.box = "devopsv5"

config.vm.network "forwarded_port", guest: 80, host: 8080


config.vm.network "forwarded_port", guest: 8080, host: 8090
config.vm.network "forwarded_port", guest: 4567, host: 4567

config.vm.provider "virtualbox" do |vb|


vb.memory = "2048"
end

config.vm.provision "shell", inline: <<-SHELL


echo "I am provisioning..."
date > /etc/vagrant_provisioned_at
SHELL

end
Terraform data center infrastructure, as code. (more)
Second generation SCM tools
Ansible Exercise

> sudo ansible-galaxy install -c colstrom.java

> sudo ansible-playbook -i "localhost," -c local


playbook.yml -vvvv

> open in host http://localhost:8080


Automation Layers

Layer 3: Apps
(binaries, configuration, data)

Layer 2: base software


(db engine, web server, app
server)

Layer 1: OS & Networking

http://blog.nicopaez.com/2015/09/05/capas-de-automatizacion/
Automation layers

Layer 3: Apps Orchestrator


(jenkins +
(binaries, configuration, data) scripts)

Layer 2: base software


CM Tools (chef,
(db engine, web server, app ansible, puppet)
server)

Cloud dependant
Layer 1: OS & Networking / Terraform
Case 1

Jenkins +
WebApi, DB, WinService MsDeploy

IIS, Solr, MySql Chef

Windows Server 2012 R2 AWS Cloud


@ Amazon EC2 Formation
Case study 2

Jenkins +
WebApp, DB Bash script

Nginx, Ruby, PostgreSQL Ansible

CentOS Server Terraform


@ OpenStack
Show time!
DevOps topologies
DevOps Topologies

> Matthew Skelton

> http://web.devopstopologies.com/
Topologies Patterns

=> Anti-patterns

=> Patterns

=> Transitional

=> Permanent
Topologies Anti-patterns
Dev and Ops Silos DevOps as Tools team

DevOps Silo Rebranded Ops

Dev DevOps Ops


InMutable infrastructure tools
Docker is a lightweight “virtualization” technology.
Virtual Machines vs. Containers

Virtual Machine
Container

Hypervisor Docker Engine

SO host SO host

Hardware Hardware
Virtual Machines vs. Containers
Docker exercise (1)

> docker ps
> docker images
> docker run -p 8080:8080 jenkins

Navegar http://localhost:8090
sudo apt-get install
docker-ce=18.06.1~ce~3-0~ubuntu
Docker exercise (2)

> docker build -t pingapp .


> docker run -p 4567:4567 -d pingapp

Navegar http://localhost:4567
Dockerfile
FROM ruby:2.2.0

RUN mkdir -p /var/www


WORKDIR /var/www
RUN git clone https://…/nicopaez/pingapp.git /var/www/pingapp

WORKDIR /var/www/pingapp

RUN git checkout master

RUN bundle install --system --without test development

EXPOSE 4567

CMD ["ruby", "app.rb", "-o", "0.0.0.0"]


Docker architecture
Docker compose

db:
image: postgres
volumes:
- ./pgdata:/var/lib/postgresql/data
web:
image: alfredimage
environment:
- DATABASE_URL=postgres://postgres:mysecret@db:5432/alfred
ports:
- "3000:3000"
links:
- db
Ejercicio Docker

4567 4567 4567

8090 8080 8080


docker

8080 80

ubuntu

host: Mac OS + vagrant + Virtual Box


Docker family

Docker (engine)

Docker Compose

Docker Swarm
Kubernetes containers management tool
OpenShift is a container application platform that brings docker and Kubernetes to the enterprise.
Kubernetes vs Openshift
Ejercicio OpenShift

Copy Login Command


oc login https://api.starter-us-west-1.openshift.com --token=xxxxxx
kubectl run pingapp --image=nicopaez/pingapp:2.1.1

kubectl expose deployment pingapp --port=80 --target-port=4567


--type=LoadBalancer

kubectl create configmap config-pingapp --from-file=config.json

kubectl set env deployment/pingapp CONFIG_LOCATION=/config/config.json

kubectl get deployment/pingapp -o yaml


Openshift exercise
git clone https://github.com/nicopaez/pingapp.git

oc new-project devops-tutorial --display-name="DevOps Tutorial"

oc new-app nicopaez/pingapp

oc expose svc/pingapp

oc set env dc/pingapp CONFIG_LOCATION=/config/config.json

oc set env dc/pingapp SECRETS_LOCATION=/secrets/secrets.json

oc create configmap config-pingapp --from-file=config.json

oc create secret generic secrets-pingapp --from-file=secrets.json

oc volume dc/pingapp --add --name=config -t configmap --configmap-name=config-pingapp -m /config

oc volume dc/pingapp --add --name=secrets -t secret --secret-name=secrets-pingapp -m /secrets


Openshift exercise 2

Browse you Openshift Console

Create a new-app following the wizards

Set https://github.com/nicopaez/pingapp.git as source repo

Set puma as source branch and Go!


Versionado
Código
+
Configuración
+
Scripts
http://blog.nicopaez.com/2015/09/20/practicas-devops-3-repos-por-proyecto/
Source Code Versioning
Binary Versioning
Monitoring & Logging
Niveles de monitoreo

Manual, User-initiated, no-monitoring

Reactive

Proactive
Monitoring Strategy

Pull vs Push
Monitoring
Logging
Deployment Pipeline
CI / CD Servers
SO Packages + Puppet
1 2

Jenkins
3

https://blog.nicopaez.com/2016/04/06/estrategias-de-provisioning-deployment-parte-1/
Deployment Process Overview
[1] get the code > [2] create package and push to S3 > [3] trigger deployment > [4] Push to target servers

S3 Storage
source code

4
1

Jenkins 3

scripts
EC2 Servers
Code Deploy
Service
https://blog.nicopaez.com/2016/04/18/estrategias-de-provisioning-deployment-parte-2/
One Ruby Case

Jenkins

Staging Production

Development
Superuser Case
conf

code

Staging Producción

scritps

http://superuser.openstack.org/
One Java Case
conf

Jenkins Jenkins

code
test demo

scripts
Resources
● What is a DevOps Engineer
https://puppet.com/blog/what-a-devops-engineer

● Kubernetes tutorial:
https://kubernetes.io/docs/tutorials/kubernetes-basics/

● Red Hat Container Development Kit


https://developers.redhat.com/products/cdk/overview/

● Ansible tutorial
https://www.katacoda.com/jonatanblue/scenarios/1
Thanks!
(feedback & photo please)

x/5

Ing. Nicolás Paez


t: @inicopaez
w: nicopaez.com.ar
m: nicopaez@computer.org
The End
A bit about me

También podría gustarte