forked from NixOS/nixops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgce-http-health-check.nix
80 lines (66 loc) · 2.12 KB
/
gce-http-health-check.nix
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
{ config, lib, pkgs, uuid, name, ... }:
with lib;
with import ./lib.nix lib;
{
options = (import ./gce-credentials.nix lib "HTTP health check") // {
name = mkOption {
example = "my-health-check";
default = "n-${shorten_uuid uuid}-${name}";
type = types.str;
description = "Description of the GCE HTTP Health Check. This is the <literal>Name</literal> tag of the health check.";
};
description = mkOption {
default = null;
example = "health check for databases";
type = types.nullOr types.str;
description = "An optional textual description of the HTTP Health Check.";
};
host = mkOption {
default = null;
example = "healthcheckhost.org";
type = types.nullOr types.str;
description = ''
The value of the host header in the HTTP health check request.
If left unset(default value), the public IP on behalf of which
this health check is performed will be used.
'';
};
path = mkOption {
default = "/";
example = "/is_healthy";
type = types.str;
description = "The request path of the HTTP health check request.";
};
port = mkOption {
default = 80;
example = 8080;
type = types.int;
description = "The TCP port number for the HTTP health check request.";
};
checkInterval = mkOption {
default = 5;
example = 20;
type = types.int;
description = "How often (in seconds) to send a health check.";
};
timeout = mkOption {
default = 5;
example = 20;
type = types.int;
description = "How long (in seconds) to wait before claiming failure.";
};
unhealthyThreshold = mkOption {
default = 2;
example = 4;
type = types.int;
description = "A so-far healthy VM will be marked unhealthy after this many consecutive failures.";
};
healthyThreshold = mkOption {
default = 2;
example = 4;
type = types.int;
description = "An unhealthy VM will be marked healthy after this many consecutive successes.";
};
};
config._type = "gce-http-health-check";
}