organizando un datacenter virtual
Post on 20-Jul-2015
132 Views
Preview:
TRANSCRIPT
www.vividcortex.com | info@vividcortex.com
Temas típicos• Colocations remotas
• Costo de transporte
• Administración remota
• ¿Este cable… ?
• Servidores legacy
• Exposición a fallas de hardware
www.vividcortex.com | info@vividcortex.com
Administración remota•Cambios de hardware como tickets
•Fallas en hardware como ticket
•Topología •Topología plana
•Firewall y enrutado en los servidores
www.vividcortex.com | info@vividcortex.com
Algunas contras
•Hardware virtual
•Performance
•Los recursos performantes pueden ser caros
Un datacenter virtual Algunas ventajas
•Exposición a fallas físicas reducida
•Versatilidad en "hardware"
•Topología muy versátil
•Clonación (AMIs)
www.vividcortex.com | info@vividcortex.com
AWS EC2Instancias clonadas desde una imagen base
www.vividcortex.com | info@vividcortex.com
AWS EC2
www.vividcortex.com | info@vividcortex.com
AWS VPC•Como un rack en un datacenter
•Sin VPC, las instancias individuales están expuestas a las internes (IP elástica)
•NAT
•Subredes, aislamiento
www.vividcortex.com | info@vividcortex.com
AWS VPC
www.vividcortex.com | info@vividcortex.com
AWS VPC
www.vividcortex.com | info@vividcortex.com
VPN•Tradicionalmente se implementa como hardware
•Algunas contras
•OpenVPN: VPN por software •SSL
•Userland, usando tunnel devices
•VPN means Very Poor Network •FUD
www.vividcortex.com | info@vividcortex.com
VPN•Tradicionalmente se implementa como hardware
•Algunas contras
•OpenVPN: VPN por software •SSL
•Userland, usando tunnel devices
•VPN: Very Poor Network •FUD
www.vividcortex.com | info@vividcortex.com
OpenVPNLos paquetes son cifrados y encapsulados
www.vividcortex.com | info@vividcortex.com
OpenVPNLos paquetes son cifrados y encapsulados
www.vividcortex.com | info@vividcortex.com
OpenVPN
www.vividcortex.com | info@vividcortex.com
VPC <> VPN• El servidor OpenVPN vive en la VPC
• Los clientes se conectan a la VPC a través de VPN
• En el caso mas simple, los clientes VPN se conectan directamente a todos los servidores en la VPC
• Opcionalmente, elementos en la VPC pueden hablarle a [algunos] clientes
• Enrutado hacia adentro
• Manejado por OpenVPN
• Enrutado hacia afuera
•El servidor OpenVPN puede hacer NAT hacia los clientes
•Routing tables -> servidor OpenVPN -> -j MASQUERADE
www.vividcortex.com | info@vividcortex.com
VPC <> VPN
www.vividcortex.com | info@vividcortex.com
VPC <> VPN!# Push routes to the client to allow it!# to reach other private subnets behind!# the server. Remember that these!# private subnets will also need!# to know to route the OpenVPN client!# address pool (10.20.0.0/255.255.255.0)!# back to the OpenVPN server.!;push "route 10.10.1.0 255.255.255.0"!;push "route 10.10.10.0 255.255.255.0"!push "route 10.10.0.0 255.255.0.0"!push "route 10.30.0.0 255.255.0.0"!!# To assign specific IP addresses to specific!# clients or if a connecting client has a private!# subnet behind it that should also have VPN access,!# use the subdirectory "ccd" for client-specific!# configuration files (see man page for more info).!!
www.vividcortex.com | info@vividcortex.com
AWS VPC: Subredes•Subredes públicas o privadas
•Sistema de enrutado •Ligeramente diferente
• Públicas: instancias conectadas directamente, como en EC2
• Privadas: se necesita NAT
•Routing tables
•DNS •dnsmasq
www.vividcortex.com | info@vividcortex.com
AWS VPC: Subredes
www.vividcortex.com | info@vividcortex.com
AWS VPC: Subredes
www.vividcortex.com | info@vividcortex.com
Instancias en una subred
www.vividcortex.com | info@vividcortex.com
Routing tables
www.vividcortex.com | info@vividcortex.com
Orquestado: Ansible• Puppet: declarativo
• Chef: imperativo
• Ansible: imperativo
• Independiente del lenguaje de implementación
• declaraciones .yml declarations, comunicación por ssh(1)
• Algunas contras:
• Muy ad-hoc
• Pocos elementos para programar
• Pero estas podrían considerarse ventajas a su vez
www.vividcortex.com | info@vividcortex.com
Orquestado: Ansible---!- name: Install dnsmasq! yum: name=dnsmasq state=present!!- name: Set dnsmasq configuration file! copy: src={{ item }} dest=/etc/dnsmasq.d/ owner=root group=root mode=0644! with_items:! - dns-server.conf! notify:! - reload dnsmasq!!- name: Set hosts file! tags: light! template: src={{ item }}.j2 dest=/etc/dnsmasq.d/{{ item }}! owner=root group=root mode=0644! with_items:! - hosts! notify:! - reload dnsmasq!
www.vividcortex.com | info@vividcortex.com
Orquestado: Ansible---!- name: Install dnsmasq! yum: name=dnsmasq state=present!!- name: Set dnsmasq configuration file! copy: src={{ item }} dest=/etc/dnsmasq.d/ owner=root group=root mode=0644! with_items:! - dns-server.conf! notify:! - reload dnsmasq!!- name: Set hosts file! tags: light! template: src={{ item }}.j2 dest=/etc/dnsmasq.d/{{ item }}! owner=root group=root mode=0644! with_items:! - hosts! notify:! - reload dnsmasq!
www.vividcortex.com | info@vividcortex.com
Orquestado: Ansible---!- name: Install dnsmasq! yum: name=dnsmasq state=present!!- name: Set dnsmasq configuration file! copy: src={{ item }} dest=/etc/dnsmasq.d/ owner=root group=root mode=0644! with_items:! - dns-server.conf! notify:! - reload dnsmasq!!- name: Set hosts file! tags: light! template: src={{ item }}.j2 dest=/etc/dnsmasq.d/{{ item }}! owner=root group=root mode=0644! with_items:! - hosts! notify:! - reload dnsmasq!
www.vividcortex.com | info@vividcortex.com
Orquestado: Ansible with_items:! - hosts! notify:! - reload dnsmasq!!- name: Enable dnsmasq configuration file! lineinfile: dest=/etc/dnsmasq.conf regexp='^conf-file='! line=conf-file=/etc/dnsmasq.d/dns-server.conf! insertafter='^#conf-file='! notify:! - reload dnsmasq!!- name: Start dnsmasq service! service: name=dnsmasq state=started enabled=yes!
www.vividcortex.com | info@vividcortex.com
Orquestado: Ansible with_items:! - hosts! notify:! - reload dnsmasq!!- name: Enable dnsmasq configuration file! lineinfile: dest=/etc/dnsmasq.conf regexp='^conf-file='! line=conf-file=/etc/dnsmasq.d/dns-server.conf! insertafter='^#conf-file='! notify:! - reload dnsmasq!!- name: Start dnsmasq service! service: name=dnsmasq state=started enabled=yes!
www.vividcortex.com | info@vividcortex.com
Orquestado: AnsibleNow deploying too!
www.vividcortex.com | info@vividcortex.com
Ansible y AWS•Ansible puede obtener su lista de hosts desde
AWS: ec2.py
•Podés escribir tu propio ec2.{py,sh,*}
•Soporte básico de operaciones de instancia
www.vividcortex.com | info@vividcortex.com
Pensá diferente•Máquinas para tirar
•Los servidores deberían poder ser reemplazados de inmediato
•Reemplazar seguido significa un script depurado
•Hacé scripts idempotentes
•Pensá diferente[mente] •Servidores estáticos
•Servidores de aplicación: Estático + deploy
•Servidores de datos: Estático + restaurar respaldo
www.vividcortex.com | info@vividcortex.com
¡Gracias!•Mas de esto?
•nacho at vividcortex com / twitter @nachexnachex
•Futuros webinarios/blogposts
•Mas de VividCortex: info@vividcortex.com
top related