tacker/samples/mgmt_driver/kubernetes_vnf_package/BaseHOT/podaffinity/podaffinity_hot_top.yaml

96 lines
2.6 KiB
YAML

heat_template_version: 2013-05-23
description: 'Simple Base HOT for Sample VNF'
parameters:
nfv:
type: json
k8s_worker_node_group:
type: string
description: Name of the ServerGroup
default: ServerGroupWorker
k8s_master_node_group:
type: string
description: Name of the ServerGroup
default: ServerGroupMaster
resources:
srvgroup_worker:
type: OS::Nova::ServerGroup
properties:
name: { get_param: k8s_worker_node_group }
policies: [ 'anti-affinity' ]
srvgroup_master:
type: OS::Nova::ServerGroup
properties:
name: { get_param: k8s_master_node_group }
policies: [ 'anti-affinity' ]
master_instance:
type: OS::Heat::AutoScalingGroup
properties:
min_size: 3
max_size: 5
desired_capacity: 3
resource:
type: podaffinity_nested_master.yaml
properties:
flavor: { get_param: [ nfv, VDU, masterNode, flavor ] }
image: { get_param: [ nfv, VDU, masterNode, image ] }
net1: { get_param: [ nfv, CP, masterNode_CP1, network ] }
scheduler_hints: { get_resource: srvgroup_master }
vip_port_ip: { get_attr: [vip_CP, fixed_ips, 0, ip_address] }
master_instance_scale_out:
type: OS::Heat::ScalingPolicy
properties:
scaling_adjustment: 1
auto_scaling_group_id:
get_resource: master_instance
adjustment_type: change_in_capacity
master_instance_scale_in:
type: OS::Heat::ScalingPolicy
properties:
scaling_adjustment: -1
auto_scaling_group_id:
get_resource: master_instance
adjustment_type: change_in_capacity
worker_instance:
type: OS::Heat::AutoScalingGroup
properties:
min_size: 2
max_size: 4
desired_capacity: 2
resource:
type: podaffinity_nested_worker.yaml
properties:
flavor: { get_param: [ nfv, VDU, workerNode, flavor ] }
image: { get_param: [ nfv, VDU, workerNode, image ] }
net1: { get_param: [ nfv, CP, workerNode_CP2, network ] }
scheduler_hints: { get_resource: srvgroup_worker }
worker_instance_scale_out:
type: OS::Heat::ScalingPolicy
properties:
scaling_adjustment: 1
auto_scaling_group_id:
get_resource: worker_instance
adjustment_type: change_in_capacity
worker_instance_scale_in:
type: OS::Heat::ScalingPolicy
properties:
scaling_adjustment: -1
auto_scaling_group_id:
get_resource: worker_instance
adjustment_type: change_in_capacity
vip_CP:
type: OS::Neutron::Port
properties:
network: net0
outputs: {}