1OC SET(1)                          June 2016                         OC SET(1)
2
3
4

NAME

6       oc  set deployment-hook - Update a deployment hook on a deployment con‐
7       fig
8
9
10

SYNOPSIS

12       oc set deployment-hook [OPTIONS]
13
14
15

DESCRIPTION

17       Set or remove a deployment hook on a deployment config
18
19
20       Deployment configs allow hooks to execute at different  points  in  the
21       lifecycle of the deployment, depending on the deployment strategy.
22
23
24       For deployments with a Recreate strategy, a Pre, Mid, and Post hook can
25       be specified. The Pre hook will execute before the  deployment  starts.
26       The  Mid hook will execute once the previous deployment has been scaled
27       down to 0, but before the new one ramps up. The Post hook will  execute
28       once the deployment has completed.
29
30
31       For  deployments  with  a  Rolling strategy, a Pre and Post hook can be
32       specified. The Pre hook will execute before the deployment  starts  and
33       the Post hook will execute once the deployment has completed.
34
35
36       For each hook, a new pod will be started using one of the containers in
37       the deployment's pod template with a specific command to execute. Addi‐
38       tional  environment variables may be specified for the hook, as well as
39       which volumes from the pod template will be mounted on the hook pod.
40
41
42       Each hook can have its own cancellation policy. One of:  abort,  retry,
43       or  ignore.  Not all cancellation policies can be set on all hooks. For
44       example, a Post hook on a rolling strategy does not support  the  abort
45       policy, because at that point the deployment has already happened.
46
47
48

OPTIONS

