Share
Embed
Spinnaker Application management by Terraform Plugins
HashiTalk Japan 2020/7/3 16:00 ~ 16:15での発表です。
Keke
July 03, 2020
Transcript
31 slides
-
Spinnaker Application management by Terraform Plugins HashiTalk Japan 2020/7/3 16:00~16:15
Keisuke Yamashita (Twitter: @_k_e_k_e) Copyright © 2019 HashiCorp -
Agenda ・About Terraform Plugins ・Manage Spinnaker Applications w/ Terraform Providers
・Operation by Terraform Provisioners ・Wrap up -
Terraform = Terraform Core + Terraform Plugins Terraform Cores •
Entrypoint for Terraform • Resource state management • Communicate with Terraform Plugins Terraform Plugins • Executable binary called by Terraform Core • Exposes an implementation for a specific services(GCP, AWS, local host, etc) -
Terraform Plugins = Terraform Providers + Terraform Provisioners Terraform Providers
• Access external service APIs and CRUD resources • Managed Terraform State Terraform Provisioners • Run model specific actions for preparing the resources -
Spinnaker Spinnaker is an open source, multi-cloud continuous delivery platform
Service Team Spinnaker Application Trigger Deploy -
Spinnaker Spinnaker is an open source, multi-cloud continuous delivery platform
Service Team Spinnaker Application Trigger Deploy How to manage Spinnaker Applications? -
Terraform Providers The three kinds 1. Built-in Providers • Null
provider • Secret provider • … 2. Hashicorp distributed Providers • terraform-provider-gcp • terraform-provider-aws • terraform-provider-vault -
Terraform Providers The three kinds 3. Custom Providers • Third-party
developed providers • Develop by yourself -
Manage Spinnaker Applications CODE EDITOR resource “spinnaker_application” “my_app” { application
= “my-app” email = “[email protected]” } resource “spinnaker_application” “my_test_app” { application = “my-test-app” email = “[email protected]” } -
Manage Spinnaker Applications CODE EDITOR resource “spinnaker_application” “my_app” { application
= “my-app” email = “[email protected]” } resource “spinnaker_application” “my_test_app” { application = “my-test-app” email = “[email protected]” } -
Terraform Providers Take away To Terraform manage resources… 1. Check
if there are built-in providers 2. Check if Hashicorp distributes the provider 3. Check custom provider in the community, GitHub, etc 4. Develop by yourself! Ideally, there are no limits what you can manage! -
Terraform Providers Take away But… • Built-in provider: It’s built-in
• Hashicorp distributed provider: Terraform will download on terraform init • Custom Provider: You need to manually download to your environment -
Spinnaker Spinnaker is an open source, multi-cloud continuous delivery platform
New Spinnaker Application Create Old Spinnaker Application -
Spinnaker Spinnaker is an open source, multi-cloud continuous delivery platform
New Spinnaker Application Create Old Spinnaker Application How to delete old application? Delete -
Terraform Provisioners List of provisioners • Chef • File •
habitat • puppet • remote-exec • salt-masterless • local-exec: Run any script on resource create or delete. See details Provisioners(https://www.terraform.io/docs/provisioners/index.html) -
local-exec Terraform Provisioner Runs script on resource create CODE EDITOR
resource “spinnaker_application” “my_app” { application = “my-app” email = “[email protected] provisioner “local-exec” { command = “./script/delete-app.sh my-old-app” } } -
Terraform Provisioners Take away There are many actions provided by
Terraform Provisioners. Ideally, you can run any operation by local-exec provisioner. Very useful for many use cases. -
Terraform Provisioners Take away There are many actions provided by
Terraform Provisioners. Ideally, you can run any operation by local-exec provisioner. Very useful for many use cases. No custom provisioners! -
Manage Spinnaker Application by Terraform Plugins Managed Spinnaker application by
custom Providers By developing custom Terraform Providers, you can ideally manage any resource. Start building one! -
Manage Spinnaker Application by Terraform Plugins Managed Spinnaker application by
custom Providers By developing custom Terraform Providers, you can ideally manage any resource. Start building one! Provisions are done by local-exec Provisioners Terraform is mainly used as provisioning tool but can be also used as configuration management tool.