Skip to content

Commit

Permalink
Merge pull request #20 from UKCloud/feature/antiAffinityGroups
Browse files Browse the repository at this point in the history
adding servergroups and anti-affinity settings
  • Loading branch information
stevemul authored Sep 21, 2017
2 parents 9c1c0f3 + 6f76859 commit 9f416e0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
21 changes: 21 additions & 0 deletions openshift-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ resources:
user_data_format: SOFTWARE_CONFIG
user_data: { get_resource: install_config_agent }

haproxy-servergroup:
type: OS::Nova::ServerGroup
properties:
name: haproxy-servergroup
policies: [ 'anti-affinity' ]

haproxy_group:
type: OS::Heat::ResourceGroup
depends_on: [ internal_net, bastion_host, haproxy_port ]
Expand All @@ -305,6 +311,13 @@ resources:
- { get_resource: openshift_secgroup }
mgmt_sec_groups:
- { get_resource: openshift_mgmt_secgroup }
server_group: { get_resource: haproxy-servergroup }

master-servergroup:
type: OS::Nova::ServerGroup
properties:
name: master-servergroup
policies: [ 'anti-affinity' ]

master_group:
type: OS::Heat::ResourceGroup
Expand Down Expand Up @@ -332,6 +345,13 @@ resources:
DATA_SIZE=15G
mgmt_sec_groups:
- { get_resource: openshift_mgmt_secgroup }
server_group: { get_resource: master-servergroup }

worker-servergroup:
type: OS::Nova::ServerGroup
properties:
name: worker-servergroup
policies: [ 'anti-affinity' ]

worker_group:
type: OS::Heat::ResourceGroup
Expand Down Expand Up @@ -359,6 +379,7 @@ resources:
DATA_SIZE=40G
mgmt_sec_groups:
- { get_resource: openshift_mgmt_secgroup }
server_group: { get_resource: worker-servergroup }

setup_host_file:
type: OS::Heat::SoftwareConfig
Expand Down
5 changes: 5 additions & 0 deletions server_atomic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ parameters:
description: The contents for /etc/sysconfig/docker-storage-setup
mgmt_sec_groups:
type: json
server_group:
type: string
label: group server belongs to

resources:
resize_lv:
Expand Down Expand Up @@ -81,6 +84,8 @@ resources:
networks:
- network: { get_param: port_network }
- port: { get_resource: mgmt_port }
scheduler_hints:
group: { get_param: server_group }
user_data_format: SOFTWARE_CONFIG
user_data: { get_resource: server_init }

Expand Down
5 changes: 5 additions & 0 deletions server_with_port.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ parameters:
label: RHN user password
description: rhn activation key
hidden: true
server_group:
type: string
label: group server belongs to

resources:
server:
Expand All @@ -51,6 +54,8 @@ resources:
networks:
- port: { get_resource: port }
- port: { get_resource: mgmt_port }
scheduler_hints:
group: { get_param: server_group }
user_data_format: RAW
user_data:
str_replace:
Expand Down

0 comments on commit 9f416e0

Please sign in to comment.