Spinnaker与Kayenta的部署

当使用hal命令启用金丝雀功能时,Kayenta也会被部署。

环境 –

Minikube将内存分配设置为20GB(默认的2GB无法运行)。

$ uname -a
Linux mina 4.13.0-45-generic #50-Ubuntu SMP Wed May 30 08:23:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.10
DISTRIB_CODENAME=artful
DISTRIB_DESCRIPTION="Ubuntu 17.10"
$ minikube version
minikube version: v0.25.2
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"", Minor:"", GitVersion:"v1.9.4", GitCommit:"bee2d1505c4fe820744d26d41ecd3fdd4a3d6546", GitTreeState:"clean", BuildDate:"2018-03-21T21:48:36Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"}
$ hal -v
1.5.0-20180713143726
$

启用canary功能

参考 Set up canary support 的方式。

$ hal config canary enable
$ hal config canary edit --default-metrics-store prometheus
$ hal config canary edit --default-metrics-account my-canary-metrics-account
$ hal config canary edit --default-storage-account my-canary-storage-account

尽管我们没有使用AWS,但我们会启用S3兼容的minio,以便Kayenta可以使用它(否则Kayenta将无法运行)。
请事先使用其他命令(例如helm install stable/minio)部署minio。
我们将直接在~/.hal/config中编辑配置文件,并添加minio的端点、accessKey和secretAccessKey。
参考链接:https://community.spinnaker.io/t/canary-and-foolproof-install/290/15

$ hal config canary aws enable
$ # ドキュメント通りのこの引数だとbucket名が--deploymentになってしまうので後でvimで修正します
$ hal config canary aws account add my-canary-aws-account --bucket --deployment --no-validate
$ hal config canary aws edit --s3-enabled true
$ # Halyardのconfigを編集
$ # 1 bucketを適切な名前(例:my-canary-bucket)にします。
$ #   minioにも予めその名前でバケットを作成しておく必要があります。
$ #   ( 作成しておかないとminioが動かない)
$ # 2 以下行を新規追加します(halコマンドでできないの?)
$ #   endpoint : minioのエンドポイント
$ #   accessKeyId : minioのaccessKey
$ #   secretAccessKey : minioのsecret accessKey
$ vim ~/.hal/config
( 略 : )
  canary:
    enabled: true
( 略 : )
    - name: aws
      enabled: true
      accounts:
      - name: my-canary-aws-account
        bucket: my-canary-bucket
        rootFolder: kayenta
        endpoint: http://my-minio.default.svc.cluster.local:9000
        accessKeyId: AKIAIOSFODNN7EXAMPLE
        secretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
        supportedTypes:
        - OBJECT_STORE
        - CONFIGURATION_STORE
      s3Enabled: true
( 略 : )
$ 

使用 Prometheus 的指标配置示例

$ hal config canary prometheus enable
$ hal config canary prometheus account add my-canary-prometheus-account --base-url http://prometheus.istio-system.svc.cluster.local:

部署

$ hal deploy apply
$ kubectl get po -n spinnaker
NAME                                    READY     STATUS    RESTARTS   AGE
spin-clouddriver-bootstrap-v000-4hnr6   1/1       Running   0          48m
spin-clouddriver-v000-jqs7b             1/1       Running   0          47m
spin-deck-v000-hn25f                    1/1       Running   0          47m
spin-echo-v000-hgsmw                    1/1       Running   0          47m
spin-front50-v000-dclsk                 1/1       Running   1          47m
spin-gate-v000-2d6vx                    1/1       Running   0          47m
spin-igor-v000-dggjd                    1/1       Running   0          47m
spin-kayenta-v000-tjdqw                 1/1       Running   0          47m
spin-orca-bootstrap-v000-8nnkt          1/1       Running   0          48m
spin-orca-v000-rr8cc                    1/1       Running   0          47m
spin-redis-bootstrap-v000-q6kzs         1/1       Running   0          49m
spin-redis-v000-4qrgl                   1/1       Running   0          47m
spin-rosco-v000-xqcvk                   1/1       Running   0          47m
$
广告
将在 10 秒后关闭
bannerAds