Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Spinnaker Application management by Terraform Plugins

Keke
July 03, 2020

Spinnaker Application management by Terraform Plugins

HashiTalk Japan 2020/7/3 16:00 ~ 16:15での発表です。

Keke

July 03, 2020
Tweet

More Decks by Keke

Other Decks in Technology

Transcript

  1. 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
  2. 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)
  3. 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
  4. Spinnaker Spinnaker is an open source, multi-cloud continuous delivery platform

    Service Team Spinnaker Application Trigger Deploy How to manage Spinnaker Applications?
  5. 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
  6. 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]” }
  7. 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]” }
  8. 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!
  9. 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
  10. Spinnaker Spinnaker is an open source, multi-cloud continuous delivery platform

    New Spinnaker Application Create Old Spinnaker Application
  11. Spinnaker Spinnaker is an open source, multi-cloud continuous delivery platform

    New Spinnaker Application Create Old Spinnaker Application How to delete old application? Delete
  12. 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)
  13. 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” } }
  14. 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.
  15. 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!
  16. 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!
  17. 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.