forked from cloudify-community/eaas-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblueprint.yaml
99 lines (93 loc) · 3.1 KB
/
blueprint.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
tosca_definitions_version: cloudify_dsl_1_3
imports:
- https://cloudify.co/spec/cloudify/6.2.0/types.yaml
- plugin:cloudify-fabric-plugin?version= >=2.0.7
inputs:
cloud_credentials:
type: dict
network_deployment_id:
type: string
resource_config:
type: dict
node_templates:
network:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_input: network_deployment_id }
docker:
type: cloudify.nodes.Root
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/install-docker.sh
fabric_env: &fabric_env
host: { get_attribute: [ network, capabilities, k8s_vm_ip ] }
user: centos
connect_kwargs:
pkey: { get_input: [ cloud_credentials, private_key_content ] }
configure:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/configure-docker.sh
fabric_env: *fabric_env
start:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/start-docker.sh
fabric_env: *fabric_env
stop:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/stop-docker.sh
fabric_env: *fabric_env
relationships:
- target: network
type: cloudify.relationships.depends_on
minikube:
type: cloudify.nodes.Root
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/install-minikube.sh
fabric_env: *fabric_env
configure:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/forward-port-to-minikube.sh
fabric_env: *fabric_env
start:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/start-minikube.sh
fabric_env: *fabric_env
process:
env:
HOST_VM_IP: { get_attribute: [ network, capabilities, k8s_vm_ip ] }
poststart:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/load-config.py
fabric_env: *fabric_env
process:
env:
HOST_VM_IP: { get_attribute: [ network, capabilities, k8s_vm_ip ] }
stop:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
script_path: scripts/stop-minikube.sh
fabric_env: *fabric_env
relationships:
- target: docker
type: cloudify.relationships.depends_on
capabilities:
endpoint:
value: { concat: [ 'https://', { get_attribute: [ network, capabilities, k8s_vm_ip ] } ] }
config:
value:
file_content: { get_attribute: [ minikube, config ] }