SlideShare a Scribd company logo
1 of 57
Infrastructure as Code
Aybüke Özdemir
@aybuke_ozdemir
Halil Kaya
@halilkaya
Kısa bir örnekle kod tabanlı altyapının önemi
Yeni bir projeye başlıyoruz
Biz Ruby on Rails’ı seçtik
> gem install rails
> gem install rails
Fetching: i18n-0.7.0.gem (100%)
Fetching: json-1.8.3.gem (100%)
Building native extensions. This could take a while…
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
creating Makefile
make
sh: 1: make: not found
Tabii ki önce make’i kurmamız gerek!
> sudo apt-get install make
...
Success!
> gem install rails
> gem install rails
Fetching: nokogiri-1.6.7.2.gem (100%)
Building native extensions. This could take a while…
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.0.0.rc2
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Hmm. Stackoverflow’a baksak iyi olacak sanki...
> sudo apt-get install zlib1g-dev
...
Success!
> gem install rails
> gem install rails
Building native extensions. This could take a while…
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.0.0.rc2
checking for gzdopen() in -lz... yes
checking for iconv... yes
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-pc-linux-
gnu/ports/libxml2/2.9.2... OK
*** extconf.rb failed ***
Stackoverflow’da 2 saat geçirdikten sonra...
> gem install rails
> gem install rails
...
Success!
> rails new my-project
> cd my-project
> rails start
> rails new my-project
> cd my-project
> rails start
/source/my-project/bin/spring:11:in `<top (required)>`:
undefined method `path_separator` for Gem:Module
(NoMethodError)
from bin/rails:3:in `load`
from bin/rails:3:in `<main>`
… uzunca bir süre sonra
bir şekilde proje çalışır!
Production
> bundle update rails
> bundle update rails
Building native extensions. This could take a while…
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.0.0.rc2
checking for gzdopen() in -lz... yes
checking for iconv... yes
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-pc-linux-
gnu/ports/libxml2/2.9.2... OK
*** extconf.rb failed ***
Aslında problem Rails ya da Django değil.
Problem sunucuyu elle yapılandırmakta!
Configuration
Management
IAC
Provisioning
Configuration
Management
nginx
conf
- tek tek elle?
- tek tek elle?
- script?
- tek tek elle?
- script?
- scp veya rsync?
- tek tek elle?
- script?
- scp veya rsync?
- tmux cluster ssh?
- tek tek elle?
- script?
- scp veya rsync?
- tmux cluster ssh?
- hosts: production
remote_user: deployment
become: true
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Copy nginx conf file
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
- name: Reload nginx
service:
name: nginx
state: reloaded
- hosts: production
remote_user: deployment
become: true
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Copy nginx conf file
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
- name: Reload nginx
service:
name: nginx
state: reloaded
“production” başlığı altındaki makinalar
- hosts: production
remote_user: deployment
become: true
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Copy nginx conf file
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
- name: Reload nginx
service:
name: nginx
state: reloaded
“deployment” kullanıcısı ile
- hosts: production
remote_user: deployment
become: true
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Copy nginx conf file
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
- name: Reload nginx
service:
name: nginx
state: reloaded
sudo yetkisi ile
- hosts: production
remote_user: deployment
become: true
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Copy nginx conf file
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
- name: Reload nginx
service:
name: nginx
state: reloaded
“nginx” paketini kur
- hosts: production
remote_user: deployment
become: true
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Copy nginx conf file
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
- name: Reload nginx
service:
name: nginx
state: reloaded
önceden hazırlanmış nginx
yapılandırma dosyasını ilgili
yere kopyala
- hosts: production
remote_user: deployment
become: true
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Copy nginx conf file
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
- name: Reload nginx
service:
name: nginx
state: reloaded
nginx servisini reload et
Provisioning
cloud
LoadBalancer
Instance Group
Network
Firewall
Disks & Images
resource “google_compute_instance” “prod-1” {
name = “prod-1”
machine_type = “n1-standard-1”
zone = “europe-west1-d”
boot_disk {
initialize_params {
image = “debian-cloud/debian-8”
}
}
}
resource “google_compute_instance_group” “prod” {
name = “prod”
zone = “europe-west1-d”
instances = [
“${google_compute_instance.prod-1.self_link}”,
]
}
resource “google_compute_instance” “prod-1” {
name = “prod-1”
machine_type = “n1-standard-1”
zone = “europe-west1-d”
boot_disk {
initialize_params {
image = “debian-cloud/debian-8”
}
}
}
resource “google_compute_instance_group” “prod” {
name = “prod”
zone = “europe-west1-d”
instances = [
“${google_compute_instance.prod-1.self_link}”,
]
}
- resource tipi
- resource ismi
- GCE’deki instance ismi
resource “google_compute_instance” “prod-1” {
name = “prod-1”
machine_type = “n1-standard-1” GCE’deki makine tipi
zone = “europe-west1-d”
boot_disk {
initialize_params {
image = “debian-cloud/debian-8”
}
}
}
resource “google_compute_instance_group” “prod” {
name = “prod”
zone = “europe-west1-d”
instances = [
“${google_compute_instance.prod-1.self_link}”,
]
}
resource “google_compute_instance” “prod-1” {
name = “prod-1”
machine_type = “n1-standard-1”
zone = “europe-west1-d” makinenin açılacağı datacenter bölgesi
boot_disk {
initialize_params {
image = “debian-cloud/debian-8”
}
}
}
resource “google_compute_instance_group” “prod” {
name = “prod”
zone = “europe-west1-d”
instances = [
“${google_compute_instance.prod-1.self_link}”,
]
}
resource “google_compute_instance” “prod-1” {
name = “prod-1”
machine_type = “n1-standard-1”
zone = “europe-west1-d”
boot_disk {
initialize_params {
image = “debian-cloud/debian-8” debian 8 imajıyla boot diski oluştur
}
}
}
resource “google_compute_instance_group” “prod” {
name = “prod”
zone = “europe-west1-d”
instances = [
“${google_compute_instance.prod-1.self_link}”,
]
}
resource “google_compute_instance” “prod-1” {
name = “prod-1”
machine_type = “n1-standard-1”
zone = “europe-west1-d”
boot_disk {
initialize_params {
image = “debian-cloud/debian-8”
}
}
}
resource “google_compute_instance_group” “prod” {
name = “prod”
zone = “europe-west1-d”
instances = [ oluşturduğun makineyi
“${google_compute_instance.prod-1.self_link}”, bu instance group’a
] koy
}
> terraform plan
> terraform apply
Faydalar
- tekrar kullanılabilirlik
- otomasyon
- version control
- gözden geçirme
- döküman
- başka bir cloud sistemine geçiş kolaylığı
Olası Sorunlar
- state dosyası!
- araç kullanırken elle yapılandırma!
- hala tam anlamıyla olgunlaşmış değil!
- uygulama yöntemindeki muhtemel sosyal sorunlar!
- var olan bir projeyi IAC’a taşıma(!)
Chef Puppet Ansible SaltStack CloudFormation Terraform
Code Open Source Open Source Open Source Open
Source
Closed Source Open Source
Cloud All All All All AWS Only All
Type Config Mngt Config Mngt Config Mngt Config Mngt Provisioning Provisioning
Infrastructure Mutable Mutable Mutable Mutable Immutable Immutable
Language Procedural Declarative Procedural Declarative Declarative Declarative
Architecture Client/Server Client/Server Client-Only Client/Server Client-Only Client-Only
Kaynaklar
- Infrastructure as code: running microservices on
AWS using Docker, Terraform and ECS
- Why we use Terraform and not Chef, Puppet,
Ansible, SaltStack, or CloudFormation
- https://www.ybrikman.com/writing/2016/03/31/i
nfrastructure-as-code-microservices-aws-docker-
terraform-ecs/

