You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/networkLoadBalancerUpdate.go
+120-6Lines changed: 120 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -22,18 +22,82 @@ import (
22
22
23
23
"github.com/spf13/cast"
24
24
"github.com/spf13/cobra"
25
+
"gopkg.in/yaml.v2"
25
26
27
+
"github.com/liquidweb/liquidweb-cli/instance"
26
28
"github.com/liquidweb/liquidweb-cli/types/api"
29
+
"github.com/liquidweb/liquidweb-cli/types/cmd"
27
30
"github.com/liquidweb/liquidweb-cli/validate"
28
31
)
29
32
30
33
varnetworkLoadBalancerUpdateNodesCmd []string
31
34
varnetworkLoadBalancerUpdateServicesCmd []string
35
+
varhealthChecksMapUpdatemap[string]string
36
+
varnetworkLoadBalancerServicesHealthChecksHelp=`--services flag values are ',' delimited. Each value should be in format:
37
+
38
+
'sourcePort:destinationPort',
39
+
40
+
such as '80:80,443:443'.
41
+
42
+
--health-check flag values represent custom health check paramaters for a service on a Load Balancer. Valid health check parameters:
43
+
44
+
failure_threshold -> int // permissible failures before node is taken out of services pool (default 3)
45
+
http_body_match -> string // when protocol is http, the string to look for in the http body to determine if health is ok (default unset)
46
+
http_path -> string // when protocol is http, the http path to hit when performing a health check (default /)
47
+
http_response_codes -> string // when protocol is http, http response codes to consider "success" when performing a health check (default 200-206:300-304)
48
+
http_use_tls -> "bool" // when protocol is http, uses https when "true" for health check (default false)
49
+
interval -> int // time duration between health checks (default 30)
Notice the leading '443_' before the parameter name. To create a health check for service 80 as well, follow the same pattern, but
58
+
replacing '443_' with '80_'.`
59
+
varnetworkLoadBalancerServicesHealthCheckFileHelp=`--health-check-file value should be the path to a yaml file containing the health check(s) to apply for each service(s). Here is
60
+
an example of how that file should look:
61
+
62
+
443:
63
+
protocol: http
64
+
timeout: 5
65
+
interval: 10
66
+
http_use_tls: true
67
+
http_response_codes: 200-202,404
68
+
http_path: /status-443
69
+
http_body_match:
70
+
failure_threshold: 3
71
+
80:
72
+
protocol: http
73
+
timeout: 10
74
+
interval: 20
75
+
http_use_tls: false
76
+
http_response_codes: 200-202,404
77
+
http_path: /status-80
78
+
http_body_match:
79
+
failure_threshold: 3
80
+
81
+
It is an error to provide both --health-check and --health-check-file flags.`
32
82
33
83
varnetworkLoadBalancerUpdateCmd=&cobra.Command{
34
84
Use: "update",
35
85
Short: "Change configuration of an existing Load Balancer",
36
-
Long: `Change configuration of an existing Load Balancer`,
86
+
Long: fmt.Sprintf(`Change configuration of an existing Load Balancer
87
+
88
+
A Load Balancer allows you to distribute traffic to multiple endpoints.
89
+
90
+
%s
91
+
92
+
%s
93
+
94
+
To remove a health check from a service, simply call update for the service(s) omitting their --health-check entries. For example,
95
+
this would remove any set health checks for services 443:443,80:80 (as well as remove any other services entirely):
0 commit comments