Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

OpenStack上の環境構築自動化に向けたTerraform/Pulumiの活用

883 views

Published on

OpenStack Days Tokyo 2019プレゼン資料

Published in: Engineering
  • Be the first to comment

OpenStack上の環境構築自動化に向けたTerraform/Pulumiの活用

  1. 1. OpenStack Terraform/Pulumi OpenStack Days Tokyo 2019 NTT 1 (Keiichi Hikita)
  2. 2. • Terraform OpenStack ( ) • Terraform 2 , Git, GitHub, Pull Request OpenStack Heat, AWS CloudFormation
  3. 3. (Keiichi Hikita) NTT 3 Enterprise Cloud OpenStack • GUI(OpenStack Horizon ) • ( Heat/Flame ) OSS • Horizon • Heat-Dashboard, Qinling-Dashboard • Terraform Provider (for Enterprise Cloud)
  4. 4. 1. IaC 2. Terraform 4 (+Demo) 3. Pulumi (+Demo)
  5. 5. 1. IaC
  6. 6. Original ComponentsOpenStack Components Enterprise Cloud 2.0 • 2016/3 11 • 22,509 VM / 61,371 vCPUs ( ) • 2,520 Hypervisors ( ) • • OpenStack API Keystone Heat Swift Nova Cinder Glane SD-Exchange 6 … … : 2019/3/23 Horizon GUI
  7. 7. IaC(Infrastructure As Code) / / : https://www.ntt.com/business/services/cloud/iaas/enterprise-cloud/scene/scene02.html
  8. 8. お客様インフラ IaC(Infrastructure As Code) ( ) SI IaaS SI /SIer ネットワーク機能 ネットワーク機能 ネットワーク機能 ECL2.0 8 自動化したい レイヤー
  9. 9. Terraform • 複数のサービスに対応可能 • 自社サービス( )機能の組み込みが可能 なオーケストレーションツールの必要性
  10. 10. 1 3 32 12 12 3 2 " 12 Terraform • Heat, CloudFormation (HCL or JSON) API • OpenStack AWS, Provider(= 0 ) • State Provider 1 API(tf 0 ) 1 state( 0 ) State (teraform.tfstate) 1 2 3 terraform plan ( ) terraform apply ( ) New!!HCL .tf
  11. 11. Provider ≒ 1 Go CRUD tf SDK API SDK State
  12. 12. State ≒ • Terraform JSON • 2 • tf1 State plan/apply State tf1 API • artifactory • azurerm • consul • etcd • etcdv3 • gcs • http • manta • oss • pg • s3 • swift • terraform enterprise JSON
  13. 13. 2. Terraform
  14. 14. Terraform 1. CI state 2. tf (Pull Request=PR) 1 41 3. Terraform Terraform terraform plan State by Terraform by Terraform ③ 既存環境のエクス ポート機能の必要性 GitHub State tf 1 Pull Request State terraform apply ① Stateの一元管理/ 共有の必要性 ② PRベースで変 更反映まで行える 仕組みの必要性
  15. 15. Cloud State GitHub Terraformer Atlantis
  16. 16. Terraform Cloud Free Tier • 2019/5/16 HashiCorp Remote State • 1 • 2 (Collaborate on Plans and Applies, Full Workflow) 1: https://www.hashicorp.com/blog/introducing-terraform-cloud-remote-state-management 5/16のHashiCorp Blogより(※1) 変更履歴が 一覧で表示
  17. 17. Atlantis • GitHub Pull Request( ) terraform plan, apply • SaaS STEP1: PR STEP2: plan STEP3: apply
  18. 18. Atlantis ( ) • Terraform Cloud • Collaborate on Plans and Applies Atlantis ( )
  19. 19. Terraformer • API Provider tf State • 1 1 3 32 12 12 3 2 " 12 State terraformer import Terraformer .tf Providers SDKs
  20. 20. Atlantis Terraform GitHub Cloud State tfファイルに変更を 加えてPR Webhook経由で Atlantisがそれを検知 しplan実行 結果をGitHubに反映 レビュワーがGitHub上 でplan結果を確認。 GItHub経由でAtlantis にapplyを指示 1 2 3 Atlantisがterraform applyを実行し結果を GitHubに反映 4 StateはTerraform Cloud上で履歴含めて 一元管理 5 最後に作成した環境を tfファイル、Stateと してエクスポート 6 Terraformer State (File)
  21. 21. 3. Pulumi
  22. 22. Pulumi Terraform 1 3 app.pulumi.com State 2 2
  23. 23. • HCL(HashiCorp Configuration Language) • 5 0.12 • JavaScript • TypeScript • Python • Go • 226( 1) • Official Provider : 105 • Community Provider: 121 • Terraform • pulumi-terraform ( 2) Provider4 State • • • 5/16 Terraform Cloud • State 2 • • Terraform Cloud ( 3) • $50/ (TEAM STARTER Plan ( 4)) Terraform/Pulumi 1: 2019/7/10 2: https://github.com/pulumi/pulumi-terraform 3: https://www.terraform.io/docs/enterprise/free/index.html 4: https://www.pulumi.com/pricing/
  24. 24. Pulumi Demo pulumi-ecl pulumi-terraform sdk python nodejs go Pulumi-terraform, pulumi_eclを利用し てPulumi用SDKを生 成した状態 1 Terraformおよび Pulumi(Python, Node.js)でキー ペア+インスタンスを作成 2 どのようなHTTP通 信が行われているか をCharles上で キャプチャし表示 3 app.pulumi.com上で Stateがどのように見 えているかを表示 4 python/nodejs
  25. 25. 7 • Terraform • Pulumi /Terraform Cloud Terraformer • 2 2Qiita2 7 • URL Terraform: https://www.terraform.io/ Terraform Cloud Free Tier: https://app.terraform.io/signup?utm_source=banner&utm_campaign=intro_tf_cloud_remote Pulumi: https://www.pulumi.com/ Atlantis: https://www.runatlantis.io/ Terraformer: https://github.com/GoogleCloudPlatform/terraformer Atlantis

×