More Related Content

What's hot

Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點William Yeh
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Masahiro Nagano
 
mruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしmruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしHiroshi SHIBATA
 
Composer, putting dependencies on the score
Composer, putting dependencies on the scoreComposer, putting dependencies on the score
Composer, putting dependencies on the scoreRafael Dohms
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Soshi Nemoto
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby CoreHiroshi SHIBATA
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Chu-Siang Lai
 
Securing Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultSecuring Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultBram Vogelaar
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)Soshi Nemoto
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Puppet
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environmentsApptension
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with ExamplesGabriele Lana
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStackBram Vogelaar
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 

What's hot (20)

Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015
 
mruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしmruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなし
 
Composer, putting dependencies on the score
Composer, putting dependencies on the scoreComposer, putting dependencies on the score
Composer, putting dependencies on the score
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby Core
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
 
Securing Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultSecuring Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp Vault
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environments
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Statyczna analiza kodu PHP
Statyczna analiza kodu PHPStatyczna analiza kodu PHP
Statyczna analiza kodu PHP
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStack
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 

Similar to Infrastructure as code - Python Saati #36

Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformniyof97
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725miguel dominguez
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725MortazaJohari
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Yevgeniy Brikman
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardwayDave Pitts
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and LingvokotLingvokot
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016Susan Potter
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptDocker, Inc.
 
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012rivierarb
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作Philip Zheng
 

