Anúncio
Anúncio

Mais conteúdo relacionado

Apresentações para você(20)

Similar a DevOpsDays Taipei 2017 - Terraform: Everything Is Code(20)

Anúncio
Anúncio

DevOpsDays Taipei 2017 - Terraform: Everything Is Code

  1. Terraform Everything is Code
  2. HELLO! I am smalltown (Tom Tsai) I am here because I want to share something with you You can find me at smalltown@awsug.tw 2
  3. 3 Demo Code: https://goo.gl/ubspPP
  4. Why Coding?! 4
  5. Handmade? 5
  6. 6
  7. 7
  8. 8 就 警 是 察 這 叔 個 叔 人 !
  9. Benefits!! ▪ Reproducible ▪ Save Your Valuable Time ▪ Avoid Human Error ▪ Not Out of Date Like Document 9
  10. 11 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  11. 12 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  12. Infrastructure As Code in 200X... 13 YA! I can write code to manage server package 'tar' do version '1.16.1' action :install end
  13. Infrastructure As Code in 200X... ▪ Provision Procedure CM Tool 14 Document: - Easy Out of Date - Hard to Maintain
  14. Infrastructure As Code in 201X... 15 YA! I can write code to manage cloud resource resource "aws_s3_bucket" "b" { bucket = "my_tf_test_bucket" acl = "private" tags { Name = "My bucket" } }
  15. Infrastructure As Code in 201X... ▪ Cloud Resource Infrastructure As Code Tool 16 Document: - Easy Out of Date - Hard to Maintain Google Cloud Deployment Manager Azure Resource Manager AWS CloudFormation
  16. Infrastructure As Code in 202X... 17 YA! I can write code to manage cloud provider resource "cloud_provider" "poc" { type = "AWS" region = "American" feature = ["LB", "K8S"] }
  17. Infrastructure As Code in 202X... ▪ Cloud Provider Cloud Provider As Code tool 18 Document: - Easy Out of Date - Hard to Maintain
  18. 19 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  19. My Tool Choose Guideline 20 用 HashiCorp 出的就對了!!
  20. My Tool Choose Guideline 21 自從用了 HashiCorp 之後長高了 ,變壯了,考試都得一百分呢! 呿... 不就只是長大了而已,我也會啊!
  21. My Tool Choose Guideline ▪ ▪ ▪ ▪ ▫ ▫ ▫ 22
  22. Why Terrafrom? 23 Meet Requirement Yes Yes Yes Yes Documentation Yes Yes Yes Yes CLI Tool Yes Yes Yes Yes Configuration Win Yes Yes Yes Modularization Win Yes Yes Yes Native No Yes Yes Yes Cross Platform Yes No No No Feeling Good Bad - -
  23. 24 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  24. Whole Picture 25 Makefile Initial Backend Get Modules Plan Resources Apply Resources Test Resources 1. Init backend if not exist 2. Get modules from source 3. Plan desired state with previous one 4. Apply resource, save state to backend 5. Test resources
  25. Folder Structure 26
  26. COnfigurations 27 terrform.tfvars variables.tf s3.tf bucket = "devopsdays_taipei" acl = "public-read" variable "bucket" {} variable "acl" {} resource "aws_s3_bucket" "app_s3" { bucket = "${var.bucket}" acl = "${var.acl}" } Generated Dynamic
  27. Backends ▪ ▫ ▫ ▫ ▪ “Here” 28
  28. Modules ▪ Don’t Reinventing The Wheel ! ▪ Modules Are Used to Create Reusable Components In Terraform ▪ Sources: Refer To “Here” 29
  29. Testing ▪ ▪ ! ▪ 30
  30. Makefile ▪ ▪ ▪ ▫ ▫ 31
  31. Of Course, Version COntrol ▪ ▪ 32
  32. 33 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  33. Last Mile ▪ ▪ ▪ ▪ ▪ 34
  34. Yes, Integrate CI/CD Framework 35 Buildbot Drone Concourse Ref
  35. 36 Infrastructure = Code Why Terraform Best My Practice Integrate CI/CD Case Study
  36. How To Rolling Update AWS ASG 37 Ref
  37. How TO MainTain K8S Cluster 38 Ref
  38. Exception: serverLess 39 Ref 請洽 AWS TW UG Cliff Lu (呂昭寬)
  39. THANKS! Any questions? 40
Anúncio