とんちゃんといっしょ

Cloudに関する技術とか日常とかについて書いたり書かなかったり

Spinnaker の pipeline-template を試してみた

モチベーション

Spinnakerの pipeline をUIではなくレビューができるコード形式にしたい

やったこと

これを参考に

pipeline-templateの有効化

$ hal config features edit --pipeline-templates true
+ Get current deployment
  Success
+ Get features
  Success
+ Edit features
  Success
+ Successfully updated features.
$ hal deploy apply
+ Get current deployment
  Success
+ Prep deployment
  Success
Problems in
  default.provider.dockerRegistry.spinnaker-gcr-account:
- WARNING Your docker registry has no repositories specified, and
  the registry's catalog is empty. Spinnaker will not be able to deploy any images
  until some are pushed to this registry.
? Manually specify some repositories for this docker registry to
  index.

Problems in default.security:
- WARNING Your UI or API domain does not have override base URLs
  set even though your Spinnaker deployment is a Distributed deployment on a
  remote cloud provider. As a result, you will need to open SSH tunnels against
  that deployment to access Spinnaker.
? We recommend that you instead configure an authentication
  mechanism (OAuth2, SAML2, or x509) to make it easier to access Spinnaker
  securely, and then register the intended Domain and IP addresses that your
  publicly facing services will be using.

+ Preparation complete... deploying Spinnaker
+ Get current deployment
  Success
+ Apply deployment
  Success
+ Deploy spin-clouddriver
  Success
+ Deploy spin-front50
  Success
+ Deploy spin-orca
  Success
+ Deploy spin-deck
  Success
+ Deploy spin-echo
  Success
+ Deploy spin-gate
  Success
+ Deploy spin-igor
  Success
+ Deploy spin-kayenta
  Success
+ Deploy spin-rosco
  Success
+ Run `hal deploy connect` to connect to Spinnaker.

テンプレートの作成

テンプレートは現状HTTP(S) 経由でしか使えない。

サンプルのテンプレート(本家のほうは動かない. metadataが必要らしい)

schema: "1"
id: barebones
metadata:
  name: barebones
  description: this is test.
  scopes: [global]
variables: []
stages:
- id: wait
  type: wait
  config:
    waitTime: 5

roer のDL

githubのページからDL

$ wget https://github.com/spinnaker/roer/releases/download/v0.11.3/roer-linux-amd64

バイナリが落ちてくるのであとは実行権限を付与。 ついでに名前も変えておく。

$ file roer-linux-amd64
roer-linux-amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
$ chmod +x roer-linux-amd64
$ mv roer-linux-amd64 roer

CLI (roer)を使ったtemplateの作成

GKEでSPINNAKER_APIを設定するのはこっち 参照

$ roer pipeline-template publish template.yml

参考情報