Skip to content

Commit 23948e4

Browse files
authored
Merge pull request #6 from cloudify-examples/update-plugins
Update plugins
2 parents 44fe4e3 + 6211447 commit 23948e4

12 files changed

Lines changed: 183 additions & 161 deletions

‎aws-blueprint.yaml‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ description: >
55
It is based on this documentation: https://kubernetes.io/docs/getting-started-guides/kubeadm/
66
77
imports:
8-
- http://www.getcloudify.org/spec/cloudify/4.0.1/types.yaml
9-
- http://getcloudify.org.s3.amazonaws.com/spec/aws-plugin/1.4.9/plugin.yaml
10-
- http://www.getcloudify.org/spec/diamond-plugin/1.3.5/plugin.yaml
11-
- types/scale.yaml
12-
- types/cloud_config/cloud-config.yaml
13-
- types/kubernetes.yaml
8+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-manager/4.1/resources/rest-service/cloudify/types/types.yaml
9+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-aws-plugin/1.4.13/plugin.yaml
10+
- https://raw.githubusercontent.com/cloudify-incubator/cloudify-utilities-plugin/1.2.5/plugin.yaml
11+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml
1412
- imports/kubernetes.yaml
1513
- imports/cloud-config.yaml
1614

@@ -168,12 +166,24 @@ node_templates:
168166
to_port: 4001
169167
cidr_ip: 0.0.0.0/0
170168
- ip_protocol: tcp
169+
from_port: 4789
170+
to_port: 4789
171+
cidr_ip: 0.0.0.0/0
172+
- ip_protocol: tcp
173+
from_port: 6443
174+
to_port: 6443
175+
cidr_ip: 0.0.0.0/0
176+
- ip_protocol: udp
171177
from_port: 6443
172178
to_port: 6443
173179
cidr_ip: 0.0.0.0/0
174180
- ip_protocol: tcp
175-
from_port: 8000
176-
to_port: 8000
181+
from_port: 6783
182+
to_port: 6784
183+
cidr_ip: 0.0.0.0/0
184+
- ip_protocol: udp
185+
from_port: 6783
186+
to_port: 6784
177187
cidr_ip: 0.0.0.0/0
178188
- ip_protocol: tcp
179189
from_port: 8080

‎azure-blueprint.yaml‎

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ description: >
77
# Several lines are commented. Currently there is not a Centos 7 image that supports Cloud Init. When there is, we will replace the current docker/kubernetes installation method with the commented lines.
88

99
imports:
10-
- http://www.getcloudify.org/spec/cloudify/4.0.1/types.yaml
10+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-manager/4.1/resources/rest-service/cloudify/types/types.yaml
1111
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-azure-plugin/1.4.3/plugin.yaml
1212
- http://www.getcloudify.org/spec/diamond-plugin/1.3.5/plugin.yaml
13-
- types/scale.yaml
14-
# - types/cloud_config/cloud-config.yaml
15-
- types/kubernetes.yaml
1613
- imports/kubernetes.yaml
17-
# - imports/cloud-config.yaml
1814

1915
inputs:
2016

@@ -334,6 +330,17 @@ node_templates:
334330
priority: 108
335331
access: Allow
336332
direction: Inbound
333+
- name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix},4789tcp]}
334+
properties:
335+
description: 4789 TCP access
336+
protocol: Tcp
337+
sourcePortRange: '*'
338+
destinationPortRange: 4789
339+
sourceAddressPrefix: '*'
340+
destinationAddressPrefix: '*'
341+
priority: 1080
342+
access: Allow
343+
direction: Inbound
337344
- name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix},6443tcp]}
338345
properties:
339346
description: 6443 TCP access
@@ -345,6 +352,50 @@ node_templates:
345352
priority: 109
346353
access: Allow
347354
direction: Inbound
355+
- name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix},6783tcp]}
356+
properties:
357+
description: 6783 TCP access
358+
protocol: Tcp
359+
sourcePortRange: '*'
360+
destinationPortRange: 6783
361+
sourceAddressPrefix: '*'
362+
destinationAddressPrefix: '*'
363+
priority: 1090
364+
access: Allow
365+
direction: Inbound
366+
- name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix},6784tcp]}
367+
properties:
368+
description: 6784 TCP access
369+
protocol: Tcp
370+
sourcePortRange: '*'
371+
destinationPortRange: 6784
372+
sourceAddressPrefix: '*'
373+
destinationAddressPrefix: '*'
374+
priority: 1091
375+
access: Allow
376+
direction: Inbound
377+
- name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix},6783udp]}
378+
properties:
379+
description: 6783 UDP access
380+
protocol: Udp
381+
sourcePortRange: '*'
382+
destinationPortRange: 6783
383+
sourceAddressPrefix: '*'
384+
destinationAddressPrefix: '*'
385+
priority: 1092
386+
access: Allow
387+
direction: Inbound
388+
- name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix},6784udp]}
389+
properties:
390+
description: 6784 UDP access
391+
protocol: Udp
392+
sourcePortRange: '*'
393+
destinationPortRange: 6784
394+
sourceAddressPrefix: '*'
395+
destinationAddressPrefix: '*'
396+
priority: 1093
397+
access: Allow
398+
direction: Inbound
348399
- name: {concat:[{get_input: resource_prefix},nsg,{get_input: resource_suffix},8000tcp]}
349400
properties:
350401
description: 8000 TCP access

