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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
[root@controller heat(keystone_fulladmin)]$ more deploy-lb.yaml description: > This heat template demonstrates a basic load-balancing scenario on an F5 Device. heat_template_version: 2016-04-08 parameters: bigip_un: description: BigIP Username label: BigIP Login Username type: string default: admin bigip_pw: description: BigIP Password label: BigIP Login Password type: string hidden: True vs_name: description: Virtual Server Name label: Virtual Server Name type: string default: virtual_server1 pool_name: description: Pool Name label: Pool Name type: string default: pool1 bigip_fip: description: BigIP Floating IP label: BigIP FIP type: string vs_vip: description: Virtual Server Virtual IP label: Virtual Server VIP type: string vs_port: description: Virtual Server Port label: Virtual Server Port type: number default: 443 pool_member_port: description: Pool Member Port label: Pool Member Port type: number default: 8080 parameter_groups: - label: BigIP Parameters parameters: - bigip_fip - bigip_un - bigip_pw - label: Load Balancing Parameters parameters: - vs_name - vs_vip - vs_port - pool_name - pool_member_port resources: bigip: type: F5::BigIP::Device properties: ip: { get_param: bigip_fip } username: { get_param: bigip_un } password: { get_param: bigip_pw } partition: type: F5::Sys::Partition depends_on: bigip properties: name: Common bigip_server: { get_resource: bigip } iapp_service: type: F5::Sys::iAppService depends_on: iapp_template properties: name: lb_service bigip_server: { get_resource: bigip } partition: { get_resource: partition } template_name: alb_templ traffic_group: /Common/traffic-group-local-only iapp_template: type: F5::Sys::iAppCompositeTemplate depends_on: partition properties: name: alb_templ bigip_server: { get_resource: bigip } partition: { get_resource: partition } requires_modules: [ ltm ] implementation: str_replace: params: __partition__: Common __pool_name__: { get_param: pool_name } __vs_name__: { get_param: vs_name } __vip__: { get_param: vs_vip } __vs_port__: { get_param: vs_port } __rs_port__: { get_param: pool_member_port } __rs_ip__: 11.0.0.10 template: | tmsh::create { ltm pool /__partition__/__pool_name__ load-balancing-mode least-connections-node members replace-all-with { __rs_ip__:__rs_port__ { address __rs_ip__ } } } tmsh::create { ltm virtual /__partition__/__vs_name__ connection-limit 1 destination /__partition__/__vip__:__vs_port__ mask 255.255.255.255 pool /__partition__/__pool_name__ profiles replace-all-with { /Common/clientssl { context clientside } } source 0.0.0.0/0 source-address-translation { type automap } translate-address enabled translate-port enabled vlans replace-all-with { /Common/external } vlans-enabled } tmsh::create { ltm virtual-address /__partition__/__vip__ address __vip__ arp enabled icmp-echo enabled mask 255.255.255.255 traffic-group traffic-group-1 } presentation: | section say_hello { message intro "This template deploys a virtual server and a pool with two members." } |
1 2 3 4 5 6 7 8 9 10 |
[root@controller heat(keystone_fulladmin)]$ cat deploy-lb-params.yaml parameters: bigip_un: admin bigip_pw: admin vs_name: virtual_server_heat pool_name: pool_heat bigip_fip: 192.168.214.253 vs_vip: 6.7.8.9 vs_port: 443 pool_member_port: 8080 |
openstack stack create -t deploy-lb.yaml -e deploy-lb-params.yaml f5-heat-stack
文章评论