-
Notifications
You must be signed in to change notification settings - Fork 27
/
deploy-automated-2-env.yml
114 lines (113 loc) · 4.07 KB
/
deploy-automated-2-env.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
version: v1
kind: kubernetes
application: potato-facts3
# Map of Deployment Targets, this is set up in a way where
# we can do multi-target deployments (multi-region or multi-cluster)
targets:
# This in the name of a deployment, underneath it are its configuration
staging:
# the name of an agent configured account
account: demo-staging-cluster
# Optionally override the namespaces that are in the manifests
namespace: borealis-staging
# This is the key to a strategy under the strategies map
strategy: rolling
# This is a list of manifest names that should be included in this deployment
constraints:
afterDeployment:
- runWebhook:
name: Run_Integration_Tests
prod-west:
# the name of an agent configured account
account: demo-prod-west-cluster
# Optionally override the namespaces that are in the manifests
namespace: borealis-prod
# This is the key to a strategy under the strategies map
strategy: mycanary
constraints:
dependsOn: ["staging"]
prod-eu:
# the name of an agent configured account
account: demo-prod-eu-cluster
# Optionally override the namespaces that are in the manifests
namespace: borealis-prod-eu
# This is the key to a strategy under the strategies map
strategy: mycanary
constraints:
dependsOn: [ "staging" ]
# The list of manifests sources
manifests:
# This will read all yaml|yml files in a dir and deploy all manifests in that directory to all targets.
- path: /manifests/potato-facts.yml
- path: /manifests/potato-facts-external-service.yml
targets: [prod-west, prod-eu]
# The map of strategies, a deployment target will reference one of these
strategies:
# this is the name for the strategy
mycanary:
# This map key, is the deployment strategy type
canary:
# List of canary steps
steps:
# The map key is the step type
- setWeight:
weight: 25
- analysis:
interval: 30
units: seconds
numberOfJudgmentRuns: 1
queries:
- avgCPUUsage-pass
- avgRAMUsage-pass
- setWeight:
weight: 50
- analysis:
interval: 30
units: seconds
numberOfJudgmentRuns: 3
queries:
- avgCPUUsage-pass
- avgRAMUsage-pass
- setWeight:
weight: 100
rolling:
canary:
steps:
- setWeight:
weight: 100
analysis:
defaultMetricProviderName: Stephen-Prometheus
queries:
- name: avgCPUUsage-pass
upperLimit: 95 #3
lowerLimit: 0
queryTemplate: >-
avg(rate(container_cpu_user_seconds_total{job="kubelet"}[{{armory.promQlStepInterval}}]) * 100 * on (pod) group_left (annotation_app)
sum(kube_pod_annotations{job="kube-state-metrics",annotation_deploy_armory_io_replica_set_name="{{armory.replicaSetName}}"})
by (annotation_app, pod)) by (annotation_app) or on() vector(0)
- name: avgRAMUsage-pass
upperLimit: 100 #3
lowerLimit: 0
queryTemplate: >-
avg((avg(avg_over_time( container_memory_working_set_bytes{job="kubelet"}[30s])) by (pod) / on (pod)
avg( avg_over_time(container_spec_memory_limit_bytes{}[30s])) by (pod) ) * on (pod) group_left (annotation_app)
sum(kube_pod_annotations{job="kube-state-metrics",annotation_deploy_armory_io_replica_set_name="{{armory.replicaSetName}}"}) by (annotation_app, pod)) by (annotation_app) or on() vector(0)
webhooks:
- name: Run_Integration_Tests
method: POST
uriTemplate: https://api.github.com/repos/{{secrets.github_org}}/{{secrets.github_repository}}/dispatches
networkMode: direct
headers:
- key: Authorization
value: token {{secrets.github_token}}
- key: Content-Type
value: application/json
bodyTemplate:
inline: >-
{
"event_type": "checkLogs",
"client_payload": {
"callbackUri": "{{armory.callbackUri}}/callback"
}
}
retryCount: 3