-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathutilities.yaml
69 lines (65 loc) · 2.08 KB
/
utilities.yaml
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
version: v1
kind: kubernetes
application: demo-utilities
targets:
prod-cmd-hook:
account: cluster01
namespace: armory-rna
strategy: rolling
prod-prometheus:
account: cluster01
namespace: prometheus
strategy: rolling
constraints:
dependsOn:
- prod-cmd-hook
beforeDeployment:
- runWebhook: # provided prometheus config can only run 1 pod at a time, so this ensures that is all that happens also means if the PV runs out ofspace, redeploying fixes it.
name: Delete namespace
afterDeployment:
- analysis: # ensure prometheus works...
interval: 10
units: seconds
numberOfJudgmentRuns: 1
queries:
- avgCPUUsage-pass
stage-cmd-hook:
account: cluster02
namespace: armory-rna
strategy: rolling
manifests:
- path: pxbbq-demo/mongodb-pvc.yaml
targets: [prod-cmd-hook]
- path: utilities/cmdhook.yml
targets: ['prod-cmd-hook','stage-cmd-hook']
- path: utilities/prometheus.yml
targets: ['prod-prometheus']
strategies:
rolling:
canary:
steps:
- setWeight:
weight: 100
analysis: # Canary analysis queries and thresholds
defaultMetricProviderName: prod-prometheus
queries:
- name: avgCPUUsage-pass
upperLimit: 10000 #3
lowerLimit: 0
queryTemplate: >-
avg (avg_over_time(container_cpu_system_seconds_total{job="kubelet"}[{{armory.promQlStepInterval}}]) * 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:
- agentIdentifier: cluster01
bodyTemplate:
inline: |-
{ "cmd": "kubectl",
"arg": "delete ns {{armory.namespace}} --ignore-not-found=true -o name",
"callbackURL": "{{armory.callbackUri}}/callback"
}
method: POST
name: Delete namespace
networkMode: remoteNetworkAgent
retryCount: 3
uriTemplate: http://cmd-hook.armory-rna:8081/cmd