Skip to content
Permalink
Browse files

Kayenta tutorial - upgrade to 1.10 (#3742)

* Give commands for Spinnaker 1.10

* upgrade CI for kayenta solution to Spinnaker 1.10

* fix typo in kayenta solution readme
  • Loading branch information...
MrTrustor authored and duftler committed Dec 17, 2018
1 parent 9a4541f commit f6cf2110a74614b3cd1be3c70254356e50d4fb0d
@@ -41,17 +41,38 @@ jq '(.stages[] | select(.refId == "9") | .pipeline) |= env.PIPELINE_ID | (.stage
```

### Create the "Automated Canary Deploy" pipeline
This commands assumes that Kayenta is enabled and configured as instructed in the

#### Spinnaker 1.10

This command assumes that Kayenta is enabled and configured as instructed in the
tutorial.

```
wget https://raw.githubusercontent.com/spinnaker/spinnaker/master/solutions/kayenta/pipelines/automated-canary-1-10.json
export PIPELINE_ID=$(curl \
localhost:8080/gate/applications/sampleapp/pipelineConfigs/Simple%20deploy \
| jq -r '.id')
export CANARY_CONFIG_ID=$(curl \
localhost:8080/gate/v2/canaryConfig | jq -r '.[0].id')
jq '(.stages[] | select(.refId == "9") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "8") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "16") | .canaryConfig.canaryConfigId) |= env.CANARY_CONFIG_ID' automated-canary-1-10.json | \
curl -d@- -X POST \
-H "Content-Type: application/json" -H "Accept: */*" \
http://localhost:8080/gate/pipelines
```

#### Spinnaker 1.9

This command assumes that Kayenta is enabled and configured as instructed in the
tutorial.

```
wget https://raw.githubusercontent.com/spinnaker/spinnaker/master/solutions/kayenta/pipelines/automated-canary.json
wget https://raw.githubusercontent.com/spinnaker/spinnaker/master/solutions/kayenta/pipelines/automated-canary-1-9.json
export PIPELINE_ID=$(curl \
localhost:8080/gate/applications/sampleapp/pipelineConfigs/Simple%20deploy \
| jq -r '.id')
export CANARY_CONFIG_ID=$(curl \
localhost:8080/gate/v2/canaryConfig | jq -r '.[0].id')
jq '(.stages[] | select(.refId == "9") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "8") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "11") | .canaryConfig.canaryConfigId) |= env.CANARY_CONFIG_ID' automated-canary.json | \
jq '(.stages[] | select(.refId == "9") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "8") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "11") | .canaryConfig.canaryConfigId) |= env.CANARY_CONFIG_ID' automated-canary-1-9.json | \
curl -d@- -X POST \
-H "Content-Type: application/json" -H "Accept: */*" \
http://localhost:8080/gate/pipelines
@@ -50,7 +50,7 @@ curl -XPOST -d '{"job":[{"type":"updateApplication","application":{"name":"sampl
sleep 5

## Creating Canary config for sampleapp ##
curl -XPOST -d '{"name":"kayenta-test","applications":["sampleapp"],"description":"","metrics":[{"analysisConfigurations":{"canary":{"direction":"increase"}},"name":"error_rate","query":{"type":"stackdriver","serviceType":"stackdriver","customFilterTemplate":"http_code","metricType":"external.googleapis.com/prometheus/requests"},"groups":["Group 1"],"scopeName":"default"}],"configVersion":"1","templates":{"http_code":"metric.labels.http_code = \"500\" AND resource.label.pod_name = starts_with(\"${scope}\")"},"classifier":{"groupWeights":{"Group 1":100},"scoreThresholds":{"pass":95,"marginal":75}},"judge":{"name":"NetflixACAJudge-v1.0","judgeConfigurations":{}}}' \
curl -XPOST -d '{"name":"kayenta-test","applications":["sampleapp"],"description":"","metrics":[{"analysisConfigurations":{"canary":{"direction":"increase"}},"name":"error_rate","query":{"type":"stackdriver","serviceType":"stackdriver","resourceType":"k8s_container","perSeriesAligner":"ALIGN_RATE","customFilterTemplate":"http_code","metricType":"external.googleapis.com/prometheus/requests"},"groups":["Group 1"],"scopeName":"default"}],"configVersion":"1","templates":{"http_code":"metric.labels.http_code = \"500\" AND resource.label.pod_name = starts_with(\"${scope}\")"},"classifier":{"groupWeights":{"Group 1":100},"scoreThresholds":{"pass":95,"marginal":75}},"judge":{"name":"NetflixACAJudge-v1.0","judgeConfigurations":{}}}' \
--fail -sS -H "Content-Type: application/json" -H "Accept: */*" \
http://localhost:8080/gate/v2/canaryConfig > /dev/null
sleep 5
@@ -59,7 +59,7 @@ sleep 5
export PIPELINE_ID=$(curl localhost:8080/gate/applications/sampleapp/pipelineConfigs/Simple%20deploy \
| jq -r '.id')
export CANARY_CONFIG_ID=$(curl localhost:8080/gate/v2/canaryConfig | jq -r '.[0].id')
jq '(.stages[] | select(.refId == "9") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "8") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "11") | .canaryConfig.canaryConfigId) |= env.CANARY_CONFIG_ID' spinnaker-git/solutions/kayenta/pipelines/automated-canary.json | \
jq '(.stages[] | select(.refId == "9") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "8") | .pipeline) |= env.PIPELINE_ID | (.stages[] | select(.refId == "16") | .canaryConfig.canaryConfigId) |= env.CANARY_CONFIG_ID' spinnaker-git/solutions/kayenta/pipelines/automated-canary-1-10.json | \
curl -d@- -X POST \
-H "Content-Type: application/json" -H "Accept: */*" \
http://localhost:8080/gate/pipelines
@@ -23,8 +23,8 @@ curl -sS "https://storage.googleapis.com/stackdriver-prometheus-documentation/pr
kubectl apply -f -

## Install Spinnaker ##
kubectl apply -f \
https://spinnaker.io/downloads/kubernetes/quick-install.yml
curl -sSL "https://spinnaker.io/downloads/kubernetes/quick-install.yml" | \
sed 's/version:.*/version: 1.10.5/g' | kubectl apply -f -
# A successful Spinnaker install has 11 pods
# Timeout of 20minutes (1200s)
set +x

0 comments on commit f6cf211

Please sign in to comment.
You can’t perform that action at this time.