1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl create cronjob - Create a cronjob with the specified name.
10
11
12
14 kubectl create cronjob [OPTIONS]
15
16
17
19 Create a cronjob with the specified name.
20
21
22
24 --allow-missing-template-keys=true If true, ignore any errors in
25 templates when a field or map key is missing in the template. Only ap‐
26 plies to golang and jsonpath output formats.
27
28
29 --dry-run="none" Must be "none", "server", or "client". If client
30 strategy, only print the object that would be sent, without sending it.
31 If server strategy, submit server-side request without persisting the
32 resource.
33
34
35 --field-manager="kubectl-create" Name of the manager used to track
36 field ownership.
37
38
39 --image="" Image name to run.
40
41
42 -o, --output="" Output format. One of: json|yaml|name|go-tem‐
43 plate|go-template-file|template|templatefile|jsonpath|json‐
44 path-as-json|jsonpath-file.
45
46
47 --restart="" job's restart policy. supported values: OnFailure,
48 Never
49
50
51 --save-config=false If true, the configuration of current object
52 will be saved in its annotation. Otherwise, the annotation will be un‐
53 changed. This flag is useful when you want to perform kubectl apply on
54 this object in the future.
55
56
57 --schedule="" A schedule in the Cron format the job should be run
58 with.
59
60
61 --template="" Template string or path to template file to use when
62 -o=go-template, -o=go-template-file. The template format is golang tem‐
63 plates [http://golang.org/pkg/text/template/#pkg-overview].
64
65
66 --validate=true If true, use a schema to validate the input before
67 sending it
68
69
70
72 --add-dir-header=false If true, adds the file directory to the
73 header of the log messages
74
75
76 --alsologtostderr=false log to standard error as well as files
77
78
79 --application-metrics-count-limit=100 Max number of application
80 metrics to store (per container)
81
82
83 --as="" Username to impersonate for the operation
84
85
86 --as-group=[] Group to impersonate for the operation, this flag
87 can be repeated to specify multiple groups.
88
89
90 --azure-container-registry-config="" Path to the file containing
91 Azure container registry configuration information.
92
93
94 --boot-id-file="/proc/sys/kernel/random/boot_id" Comma-separated
95 list of files to check for boot-id. Use the first one that exists.
96
97
98 --cache-dir="/builddir/.kube/cache" Default cache directory
99
100
101 --certificate-authority="" Path to a cert file for the certificate
102 authority
103
104
105 --client-certificate="" Path to a client certificate file for TLS
106
107
108 --client-key="" Path to a client key file for TLS
109
110
111 --cloud-provider-gce-l7lb-src-cidrs=130.211.0.0/22,35.191.0.0/16
112 CIDRs opened in GCE firewall for L7 LB traffic proxy health
113 checks
114
115
116 --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
117 CIDRs opened in GCE firewall for L4 LB traffic proxy health
118 checks
119
120
121 --cluster="" The name of the kubeconfig cluster to use
122
123
124 --container-hints="/etc/cadvisor/container_hints.json" location of
125 the container hints file
126
127
128 --containerd="/run/containerd/containerd.sock" containerd endpoint
129
130
131 --containerd-namespace="k8s.io" containerd namespace
132
133
134 --context="" The name of the kubeconfig context to use
135
136
137 --default-not-ready-toleration-seconds=300 Indicates the tolera‐
138 tionSeconds of the toleration for notReady:NoExecute that is added by
139 default to every pod that does not already have such a toleration.
140
141
142 --default-unreachable-toleration-seconds=300 Indicates the tolera‐
143 tionSeconds of the toleration for unreachable:NoExecute that is added
144 by default to every pod that does not already have such a toleration.
145
146
147 --disable-root-cgroup-stats=false Disable collecting root Cgroup
148 stats
149
150
151 --docker="unix:///var/run/docker.sock" docker endpoint
152
153
154 --docker-env-metadata-whitelist="" a comma-separated list of envi‐
155 ronment variable keys matched with specified prefix that needs to be
156 collected for docker containers
157
158
159 --docker-only=false Only report docker containers in addition to
160 root stats
161
162
163 --docker-root="/var/lib/docker" DEPRECATED: docker root is read
164 from docker info (this is a fallback, default: /var/lib/docker)
165
166
167 --docker-tls=false use TLS to connect to docker
168
169
170 --docker-tls-ca="ca.pem" path to trusted CA
171
172
173 --docker-tls-cert="cert.pem" path to client certificate
174
175
176 --docker-tls-key="key.pem" path to private key
177
178
179 --enable-load-reader=false Whether to enable cpu load reader
180
181
182 --event-storage-age-limit="default=0" Max length of time for which
183 to store events (per type). Value is a comma separated list of key val‐
184 ues, where the keys are event types (e.g.: creation, oom) or "default"
185 and the value is a duration. Default is applied to all non-specified
186 event types
187
188
189 --event-storage-event-limit="default=0" Max number of events to
190 store (per type). Value is a comma separated list of key values, where
191 the keys are event types (e.g.: creation, oom) or "default" and the
192 value is an integer. Default is applied to all non-specified event
193 types
194
195
196 --global-housekeeping-interval=1m0s Interval between global house‐
197 keepings
198
199
200 --housekeeping-interval=10s Interval between container housekeep‐
201 ings
202
203
204 --insecure-skip-tls-verify=false If true, the server's certificate
205 will not be checked for validity. This will make your HTTPS connections
206 insecure
207
208
209 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
210 quests.
211
212
213 --log-backtrace-at=:0 when logging hits line file:N, emit a stack
214 trace
215
216
217 --log-cadvisor-usage=false Whether to log the usage of the cAdvi‐
218 sor container
219
220
221 --log-dir="" If non-empty, write log files in this directory
222
223
224 --log-file="" If non-empty, use this log file
225
226
227 --log-file-max-size=1800 Defines the maximum size a log file can
228 grow to. Unit is megabytes. If the value is 0, the maximum file size is
229 unlimited.
230
231
232 --log-flush-frequency=5s Maximum number of seconds between log
233 flushes
234
235
236 --logtostderr=true log to standard error instead of files
237
238
239 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
240 Comma-separated list of files to check for machine-id. Use the
241 first one that exists.
242
243
244 --match-server-version=false Require server version to match
245 client version
246
247
248 -n, --namespace="" If present, the namespace scope for this CLI
249 request
250
251
252 --one-output=false If true, only write logs to their native sever‐
253 ity level (vs also writing to each lower severity level
254
255
256 --password="" Password for basic authentication to the API server
257
258
259 --profile="none" Name of profile to capture. One of
260 (none|cpu|heap|goroutine|threadcreate|block|mutex)
261
262
263 --profile-output="profile.pprof" Name of the file to write the
264 profile to
265
266
267 --referenced-reset-interval=0 Reset interval for referenced bytes
268 (container_referenced_bytes metric), number of measurement cycles after
269 which referenced bytes are cleared, if set to 0 referenced bytes are
270 never cleared (default: 0)
271
272
273 --request-timeout="0" The length of time to wait before giving up
274 on a single server request. Non-zero values should contain a corre‐
275 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
276 out requests.
277
278
279 -s, --server="" The address and port of the Kubernetes API server
280
281
282 --skip-headers=false If true, avoid header prefixes in the log
283 messages
284
285
286 --skip-log-headers=false If true, avoid headers when opening log
287 files
288
289
290 --stderrthreshold=2 logs at or above this threshold go to stderr
291
292
293 --storage-driver-buffer-duration=1m0s Writes in the storage driver
294 will be buffered for this duration, and committed to the non memory
295 backends as a single transaction
296
297
298 --storage-driver-db="cadvisor" database name
299
300
301 --storage-driver-host="localhost:8086" database host:port
302
303
304 --storage-driver-password="root" database password
305
306
307 --storage-driver-secure=false use secure connection with database
308
309
310 --storage-driver-table="stats" table name
311
312
313 --storage-driver-user="root" database username
314
315
316 --tls-server-name="" Server name to use for server certificate
317 validation. If it is not provided, the hostname used to contact the
318 server is used
319
320
321 --token="" Bearer token for authentication to the API server
322
323
324 --update-machine-info-interval=5m0s Interval between machine info
325 updates.
326
327
328 --user="" The name of the kubeconfig user to use
329
330
331 --username="" Username for basic authentication to the API server
332
333
334 -v, --v=0 number for the log level verbosity
335
336
337 --version=false Print version information and quit
338
339
340 --vmodule= comma-separated list of pattern=N settings for
341 file-filtered logging
342
343
344 --warnings-as-errors=false Treat warnings received from the server
345 as errors and exit with a non-zero exit code
346
347
348
350 # Create a cronjob
351 kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *"
352
353 # Create a cronjob with command
354 kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date
355
356
357
358
360 kubectl-create(1),
361
362
363
365 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
366 com) based on the kubernetes source material, but hopefully they have
367 been automatically generated since!
368
369
370
371Manuals User KUBERNETES(1)(kubernetes)