Similar to Infrastructure as code - Python Saati #36 (20)

Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
RunX ELCE 2020
RunX ELCE 2020RunX ELCE 2020
RunX ELCE 2020
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
 
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 

Recently uploaded

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 

Recently uploaded (20)

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

Infrastructure as code - Python Saati #36

  • 1. Infrastructure as Code Aybüke Özdemir @aybuke_ozdemir Halil Kaya @halilkaya
  • 2. Kısa bir örnekle kod tabanlı altyapının önemi
  • 3. Yeni bir projeye başlıyoruz
  • 4. Biz Ruby on Rails’ı seçtik
  • 6. > gem install rails Fetching: i18n-0.7.0.gem (100%) Fetching: json-1.8.3.gem (100%) Building native extensions. This could take a while… ERROR: Error installing rails: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb creating Makefile make sh: 1: make: not found
  • 7. Tabii ki önce make’i kurmamız gerek!
  • 8. > sudo apt-get install make ... Success!
  • 10. > gem install rails Fetching: nokogiri-1.6.7.2.gem (100%) Building native extensions. This could take a while… ERROR: Error installing rails: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb checking if the C compiler accepts ... yes Building nokogiri using packaged libraries. Using mini_portile version 2.0.0.rc2 checking for gzdopen() in -lz... no zlib is missing; necessary for building libxml2 *** extconf.rb failed ***
  • 11. Hmm. Stackoverflow’a baksak iyi olacak sanki...
  • 12. > sudo apt-get install zlib1g-dev ... Success!
  • 13. > gem install rails
  • 14. > gem install rails Building native extensions. This could take a while… ERROR: Error installing rails: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb checking if the C compiler accepts ... yes Building nokogiri using packaged libraries. Using mini_portile version 2.0.0.rc2 checking for gzdopen() in -lz... yes checking for iconv... yes Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-pc-linux- gnu/ports/libxml2/2.9.2... OK *** extconf.rb failed ***
  • 15.
  • 16. Stackoverflow’da 2 saat geçirdikten sonra...
  • 17. > gem install rails
  • 18. > gem install rails ... Success!
  • 19. > rails new my-project > cd my-project > rails start
  • 20. > rails new my-project > cd my-project > rails start /source/my-project/bin/spring:11:in `<top (required)>`: undefined method `path_separator` for Gem:Module (NoMethodError) from bin/rails:3:in `load` from bin/rails:3:in `<main>`
  • 21.
  • 22. … uzunca bir süre sonra bir şekilde proje çalışır!
  • 24.
  • 26. > bundle update rails Building native extensions. This could take a while… ERROR: Error installing rails: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb checking if the C compiler accepts ... yes Building nokogiri using packaged libraries. Using mini_portile version 2.0.0.rc2 checking for gzdopen() in -lz... yes checking for iconv... yes Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-pc-linux- gnu/ports/libxml2/2.9.2... OK *** extconf.rb failed ***
  • 27.
  • 28. Aslında problem Rails ya da Django değil. Problem sunucuyu elle yapılandırmakta!
  • 32. - tek tek elle?
  • 33. - tek tek elle? - script?
  • 34. - tek tek elle? - script? - scp veya rsync?
  • 35. - tek tek elle? - script? - scp veya rsync? - tmux cluster ssh?
  • 36. - tek tek elle? - script? - scp veya rsync? - tmux cluster ssh?
  • 37. - hosts: production remote_user: deployment become: true tasks: - name: Install nginx apt: name: nginx state: present - name: Copy nginx conf file template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: Reload nginx service: name: nginx state: reloaded
  • 38. - hosts: production remote_user: deployment become: true tasks: - name: Install nginx apt: name: nginx state: present - name: Copy nginx conf file template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: Reload nginx service: name: nginx state: reloaded “production” başlığı altındaki makinalar
  • 39. - hosts: production remote_user: deployment become: true tasks: - name: Install nginx apt: name: nginx state: present - name: Copy nginx conf file template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: Reload nginx service: name: nginx state: reloaded “deployment” kullanıcısı ile
  • 40. - hosts: production remote_user: deployment become: true tasks: - name: Install nginx apt: name: nginx state: present - name: Copy nginx conf file template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: Reload nginx service: name: nginx state: reloaded sudo yetkisi ile
  • 41. - hosts: production remote_user: deployment become: true tasks: - name: Install nginx apt: name: nginx state: present - name: Copy nginx conf file template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: Reload nginx service: name: nginx state: reloaded “nginx” paketini kur
  • 42. - hosts: production remote_user: deployment become: true tasks: - name: Install nginx apt: name: nginx state: present - name: Copy nginx conf file template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: Reload nginx service: name: nginx state: reloaded önceden hazırlanmış nginx yapılandırma dosyasını ilgili yere kopyala
  • 43. - hosts: production remote_user: deployment become: true tasks: - name: Install nginx apt: name: nginx state: present - name: Copy nginx conf file template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: Reload nginx service: name: nginx state: reloaded nginx servisini reload et
  • 46. resource “google_compute_instance” “prod-1” { name = “prod-1” machine_type = “n1-standard-1” zone = “europe-west1-d” boot_disk { initialize_params { image = “debian-cloud/debian-8” } } } resource “google_compute_instance_group” “prod” { name = “prod” zone = “europe-west1-d” instances = [ “${google_compute_instance.prod-1.self_link}”, ] }
  • 47. resource “google_compute_instance” “prod-1” { name = “prod-1” machine_type = “n1-standard-1” zone = “europe-west1-d” boot_disk { initialize_params { image = “debian-cloud/debian-8” } } } resource “google_compute_instance_group” “prod” { name = “prod” zone = “europe-west1-d” instances = [ “${google_compute_instance.prod-1.self_link}”, ] } - resource tipi - resource ismi - GCE’deki instance ismi
  • 48. resource “google_compute_instance” “prod-1” { name = “prod-1” machine_type = “n1-standard-1” GCE’deki makine tipi zone = “europe-west1-d” boot_disk { initialize_params { image = “debian-cloud/debian-8” } } } resource “google_compute_instance_group” “prod” { name = “prod” zone = “europe-west1-d” instances = [ “${google_compute_instance.prod-1.self_link}”, ] }
  • 49. resource “google_compute_instance” “prod-1” { name = “prod-1” machine_type = “n1-standard-1” zone = “europe-west1-d” makinenin açılacağı datacenter bölgesi boot_disk { initialize_params { image = “debian-cloud/debian-8” } } } resource “google_compute_instance_group” “prod” { name = “prod” zone = “europe-west1-d” instances = [ “${google_compute_instance.prod-1.self_link}”, ] }
  • 50. resource “google_compute_instance” “prod-1” { name = “prod-1” machine_type = “n1-standard-1” zone = “europe-west1-d” boot_disk { initialize_params { image = “debian-cloud/debian-8” debian 8 imajıyla boot diski oluştur } } } resource “google_compute_instance_group” “prod” { name = “prod” zone = “europe-west1-d” instances = [ “${google_compute_instance.prod-1.self_link}”, ] }
  • 51. resource “google_compute_instance” “prod-1” { name = “prod-1” machine_type = “n1-standard-1” zone = “europe-west1-d” boot_disk { initialize_params { image = “debian-cloud/debian-8” } } } resource “google_compute_instance_group” “prod” { name = “prod” zone = “europe-west1-d” instances = [ oluşturduğun makineyi “${google_compute_instance.prod-1.self_link}”, bu instance group’a ] koy }
  • 52. > terraform plan > terraform apply
  • 53. Faydalar - tekrar kullanılabilirlik - otomasyon - version control - gözden geçirme - döküman - başka bir cloud sistemine geçiş kolaylığı
  • 54. Olası Sorunlar - state dosyası! - araç kullanırken elle yapılandırma! - hala tam anlamıyla olgunlaşmış değil! - uygulama yöntemindeki muhtemel sosyal sorunlar! - var olan bir projeyi IAC’a taşıma(!)
  • 55. Chef Puppet Ansible SaltStack CloudFormation Terraform Code Open Source Open Source Open Source Open Source Closed Source Open Source Cloud All All All All AWS Only All Type Config Mngt Config Mngt Config Mngt Config Mngt Provisioning Provisioning Infrastructure Mutable Mutable Mutable Mutable Immutable Immutable Language Procedural Declarative Procedural Declarative Declarative Declarative Architecture Client/Server Client/Server Client-Only Client/Server Client-Only Client-Only
  • 56.
  • 57. Kaynaklar - Infrastructure as code: running microservices on AWS using Docker, Terraform and ECS - Why we use Terraform and not Chef, Puppet, Ansible, SaltStack, or CloudFormation - https://www.ybrikman.com/writing/2016/03/31/i nfrastructure-as-code-microservices-aws-docker- terraform-ecs/