‎imports/cloud-config.yaml‎

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,41 @@
11
node_templates:
22

33
cloudify_host_cloud_config:
4-
type: cloudify.nodes.CloudConfig
4+
type: cloudify.nodes.CloudInit.CloudConfig
55
properties:
66
resource_config:
7-
encode_base64: { get_input: encode_cloud_config }
8-
interfaces:
9-
cloudify.interfaces.lifecycle:
10-
create:
11-
inputs:
12-
cloud_config:
13-
groups:
14-
- docker
15-
users:
16-
- name: { get_input: agent_user }
17-
primary-group: wheel
18-
groups: docker
19-
shell: /bin/bash
20-
sudo: ['ALL=(ALL) NOPASSWD:ALL']
21-
ssh-authorized-keys:
22-
- { get_secret: agent_key_public }
23-
write_files:
24-
- path: /etc/yum.repos.d/kubernetes.repo
25-
owner: root:root
26-
permissions: '0444'
27-
content: |
28-
# installed by cloud-init
29-
[kubernetes]
30-
name=Kubernetes
31-
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
32-
enabled=1
33-
gpgcheck=1
34-
repo_gpgcheck=1
35-
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
36-
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
37-
packages:
38-
- [docker, 1.12.6-28.git1398f24.el7.centos]
39-
- [kubelet, 1.6.4-0]
40-
- [kubeadm, 1.6.4-0]
41-
- [kubectl, 1.6.4-0]
42-
- [kubernetes-cni, 0.5.1-0]
43-
runcmd:
44-
- [ systemctl, enable, docker ]
45-
- [ systemctl, start, docker ]
46-
- [ systemctl, enable, kubelet ]
47-
- [ systemctl, start, kubelet ]
7+
groups:
8+
- docker
9+
users:
10+
- name: { get_input: agent_user }
11+
primary-group: wheel
12+
groups: docker
13+
shell: /bin/bash
14+
sudo: ['ALL=(ALL) NOPASSWD:ALL']
15+
ssh-authorized-keys:
16+
- { get_secret: agent_key_public }
17+
write_files:
18+
- path: /etc/yum.repos.d/kubernetes.repo
19+
owner: root:root
20+
permissions: '0444'
21+
content: |
22+
# installed by cloud-init
23+
[kubernetes]
24+
name=Kubernetes
25+
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
26+
enabled=1
27+
gpgcheck=1
28+
repo_gpgcheck=1
29+
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
30+
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
31+
packages:
32+
- [docker, 1.12.6-28.git1398f24.el7.centos]
33+
- [kubelet, 1.6.4-0]
34+
- [kubeadm, 1.6.4-0]
35+
- [kubectl, 1.6.4-0]
36+
- [kubernetes-cni, 0.5.1-0]
37+
runcmd:
38+
- [ systemctl, enable, docker ]
39+
- [ systemctl, start, docker ]
40+
- [ systemctl, enable, kubelet ]
41+
- [ systemctl, start, kubelet ]

‎imports/kubernetes.yaml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
node_types:
2+
3+
cloudify.nodes.Kubernetes:
4+
derived_from: cloudify.nodes.Root
5+
interfaces:
6+
cloudify.interfaces.lifecycle:
7+
create:
8+
implementation: scripts/create.py
9+
10+
cloudify.nodes.Kubernetes.Master:
11+
derived_from: cloudify.nodes.Root
12+
interfaces:
13+
cloudify.interfaces.lifecycle:
14+
create:
15+
implementation: scripts/create.py
16+
configure:
17+
implementation: scripts/configure_master.py
18+
start:
19+
implementation: scripts/start_master.py
20+
21+
cloudify.nodes.Kubernetes.Node:
22+
derived_from: cloudify.nodes.Root
23+
interfaces:
24+
cloudify.interfaces.lifecycle:
25+
create:
26+
implementation: scripts/create.py
27+
configure:
28+
implementation: scripts/configure_node.py
29+
130
node_templates:
231

