1
+ {
2
+ "$schema" : " https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" ,
3
+ "contentVersion" : " 1.0.0.0" ,
4
+ "parameters" : {
5
+ "clusterName" : {
6
+ "type" : " String" ,
7
+ "defaultValue" : " "
8
+ },
9
+ "lbName" : {
10
+ "type" : " String" ,
11
+ "defaultValue" : " "
12
+ },
13
+ "lbId" : {
14
+ "type" : " String" ,
15
+ "defaultValue" : " "
16
+ }
17
+ },
18
+ "variables" : {},
19
+ "resources" : [
20
+ {
21
+ "type" : " Microsoft.Network/publicIPAddresses" ,
22
+ "name" : " [concat(parameters('clusterName'), '-ip')]" ,
23
+ "apiVersion" : " 2016-03-30" ,
24
+ "location" : " [resourceGroup().location]" ,
25
+ "properties" : {
26
+ "publicIPAllocationMethod" : " Dynamic" ,
27
+ "dnsSettings" : {
28
+ "domainNameLabel" : " [parameters('clusterName')]"
29
+ }
30
+ }
31
+ },
32
+ {
33
+ "type" : " Microsoft.Network/loadBalancers" ,
34
+ "name" : " [parameters('lbName')]" ,
35
+ "apiVersion" : " 2015-06-15" ,
36
+ "location" : " [resourceGroup().location]" ,
37
+ "properties" : {
38
+ "availabilitySet" : {
39
+ "id" : " [resourceId('Microsoft.Compute/availabilitySets', 'postgresHaAvailabilitySet')]"
40
+ },
41
+ "frontendIPConfigurations" : [
42
+ {
43
+ "name" : " loadBalancerFrontEnd" ,
44
+ "properties" : {
45
+ "publicIPAddress" : {
46
+ "id" : " [parameters('ipId')]"
47
+ }
48
+ }
49
+ }
50
+ ],
51
+ "backendAddressPools" : [
52
+ {
53
+ "name" : " loadBalancerBackEnd"
54
+ }
55
+ ],
56
+ "loadBalancingRules" : [
57
+ {
58
+ "name" : " postgresLbRule" ,
59
+ "properties" : {
60
+ "frontendIPConfiguration" : {
61
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
62
+ },
63
+ "backendAddressPool" : {
64
+ "id" : " [concat(parameters('lbId'), '/backendAddressPools/loadBalancerBackEnd')]"
65
+ },
66
+ "protocol" : " Tcp" ,
67
+ "frontendPort" : 5432 ,
68
+ "backendPort" : 5000 ,
69
+ "probe" : {
70
+ "id" : " [concat(parameters('lbId'), '/probes/postgresProbe')]"
71
+ }
72
+ }
73
+ }
74
+ ],
75
+ "probes" : [
76
+ {
77
+ "name" : " postgresProbe" ,
78
+ "properties" : {
79
+ "protocol" : " Tcp" ,
80
+ "port" : 5000 ,
81
+ "intervalInSeconds" : 5 ,
82
+ "numberOfProbes" : 2
83
+ }
84
+ }
85
+ ],
86
+ "inboundNatRules" : [
87
+ {
88
+ "name" : " postgresSsh0" ,
89
+ "properties" : {
90
+ "frontendIPConfiguration" : {
91
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
92
+ },
93
+ "protocol" : " Tcp" ,
94
+ "frontendPort" : 10110 ,
95
+ "backendPort" : 22
96
+ }
97
+ },
98
+ {
99
+ "name" : " postgresSsh1" ,
100
+ "properties" : {
101
+ "frontendIPConfiguration" : {
102
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
103
+ },
104
+ "protocol" : " Tcp" ,
105
+ "frontendPort" : 10111 ,
106
+ "backendPort" : 22
107
+ }
108
+ },
109
+ {
110
+ "name" : " postgresSsh2" ,
111
+ "properties" : {
112
+ "frontendIPConfiguration" : {
113
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
114
+ },
115
+ "protocol" : " Tcp" ,
116
+ "frontendPort" : 10112 ,
117
+ "backendPort" : 22
118
+ }
119
+ },
120
+ {
121
+ "name" : " postgresSsh3" ,
122
+ "properties" : {
123
+ "frontendIPConfiguration" : {
124
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
125
+ },
126
+ "protocol" : " Tcp" ,
127
+ "frontendPort" : 10113 ,
128
+ "backendPort" : 22
129
+ }
130
+ },
131
+ {
132
+ "name" : " postgresSsh4" ,
133
+ "properties" : {
134
+ "frontendIPConfiguration" : {
135
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
136
+ },
137
+ "protocol" : " Tcp" ,
138
+ "frontendPort" : 10114 ,
139
+ "backendPort" : 22
140
+ }
141
+ },
142
+ {
143
+ "name" : " postgresSsh5" ,
144
+ "properties" : {
145
+ "frontendIPConfiguration" : {
146
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
147
+ },
148
+ "protocol" : " Tcp" ,
149
+ "frontendPort" : 10115 ,
150
+ "backendPort" : 22
151
+ }
152
+ },
153
+ {
154
+ "name" : " postgresSsh6" ,
155
+ "properties" : {
156
+ "frontendIPConfiguration" : {
157
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
158
+ },
159
+ "protocol" : " Tcp" ,
160
+ "frontendPort" : 10116 ,
161
+ "backendPort" : 22
162
+ }
163
+ },
164
+ {
165
+ "name" : " postgresSsh7" ,
166
+ "properties" : {
167
+ "frontendIPConfiguration" : {
168
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
169
+ },
170
+ "protocol" : " Tcp" ,
171
+ "frontendPort" : 10117 ,
172
+ "backendPort" : 22
173
+ }
174
+ },
175
+ {
176
+ "name" : " postgresSsh8" ,
177
+ "properties" : {
178
+ "frontendIPConfiguration" : {
179
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
180
+ },
181
+ "protocol" : " Tcp" ,
182
+ "frontendPort" : 10118 ,
183
+ "backendPort" : 22
184
+ }
185
+ },
186
+ {
187
+ "name" : " postgresSsh9" ,
188
+ "properties" : {
189
+ "frontendIPConfiguration" : {
190
+ "id" : " [concat(parameters('lbId'), '/frontendIPConfigurations/loadBalancerFrontEnd')]"
191
+ },
192
+ "protocol" : " Tcp" ,
193
+ "frontendPort" : 10119 ,
194
+ "backendPort" : 22
195
+ }
196
+ }
197
+ ]
198
+ },
199
+ "dependsOn" : [
200
+ " [variables('ipId')]"
201
+ ]
202
+ }
203
+ ]
204
+ }
0 commit comments