50       --all=false
51           If true, select all deployment configs in the namespace
52
53
54       --allow-missing-template-keys=true
55           If  true, ignore any errors in templates when a field or map key is
56       missing in the template. Only applies to  golang  and  jsonpath  output
57       formats.
58
59
60       -c, --container=""
61           The  name of the container in the selected deployment config to use
62       for the deployment hook
63
64
65       --dry-run=false
66           If true, only print the object that would be sent, without  sending
67       it.
68
69
70       -e, --environment=[]
71           Environment variable to use in the deployment hook pod
72
73
74       --failure-policy="ignore"
75           The  failure  policy  for  the  deployment  hook. Valid values are:
76       abort,retry,ignore
77
78
79       -f, --filename=[]
80           Filename, directory, or URL to files to use to edit the resource
81
82
83       --local=false
84           If true, set deployment hook will NOT contact  api-server  but  run
85       locally.
86
87
88       --mid=false
89           Set or remove a mid deployment hook
90
91
92       -o, --output=""
93           Output  format. One of: json|yaml|name|template|go-template|go-tem‐
94       plate-file|templatefile|jsonpath|jsonpath-file.
95
96
97       --post=false
98           Set or remove a post deployment hook
99
100
101       --pre=false
102           Set or remove a pre deployment hook
103
104
105       -R, --recursive=false
106           Process the directory used in -f,  --filename  recursively.  Useful
107       when  you  want  to  manage related manifests organized within the same
108       directory.
109
110
111       --remove=false
112           If true, remove the specified deployment hook(s).
113
114
115       -l, --selector=""
116           Selector (label query) to filter deployment configs
117
118
119       --template=""
120           Template string or path to template file  to  use  when  -o=go-tem‐
121       plate,  -o=go-template-file.  The template format is golang templates [
122http://golang.org/pkg/text/template/#pkg-overview⟩].
123
124
125       --volumes=[]
126           Volumes from the pod template to use in the deployment hook pod
127
128
129

OPTIONS INHERITED FROM PARENT COMMANDS

131       --allow_verification_with_non_compliant_keys=false
132           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
133       non-compliant with RFC6962.
134
135
136       --alsologtostderr=false
137           log to standard error as well as files
138
139
140       --application_metrics_count_limit=100
141           Max number of application metrics to store (per container)
142
143
144       --as=""
145           Username to impersonate for the operation
146
147
148       --as-group=[]
149           Group  to  impersonate for the operation, this flag can be repeated
150       to specify multiple groups.
151
152
153       --azure-container-registry-config=""
154           Path to the file containing Azure container registry  configuration
155       information.
156
157
158       --boot_id_file="/proc/sys/kernel/random/boot_id"
159           Comma-separated  list  of files to check for boot-id. Use the first
160       one that exists.
161
162
163       --cache-dir="/builddir/.kube/http-cache"
164           Default HTTP cache directory
165
166
167       --certificate-authority=""
168           Path to a cert file for the certificate authority
169
170
171       --client-certificate=""
172           Path to a client certificate file for TLS
173
174
175       --client-key=""
176           Path to a client key file for TLS
177
178
179       --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
180           CIDRs opened in GCE firewall for LB traffic proxy  health checks
181
182
183       --cluster=""
184           The name of the kubeconfig cluster to use
185
186
187       --container_hints="/etc/cadvisor/container_hints.json"
188           location of the container hints file
189
190
191       --containerd="unix:///var/run/containerd.sock"
192           containerd endpoint
193
194
195       --context=""
196           The name of the kubeconfig context to use
197
198
199       --default-not-ready-toleration-seconds=300
200           Indicates    the    tolerationSeconds   of   the   toleration   for
201       notReady:NoExecute that is added by default to every pod that does  not
202       already have such a toleration.
203
204
205       --default-unreachable-toleration-seconds=300
206           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
207       able:NoExecute that is added by default to  every  pod  that  does  not
208       already have such a toleration.
209
210
211       --docker="unix:///var/run/docker.sock"
212           docker endpoint
213
214
215       --docker-tls=false
216           use TLS to connect to docker
217
218
219       --docker-tls-ca="ca.pem"
220           path to trusted CA
221
222
223       --docker-tls-cert="cert.pem"
224           path to client certificate
225
226
227       --docker-tls-key="key.pem"
228           path to private key
229
230
231       --docker_env_metadata_whitelist=""
232           a  comma-separated  list of environment variable keys that needs to
233       be collected for docker containers
234
235
236       --docker_only=false
237           Only report docker containers in addition to root stats
238
239
240       --docker_root="/var/lib/docker"
241           DEPRECATED: docker root is read from docker info (this is  a  fall‐
242       back, default: /var/lib/docker)
243
244
245       --enable_load_reader=false
246           Whether to enable cpu load reader
247
248
249       --event_storage_age_limit="default=24h"
250           Max length of time for which to store events (per type). Value is a
251       comma separated list of key values, where  the  keys  are  event  types
252       (e.g.: creation, oom) or "default" and the value is a duration. Default
253       is applied to all non-specified event types
254
255
256       --event_storage_event_limit="default=100000"
257           Max number of events to store (per type). Value is  a  comma  sepa‐
258       rated  list  of  key values, where the keys are event types (e.g.: cre‐
259       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
260       applied to all non-specified event types
261
262
263       --global_housekeeping_interval=0
264           Interval between global housekeepings
265
266
267       --housekeeping_interval=0
268           Interval between container housekeepings
269
270
271       --httptest.serve=""
272           if non-empty, httptest.NewServer serves on this address and blocks
273
274
275       --insecure-skip-tls-verify=false
276           If true, the server's certificate will not be checked for validity.
277       This will make your HTTPS connections insecure
278
279
280       --kubeconfig=""
281           Path to the kubeconfig file to use for CLI requests.
282
283
284       --log-flush-frequency=0
285           Maximum number of seconds between log flushes
286
287
288       --log_backtrace_at=:0
289           when logging hits line file:N, emit a stack trace
290
291
292       --log_cadvisor_usage=false
293           Whether to log the usage of the cAdvisor container
294
295
296       --log_dir=""
297           If non-empty, write log files in this directory
298
299
300       --logtostderr=true
301           log to standard error instead of files
302
303
304       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
305           Comma-separated list of files to  check  for  machine-id.  Use  the
306       first one that exists.
307
308
309       --match-server-version=false
310           Require server version to match client version
311
312
313       -n, --namespace=""
314           If present, the namespace scope for this CLI request
315
316
317       --request-timeout="0"
318           The  length  of  time  to  wait before giving up on a single server
319       request. Non-zero values should contain a corresponding time unit (e.g.
320       1s, 2m, 3h). A value of zero means don't timeout requests.
321
322
323       -s, --server=""
324           The address and port of the Kubernetes API server
325
326
327       --stderrthreshold=2
328           logs at or above this threshold go to stderr
329
330
331       --storage_driver_buffer_duration=0
332           Writes  in  the  storage driver will be buffered for this duration,
333       and committed to the non memory backends as a single transaction
334
335
336       --storage_driver_db="cadvisor"
337           database name
338
339
340       --storage_driver_host="localhost:8086"
341           database host:port
342
343
344       --storage_driver_password="root"
345           database password
346
347
348       --storage_driver_secure=false
349           use secure connection with database
350
351
352       --storage_driver_table="stats"
353           table name
354
355
356       --storage_driver_user="root"
357           database username
358
359
360       --token=""
361           Bearer token for authentication to the API server
362
363
364       --user=""
365           The name of the kubeconfig user to use
366
367
368       -v, --v=0
369           log level for V logs
370
371
372       --version=false
373           Print version information and quit
374
375
376       --vmodule=
377           comma-separated list of pattern=N settings for  file-filtered  log‐
378       ging
379
380
381

EXAMPLE

383                # Clear pre and post hooks on a deployment config
384                oc set deployment-hook dc/myapp --remove --pre --post
385
386                # Set the pre deployment hook to execute a db migration command for an application
387                # using the data volume from the application
388                oc set deployment-hook dc/myapp --pre --volumes=data -- /var/lib/migrate-db.sh
389
390                # Set a mid deployment hook along with additional environment variables
391                oc set deployment-hook dc/myapp --mid --volumes=data -e VAR1=value1 -e VAR2=value2 -- /var/lib/prepare-deploy.sh
392
393
394
395

SEE ALSO

397       oc-set(1),
398
399
400

HISTORY

402       June 2016, Ported from the Kubernetes man-doc generator
403
404
405
406Openshift                  Openshift CLI User Manuals                OC SET(1)
Impressum