332
kubernetes_master:
@@ -14,6 +43,36 @@ node_templates:
1443
- type: cloudify.relationships.depends_on
1544
target: kubernetes_master
1645

46+
outputs:
47+
48+
kubernetes_master_configuration:
49+
value: { get_attribute: [ kubernetes_master, configuration_file_content ] }
50+
51+
52+
policy_types:
53+
scale_policy_type:
54+
source: policies/scale.clj
55+
properties:
56+
policy_operates_on_group:
57+
default: true
58+
service_selector:
59+
description: regular expression that selects the metric to be measured
60+
default: ".*"
61+
moving_window_size:
62+
description: the moving window for individual sources in secs
63+
default: 10
64+
scale_threshold:
65+
description: the value to trigger scaling over aggregrated moving values
66+
scale_limit:
67+
description: scaling limit
68+
default: 10
69+
scale_direction:
70+
description: scale up ('<') or scale down ('>')
71+
default: '<'
72+
cooldown_time:
73+
description: the time to wait before evaluating again after a scale
74+
default: 60
75+
1776
groups:
1877

1978
scale_up_group:

‎openstack-blueprint.yaml‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,29 @@ description: >
55
It is based on this documentation: https://kubernetes.io/docs/getting-started-guides/kubeadm/
66
77
imports:
8-
- http://www.getcloudify.org/spec/cloudify/4.0.1/types.yaml
9-
- http://www.getcloudify.org/spec/openstack-plugin/2.0.1/plugin.yaml
10-
- http://www.getcloudify.org/spec/fabric-plugin/1.3.1/plugin.yaml
11-
- http://www.getcloudify.org/spec/diamond-plugin/1.3.5/plugin.yaml
12-
- types/scale.yaml
13-
- types/cloud_config/cloud-config.yaml
14-
- types/kubernetes.yaml
15-
- imports/kubernetes.yaml
8+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-manager/4.1/resources/rest-service/cloudify/types/types.yaml
9+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-openstack-plugin/2.2.0/plugin.yaml
10+
- https://raw.githubusercontent.com/cloudify-incubator/cloudify-utilities-plugin/1.2.5/plugin.yaml
11+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-fabric-plugin/1.5/plugin.yaml
12+
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml
1613
- imports/cloud-config.yaml
14+
- imports/kubernetes.yaml
1715

1816
inputs:
1917

2018
image:
2119
description: Image to be used when launching agent VMs
20+
default: { get_secret: centos_core_image }
2221

2322
flavor:
2423
description: Flavor of the agent VMs
24+
default: { get_secret: large_image_flavor }
2525

2626
agent_user:
2727
description: >
2828
User for connecting to agent VMs
2929
default: centos
3030

31-
encode_cloud_config:
32-
default: false
33-
3431
dsl_definitions:
3532

3633
openstack_config: &openstack_config

‎scripts/cloud_config/create.py‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎scripts/configure_master.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import getpass
77
import subprocess
88
from cloudify import ctx
9+
from cloudify.exceptions import OperationRetry
910

1011

1112
def execute_command(_command):
@@ -39,6 +40,9 @@ def execute_command(_command):
3940

4041
# Start the Kube Master
4142
start_output = execute_command('sudo kubeadm init --skip-preflight-checks')
43+
if isinstance(start_output, bool):
44+
execute_command('sudo kubeadm reset')
45+
raise OperationRetry('Restarting kubernetes because of a problem.')
4246
for line in start_output.split('\n'):
4347
if 'kubeadm join' in line:
4448
ctx.instance.runtime_properties['join_command'] = line.lstrip()
@@ -62,4 +66,4 @@ def execute_command(_command):
6266
execute_command('sudo chmod a+x /usr/local/bin/weave')
6367
execute_command('sudo curl -L git.io/scope -o /usr/local/bin/scope')
6468
execute_command('sudo chmod a+x /usr/local/bin/scope')
65-
execute_command('scope launch')
69+
execute_command('/usr/local/bin/scope launch')

‎scripts/configure_node.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ def execute_command(_command):
4747
execute_command('sudo chmod a+x /usr/local/bin/weave')
4848
execute_command('sudo curl -L git.io/scope -o /usr/local/bin/scope')
4949
execute_command('sudo chmod a+x /usr/local/bin/scope')
50-
execute_command('scope launch')
50+
execute_command('/usr/local/bin/scope launch')

‎types/cloud_config/cloud-config.yaml‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎types/docker.yaml‎

Whitespace-only changes.

0 commit comments

Comments
 (0)