1OCF_HEARTBEAT_DOCKER(7) OCF resource agents OCF_HEARTBEAT_DOCKER(7)
2
3
4
6 ocf_heartbeat_docker - Docker container resource agent.
7
9 docker [start | stop | monitor | meta-data | validate-all]
10
12 The docker HA resource agent creates and launches a docker container
13 based off a supplied docker image. Containers managed by this agent are
14 both created and removed upon the agent's start and stop actions.
15
17 image
18 The docker image to base this container off of.
19
20 (required, string, no default)
21
22 name
23 The name to give the created container. By default this will be
24 that resource's instance name.
25
26 (optional, string, no default)
27
28 allow_pull
29 Allow the image to be pulled from the configured docker registry
30 when the image does not exist locally. NOTE, this can drastically
31 increase the time required to start the container if the image
32 repository is pulled over the network.
33
34 (optional, boolean, no default)
35
36 run_opts
37 Add options to be appended to the 'docker run' command which is
38 used when creating the container during the start action. This
39 option allows users to do things such as setting a custom entry
40 point and injecting environment variables into the newly created
41 container. Note the '-d' option is supplied regardless of this
42 value to force containers to run in the background.
43
44 NOTE: Do not explicitly specify the --name argument in the
45 run_opts. This agent will set --name using either the resource's
46 instance or the name provided in the 'name' argument of this agent.
47
48 (optional, string, no default)
49
50 run_cmd
51 Specify a command to launch within the container once it has
52 initialized.
53
54 (optional, string, no default)
55
56 mount_points
57 A comma separated list of directories that the container is
58 expecting to use. The agent will ensure they exist by running
59 'mkdir -p'
60
61 (optional, string, no default)
62
63 monitor_cmd
64 Specify the full path of a command to launch within the container
65 to check the health of the container. This command must return 0 to
66 indicate that the container is healthy. A non-zero return code will
67 indicate that the container has failed and should be recovered.
68
69 If 'docker exec' is supported, it is used to execute the command.
70 If not, nsenter is used.
71
72 Note: Using this method for monitoring processes inside a container
73 is not recommended, as containerd tries to track processes running
74 inside the container and does not deal well with many short-lived
75 processes being spawned. Ensure that your container monitors its
76 own processes and terminates on fatal error rather than invoking a
77 command from the outside.
78
79 (optional, string, no default)
80
81 force_kill
82 Kill a container immediately rather than waiting for it to
83 gracefully shutdown
84
85 (optional, boolean, no default)
86
87 reuse
88 Allow the container to be reused once it is stopped. By default,
89 containers get removed once they are stopped. Enable this option to
90 have the particular one persist when this happens.
91
92 (optional, boolean, default 0)
93
94 query_docker_health
95 Query the builtin healthcheck of docker (v1.12+) to determine
96 health of the container. If left empty or set to false it will not
97 be used.
98
99 The healthcheck itself has to be configured within docker, e.g. via
100 HEALTHCHECK in Dockerfile. This option just queries in what
101 condition docker considers the container to be and lets ocf do its
102 thing accordingly.
103
104 Note that the time a container is in "starting" state counts
105 against the monitor timeout.
106
107 This is an additional check besides the standard check for the
108 container to be running, and the optional monitor_cmd check. It
109 doesn't disable or override them, so all of them (if used) have to
110 come back healthy for the container to be considered healthy.
111
112 (optional, boolean, no default)
113
115 This resource agent supports the following actions (operations):
116
117 start
118 Starts the resource. Suggested minimum timeout: 90s.
119
120 stop
121 Stops the resource. Suggested minimum timeout: 90s.
122
123 monitor
124 Performs a detailed status check. Suggested minimum timeout: 30s.
125 Suggested interval: 30s.
126
127 meta-data
128 Retrieves resource agent metadata (internal use only). Suggested
129 minimum timeout: 5s.
130
131 validate-all
132 Performs a validation of the resource configuration. Suggested
133 minimum timeout: 30s.
134
136 The following is an example configuration for a docker resource using
137 the crm(8) shell:
138
139 primitive p_docker ocf:heartbeat:docker \
140 params \
141 image=string \
142 op monitor timeout="30s" interval="30s" depth="0"
143
145 The following is an example configuration for a docker resource using
146 pcs(8)
147
148 pcs resource create p_docker ocf:heartbeat:docker \
149 image=string \
150 op monitor timeout="30s" interval="30s" depth="0"
151
153 http://clusterlabs.org/
154
156 ClusterLabs contributors (see the resource agent source for information
157 about individual authors)
158
159
160
161resource-agents UNKNOWN 03/09/2020 OCF_HEARTBEAT_DOCKER(7)