Enabling helm3 & kubernetes 1.18 for RIC
[it/dep.git] / tools / k8s / heat / parts / part-2-v6.yaml
1   ${VM_TYPE}_${VM_NUM}_private_port:
2     type: OS::Neutron::Port
3     properties:
4       network: { get_resource: int_network }
5       fixed_ips: [{"subnet": { get_resource: int_subnet }}]
6       security_groups:
7       - { get_resource: ric_sg }
8
9   ${VM_TYPE}_${VM_NUM}_ipv6_port:
10     type: OS::Neutron::Port
11     properties:
12       network_id: { get_param: public_v6net_id }
13       security_groups:
14       - { get_resource: ric_sg }
15
16   ${VM_TYPE}_${VM_NUM}_floating_ip:
17     type: OS::Neutron::FloatingIP
18     properties:
19       floating_network_id: { get_param: public_net_id }
20       port_id: { get_resource: ${VM_TYPE}_${VM_NUM}_private_port }
21
22   ${VM_TYPE}_${VM_NUM}_vm_scripts:
23     type: OS::Heat::CloudConfig
24     properties:
25       cloud_config:
26         power_state:
27           mode: reboot
28         runcmd:
29         - [ /opt/k8s_vm_install.sh ]
30         write_files:
31         - path: /opt/k8s_vm_install.sh
32           permissions: '0755'
33           content:
34             str_replace:
35               params:
36                 __docker_proxy__: { get_param: docker_proxy }
37                 __apt_proxy__: { get_param: apt_proxy }
38                 __docker_version__: { get_param: docker_version }
39                 __k8s_version__: { get_param: k8s_version }
40                 __k8s_cni_version__: { get_param: k8s_cni_version }
41                 __helm_version__: { get_param: helm_version }
42                 __host_private_ip_addr__: { get_attr: [${VM_TYPE}_${VM_NUM}_floating_ip, fixed_ip_address] }
43                 __host_floating_ip_addr__: { get_attr: [${VM_TYPE}_${VM_NUM}_floating_ip, floating_ip_address] }
44                 __host_private_ipv6_addr__: { get_attr: [${VM_TYPE}_${VM_NUM}_ipv6_port, fixed_ips, 0, ip_address ] }
45                 __k8s_mst_floating_ip_addr__: { get_attr: [${VM_TYPE}_mst_floating_ip, floating_ip_address] }
46                 __k8s_mst_private_ip_addr__: { get_attr: [${VM_TYPE}_mst_floating_ip, fixed_ip_address] }
47                 __k8s_mst_parivate_ipv6_addr__: { get_attr: [${VM_TYPE}_mst_ipv6_port, fixed_ips, 0, ip_address] }
48                 __mtu__: { get_param: mtu }
49                 __cinder_volume_id__: { get_resource: cinder_volume }
50                 __stack_name__: { get_param: 'OS::stack_name' }
51               template:
52                 get_file: k8s_vm_install.sh
53         - path: /opt/k8s_vm_init.sh
54           permissions: '0755'
55           content:
56             str_replace:
57               params:
58                 __host_private_ip_addr__: { get_attr: [${VM_TYPE}_${VM_NUM}_floating_ip, fixed_ip_address] }
59                 __host_label__: '$HOST_LABEL'
60               template:
61                 get_file: k8s_vm_init.sh
62         - path: /opt/k8s_vm_aux_install.sh
63           permissions: '0755'
64           content:
65             str_replace:
66               params:
67                 __host_label__: '$HOST_LABEL'
68               template:
69                 get_file: k8s_vm_aux_install.sh
70
71         - path: /opt/k8s_vm_custom_repos.sh
72           permissions: '0755'
73           content:
74             str_replace:
75               params:
76                 __host_label__: '$HOST_LABEL'
77               template:
78                 get_file: k8s_vm_custom_repos.sh
79
80         - path: /etc/init.d/k8s_vm_init_serv
81           permissions: '0755'
82           content:
83             get_file: k8s_vm_init_serv.sh
84        
85
86   ${VM_TYPE}_${VM_NUM}_vm_config:
87     type: OS::Heat::MultipartMime
88     properties:
89       parts:
90       - config: { get_resource: ${VM_TYPE}_${VM_NUM}_vm_scripts }
91
92   ${VM_TYPE}_${VM_NUM}_vm:
93     type: OS::Nova::Server
94     properties:
95       name:
96         list_join: ['-', [ { get_param: 'OS::stack_name' }, '${VM_TYPE}', '${VM_NUM}' ] ]
97       image: { get_param: ubuntu_1604_image }
98       flavor: { get_param: ${VM_TYPE}_vm_flavor }
99       key_name: { get_param: key_name }
100       networks:
101       - port: { get_resource: ${VM_TYPE}_${VM_NUM}_private_port }
102       - port: { get_resource: ${VM_TYPE}_${VM_NUM}_ipv6_port }
103       user_data_format: SOFTWARE_CONFIG
104       user_data: { get_resource: ${VM_TYPE}_${VM_NUM}_vm_config }
105