-
Notifications
You must be signed in to change notification settings - Fork 2
/
service.yaml
110 lines (99 loc) · 3.05 KB
/
service.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
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
tosca_definitions_version: tosca_simple_yaml_1_3
metadata:
template_name: "scaling"
template_author: "XLAB"
template_version: "1.0"
interface_types:
radon.interfaces.Scaling:
derived_from: tosca.interfaces.Root
operations:
scale_down:
description: scale down
scale_up:
description: scale up
node_types:
radon.nodes.aws.AwsLambda:
derived_from: tosca.nodes.SoftwareComponent
interfaces:
Standard:
operations:
create: playbooks/create.yaml
delete: playbooks/delete.yaml
Scaling:
type: radon.interfaces.Scaling
operations:
scale_down: playbooks/scale_down.yaml
scale_up: playbooks/scale_up.yaml
radon.nodes.monitoring.configure:
derived_from: tosca.nodes.SoftwareComponent
interfaces:
Standard:
type: tosca.interfaces.node.lifecycle.Standard
operations:
configure:
implementation: playbooks/configure.yaml
inputs:
cpu_lower_bound:
type: float
value: { get_property: [ radon.policies.scaling.ScaleDown, cpu_lower_bound ] }
cpu_upper_bound:
type: float
value: { get_property: [ radon.policies.scaling.ScaleUp, cpu_upper_bound ] }
policy_types:
radon.policies.scaling.ScaleDown:
derived_from: tosca.policies.Scaling
properties:
cpu_lower_bound:
description: The lower bound for the CPU
type: float
required: false
targets: [ radon.nodes.aws.AwsLambda, radon.nodes.monitoring.configure ]
triggers:
radon.triggers.scaling.ScaleDown:
description: A trigger for scaling down
event: scale_down_trigger
target_filter:
node: radon.nodes.aws.AwsLambda
action:
- call_operation: Scaling.scale_down
radon.policies.scaling.ScaleUp:
derived_from: tosca.policies.Scaling
properties:
cpu_upper_bound:
description: The upper bound for the CPU
type: float
required: false
targets: [ radon.nodes.aws.AwsLambda, radon.nodes.monitoring.configure ]
triggers:
radon.triggers.scaling.ScaleUp:
description: A trigger for scaling up
event: scale_up_trigger
target_filter:
node: radon.nodes.aws.AwsLambda
action:
- call_operation: Scaling.scale_up
topology_template:
node_templates:
aws_lambda:
type: radon.nodes.aws.AwsLambda
requirements:
- host: compute
configure_monitoring:
type: radon.nodes.monitoring.configure
requirements:
- host: compute
compute:
type: tosca.nodes.Compute
attributes:
public_address: localhost
policies:
- scale_down:
type: radon.policies.scaling.ScaleDown
properties:
cpu_lower_bound: 10
targets: [ aws_lambda, configure_monitoring ]
- scale_up:
type: radon.policies.scaling.ScaleUp
properties:
cpu_upper_bound: 90
targets: [ aws_lambda, configure_monitoring ]