forked from cloudify-incubator/kubernetes-node-blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws.yaml
188 lines (164 loc) · 5.41 KB
/
aws.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
tosca_definitions_version: cloudify_dsl_1_3
description: >
This blueprint creates a Kubernetes Cluster.
imports:
- http://www.getcloudify.org/spec/cloudify/4.3/types.yaml
- plugin:cloudify-diamond-plugin
- plugin:cloudify-fabric-plugin
- plugin:cloudify-utilities-plugin
- plugin:cloudify-aws-plugin
- imports/kubernetes.yaml
- imports/cloud-config.yaml
inputs:
ami:
description: >
An AWS AMI. Tested with a Centos 7.0 image.
default: { get_secret: centos_core_image }
instance_type:
description: >
The AWS instance_type. Tested with m3.medium, although that is unnecessarily large.
default: t2.medium
agent_user:
description: >
The username of the agent running on the instance created from the image.
default: ec2-user
node_security_group:
description: >
The resource id of the security group
node_ssh_group:
description: >
The resource id of the ssh security group
dsl_definitions:
aws_config: &aws_config
aws_access_key_id: { get_secret: aws_access_key_id }
aws_secret_access_key: { get_secret: aws_secret_access_key }
ec2_region_name: { get_secret: ec2_region_name }
ec2_region_endpoint: { get_secret: ec2_region_endpoint }
node_templates:
k8s_node_host:
type: cloudify.aws.nodes.Instance
capabilities:
scalable:
properties:
default_instances: 1
properties:
agent_config:
install_method: remote
user: { get_input: agent_user }
port: 22
key: { get_secret: agent_key_private }
aws_config: *aws_config
image_id: { get_input: ami }
instance_type: { get_input: instance_type }
relationships:
- type: cloudify.aws.relationships.instance_connected_to_eni
target: kubernetes_node_nic
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: aws.cloudify_aws.ec2.instance.create
inputs:
args:
placement: { get_secret: availability_zone }
user_data: { get_attribute: [ cloudify_host_cloud_config, cloud_config ] }
cloudify.interfaces.monitoring_agent:
install:
implementation: diamond.diamond_agent.tasks.install
inputs:
diamond_config:
interval: 1
start: diamond.diamond_agent.tasks.start
stop: diamond.diamond_agent.tasks.stop
uninstall: diamond.diamond_agent.tasks.uninstall
cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
ProcessResourcesCollector:
config:
enabled: true
unit: B
measure_collector_time: true
cpu_interval: 0.5
process:
hyperkube:
name: hyperkube
kubernetes_node_nic:
type: cloudify.aws.nodes.Interface
properties:
aws_config: *aws_config
relationships:
- type: cloudify.aws.relationships.connected_to_subnet
target: private_subnet
- type: cloudify.aws.relationships.connected_to_security_group
target: ssh_group
- type: cloudify.aws.relationships.connected_to_security_group
target: kubernetes_security_group
kubernetes_security_group:
type: cloudify.aws.nodes.SecurityGroup
properties:
aws_config: *aws_config
description: Security group for Kubernetes Cluster
use_external_resource: true
resource_id: { get_input: node_security_group }
relationships:
- type: cloudify.aws.relationships.security_group_contained_in_vpc
target: vpc
ssh_group:
type: cloudify.aws.nodes.SecurityGroup
properties:
aws_config: *aws_config
description: SSH Group
use_external_resource: true
resource_id: { get_input: node_ssh_group }
relationships:
- type: cloudify.aws.relationships.security_group_contained_in_vpc
target: vpc
public_subnet:
type: cloudify.aws.nodes.Subnet
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_secret: public_subnet_id }
cidr_block: N/A
availability_zone: N/A
relationships:
- type: cloudify.aws.relationships.subnet_contained_in_vpc
target: vpc
private_subnet:
type: cloudify.aws.nodes.Subnet
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_secret: private_subnet_id }
cidr_block: N/A
availability_zone: N/A
relationships:
- type: cloudify.aws.relationships.subnet_contained_in_vpc
target: vpc
vpc:
type: cloudify.aws.nodes.VPC
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_secret: vpc_id }
cidr_block: N/A
groups:
k8s_node_group:
members:
- k8s_node_host
- kubernetes_node_nic
policies:
kubernetes_node_vms_scaling_policy:
type: cloudify.policies.scaling
properties:
default_instances: 1
targets: [k8s_node_group]
outputs:
deployment-type:
description: Deployment Type, Needed In order to determine if the kubernetes host is normal node or load balancer
value: node
deployment-node-data-type:
description: Cloudify node type needed in kubernetes cloudify provider
value: cloudify.nodes.ApplicationServer.kubernetes.Node