-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmulticloud-openstack.yaml
183 lines (167 loc) · 6.17 KB
/
multicloud-openstack.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
tosca_definitions_version: cloudify_dsl_1_3
imports:
- http://www.getcloudify.org/spec/cloudify/5.0.0/types.yaml
- plugin:cloudify-utilities-plugin
- plugin:cloudify-openstack-plugin?version= >=3
- plugin:cloudify-ansible-plugin
- plugin:cloudify-kubernetes-plugin
inputs:
openstack-external-network:
type: string
description: >
the openstack network name or Id to connect for external management
default: { get_secret: openstack-external-network }
centos-image-id:
type: string
description: >
centos image ID on private cloud
default: { get_secret: centos_image_id }
centos-flavor-id:
type: string
description: >
centos flavor ID on private cloud
default: { get_secret: centos_flavor_id }
keystone-region:
type: string
description: >
openstack region
default: { get_secret: keystone_region}
app_instances:
type: string
description: >
number of application instances (dockers) to run
constraints:
- less_or_equal: 20
default: 1
opnstack_client_config:
type: dict
description: A dictionary containing the client configuration for Openstack. Default is for keystone v2. Provide an alternate input for keystone v3.
default:
username: { get_secret: openstack_username }
password: { get_secret: openstack_password }
project_name: { get_secret: openstack_tenant_name }
auth_url: { get_secret: openstack_auth_url }
region_name: { get_secret: openstack_region }
node_templates:
openstack-network:
type: cloudify.nodes.ServiceComponent
properties:
resource_config:
blueprint:
external_resource: false
id: openstack-network-bp
blueprint_archive: https://github.com/cloudify-community/blueprint-examples/releases/download/5.0.0-4/openstack-example-network.zip
main_file_name: blueprint.yaml
deployment:
id: openstack-network
auto_inc_suffix: false
inputs:
external_network_id: { get_input: [ openstack-external-network ] }
client_config_dict: { get_input: opnstack_client_config }
private-infra-vm:
type: cloudify.nodes.Root
interfaces:
cloudify.interfaces.lifecycle:
start:
implementation: scripts/upload-cloud-infra.sh
inputs:
id: private-cloud-vm
blueprint_archive: https://github.com/cloudify-community/blueprint-examples/releases/download/5.0.0-4/db-lb-app-infrastructure.zip
main_file_name: openstack.yaml
executor: central_deployment_agent
max_retries: 0
stop:
implementation: scripts/uninstall-infra.sh
inputs:
id: private-cloud-vm
executor: central_deployment_agent
max_retries: 0
openstack-db:
type: cloudify.nodes.ServiceComponent
properties:
resource_config:
blueprint:
external_resource: false
id: openstack-db-bp
blueprint_archive: https://github.com/cloudify-community/blueprint-examples/releases/download/5.0.0-4/db-lb-app-db.zip
main_file_name: private-cloud-application.yaml
deployment:
id: openstack-db
auto_inc_suffix: false
inputs:
infrastructure--resource_name_prefix: db
infrastructure--network_deployment_name: openstack-network
relationships:
- type: cloudify.relationships.connected_to
target: openstack-network
- type: cloudify.relationships.contained_in
target: private-infra-vm
openstack-lb:
type: cloudify.nodes.ServiceComponent
properties:
resource_config:
blueprint:
external_resource: false
id: openstack-lb-bp
blueprint_archive: https://github.com/cloudify-community/blueprint-examples/releases/download/5.0.0-4/db-lb-app-lb.zip
main_file_name: private-cloud-application.yaml
deployment:
id: openstack-lb
auto_inc_suffix: false
inputs:
infrastructure--resource_name_prefix: lb
infrastructure--network_deployment_name: openstack-network
database_deployment: openstack-db
relationships:
- type: cloudify.relationships.connected_to
target: openstack-db
- type: cloudify.relationships.contained_in
target: private-infra-vm
wordpress-app:
type: cloudify.nodes.ServiceComponent
properties:
resource_config:
blueprint:
external_resource: false
id: wordpress-bp
blueprint_archive: https://github.com/cloudify-community/blueprint-examples/releases/download/5.0.0-4/db-lb-app-kube_app.zip
main_file_name: application.yaml
deployment:
id: wordpress
auto_inc_suffix: true
inputs:
load_balancer_deployment: openstack-lb
kubernetes_deployment: kubernetes
# current_suffix_index: { get_attribute: [ SELF, resource_config, deployment, current_suffix_index ] }
capabilities:
scalable:
properties:
default_instances: { get_input: app_instances }
relationships:
- type: cloudify.relationships.contained_in
target: kubernetes
- type: cloudify.relationships.connected_to
target: openstack-lb
kubernetes:
type: cloudify.nodes.ServiceComponent
properties:
resource_config:
blueprint:
external_resource: false
id: kubernetes-bp
blueprint_archive: https://github.com/cloudify-community/blueprint-examples/releases/download/5.0.0-4/kubernetes.zip
main_file_name: openstack.yaml
deployment:
id: kubernetes
auto_inc_suffix: false
inputs:
external_network_id: { get_input: [ openstack-external-network ] }
region_name: RegionOne
image_id: { get_input: [ centos-image-id ] }
flavor_id: { get_input: [ centos-flavor-id ] }
client_config_dict: { get_input: opnstack_client_config }
relationships:
- type: cloudify.relationships.connected_to
target: private-infra-vm
- type: cloudify.relationships.connected_to
target: openstack-network