1KUBERNETES(1)(kubernetes)                            KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7

NAME

9       kubectl create ingress - Create an ingress with the specified name.
10
11
12

SYNOPSIS

14       kubectl create ingress [OPTIONS]
15
16
17

DESCRIPTION

19       Create an ingress with the specified name.
20
21
22

OPTIONS

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       --annotation=[]      Annotation to insert in the ingress object, in the
30       format annotation=value
31
32
33       --class=""      Ingress Class to be used
34
35
36       --default-backend=""      Default service for  backend,  in  format  of
37       svcname:port
38
39
40       --dry-run="none"       Must be "none", "server", or "client". If client
41       strategy, only print the object that would be sent, without sending it.
42       If  server  strategy, submit server-side request without persisting the
43       resource.
44
45
46       --field-manager="kubectl-create"      Name of the manager used to track
47       field ownership.
48
49
50       -o,  --output=""       Output  format.  One  of: json|yaml|name|go-tem‐
51       plate|go-template-file|template|templatefile|jsonpath|json‐
52       path-as-json|jsonpath-file.
53
54
55       --rule=[]       Rule in format host/path=service:port[,tls=secretname].
56       Paths containing the leading character '*' are considered pathType=Pre‐
57       fix. tls argument is optional.
58
59
60       --save-config=false       If  true, the configuration of current object
61       will be saved in its annotation. Otherwise, the annotation will be  un‐
62       changed.  This flag is useful when you want to perform kubectl apply on
63       this object in the future.
64
65
66       --show-managed-fields=false      If true, keep the  managedFields  when
67       printing objects in JSON or YAML format.
68
69
70       --template=""      Template string or path to template file to use when
71       -o=go-template, -o=go-template-file. The template format is golang tem‐
72       plates [http://golang.org/pkg/text/template/#pkg-overview].
73
74
75       --validate=true      If true, use a schema to validate the input before
76       sending it
77
78
79

OPTIONS INHERITED FROM PARENT COMMANDS

81       --add-dir-header=false      If true, adds the  file  directory  to  the
82       header of the log messages
83
84
85       --alsologtostderr=false      log to standard error as well as files
86
87
88       --application-metrics-count-limit=100       Max  number  of application
89       metrics to store (per container)
90
91
92       --as=""      Username to impersonate for the operation
93
94
95       --as-group=[]      Group to impersonate for the  operation,  this  flag
96       can be repeated to specify multiple groups.
97
98
99       --azure-container-registry-config=""       Path  to the file containing
100       Azure container registry configuration information.
101
102
103       --boot-id-file="/proc/sys/kernel/random/boot_id"        Comma-separated
104       list of files to check for boot-id. Use the first one that exists.
105
106
107       --cache-dir="/builddir/.kube/cache"      Default cache directory
108
109
110       --certificate-authority=""      Path to a cert file for the certificate
111       authority
112
113
114       --client-certificate=""      Path to a client certificate file for TLS
115
116
117       --client-key=""      Path to a client key file for TLS
118
119
120       --cloud-provider-gce-l7lb-src-cidrs=130.211.0.0/22,35.191.0.0/16
121            CIDRs  opened  in  GCE  firewall  for  L7 LB traffic proxy  health
122       checks
123
124
125       --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
126            CIDRs  opened  in  GCE  firewall  for  L4 LB traffic proxy  health
127       checks
128
129
130       --cluster=""      The name of the kubeconfig cluster to use
131
132
133       --container-hints="/etc/cadvisor/container_hints.json"      location of
134       the container hints file
135
136
137       --containerd="/run/containerd/containerd.sock"      containerd endpoint
138
139
140       --containerd-namespace="k8s.io"      containerd namespace
141
142
143       --context=""      The name of the kubeconfig context to use
144
145
146       --default-not-ready-toleration-seconds=300       Indicates  the tolera‐
147       tionSeconds of the toleration for notReady:NoExecute that is  added  by
148       default to every pod that does not already have such a toleration.
149
150
151       --default-unreachable-toleration-seconds=300      Indicates the tolera‐
152       tionSeconds of the toleration for unreachable:NoExecute that  is  added
153       by default to every pod that does not already have such a toleration.
154
155
156       --disable-root-cgroup-stats=false       Disable  collecting root Cgroup
157       stats
158
159
160       --docker="unix:///var/run/docker.sock"      docker endpoint
161
162
163       --docker-env-metadata-whitelist=""      a comma-separated list of envi‐
164       ronment  variable  keys  matched with specified prefix that needs to be
165       collected for docker containers
166
167
168       --docker-only=false      Only report docker containers in  addition  to
169       root stats
170
171
172       --docker-root="/var/lib/docker"       DEPRECATED:  docker  root is read
173       from docker info (this is a fallback, default: /var/lib/docker)
174
175
176       --docker-tls=false      use TLS to connect to docker
177
178
179       --docker-tls-ca="ca.pem"      path to trusted CA
180
181
182       --docker-tls-cert="cert.pem"      path to client certificate
183
184
185       --docker-tls-key="key.pem"      path to private key
186
187
188       --enable-load-reader=false      Whether to enable cpu load reader
189
190
191       --event-storage-age-limit="default=0"      Max length of time for which
192       to store events (per type). Value is a comma separated list of key val‐
193       ues, where the keys are event types (e.g.: creation, oom) or  "default"
194       and  the  value  is a duration. Default is applied to all non-specified
195       event types
196
197
198       --event-storage-event-limit="default=0"      Max number  of  events  to
199       store  (per type). Value is a comma separated list of key values, where
200       the keys are event types (e.g.: creation, oom)  or  "default"  and  the
201       value  is  an  integer.  Default  is applied to all non-specified event
202       types
203
204
205       --global-housekeeping-interval=1m0s      Interval between global house‐
206       keepings
207
208
209       --housekeeping-interval=10s       Interval between container housekeep‐
210       ings
211
212
213       --insecure-skip-tls-verify=false      If true, the server's certificate
214       will not be checked for validity. This will make your HTTPS connections
215       insecure
216
217
218       --kubeconfig=""      Path to the kubeconfig file to  use  for  CLI  re‐
219       quests.
220
221
222       --log-backtrace-at=:0       when logging hits line file:N, emit a stack
223       trace
224
225
226       --log-cadvisor-usage=false      Whether to log the usage of the  cAdvi‐
227       sor container
228
229
230       --log-dir=""      If non-empty, write log files in this directory
231
232
233       --log-file=""      If non-empty, use this log file
234
235
236       --log-file-max-size=1800       Defines  the maximum size a log file can
237       grow to. Unit is megabytes. If the value is 0, the maximum file size is
238       unlimited.
239
240
241       --log-flush-frequency=5s       Maximum  number  of  seconds between log
242       flushes
243
244
245       --logtostderr=true      log to standard error instead of files
246
247
248       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
249            Comma-separated  list  of  files  to check for machine-id. Use the
250       first one that exists.
251
252
253       --match-server-version=false       Require  server  version  to   match
254       client version
255
256
257       -n,  --namespace=""       If  present, the namespace scope for this CLI
258       request
259
260
261       --one-output=false      If true, only write logs to their native sever‐
262       ity level (vs also writing to each lower severity level)
263
264
265       --password=""      Password for basic authentication to the API server
266
267
268       --profile="none"         Name   of   profile   to   capture.   One   of
269       (none|cpu|heap|goroutine|threadcreate|block|mutex)
270
271
272       --profile-output="profile.pprof"      Name of the  file  to  write  the
273       profile to
274
275
276       --referenced-reset-interval=0       Reset interval for referenced bytes
277       (container_referenced_bytes metric), number of measurement cycles after
278       which  referenced  bytes  are cleared, if set to 0 referenced bytes are
279       never cleared (default: 0)
280
281
282       --request-timeout="0"      The length of time to wait before giving  up
283       on  a  single  server  request. Non-zero values should contain a corre‐
284       sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
285       out requests.
286
287
288       -s, --server=""      The address and port of the Kubernetes API server
289
290
291       --skip-headers=false       If  true,  avoid  header prefixes in the log
292       messages
293
294
295       --skip-log-headers=false      If true, avoid headers when  opening  log
296       files
297
298
299       --stderrthreshold=2      logs at or above this threshold go to stderr
300
301
302       --storage-driver-buffer-duration=1m0s      Writes in the storage driver
303       will be buffered for this duration, and committed  to  the  non  memory
304       backends as a single transaction
305
306
307       --storage-driver-db="cadvisor"      database name
308
309
310       --storage-driver-host="localhost:8086"      database host:port
311
312
313       --storage-driver-password="root"      database password
314
315
316       --storage-driver-secure=false      use secure connection with database
317
318
319       --storage-driver-table="stats"      table name
320
321
322       --storage-driver-user="root"      database username
323
324
325       --tls-server-name=""       Server  name  to  use for server certificate
326       validation. If it is not provided, the hostname  used  to  contact  the
327       server is used
328
329
330       --token=""      Bearer token for authentication to the API server
331
332
333       --update-machine-info-interval=5m0s       Interval between machine info
334       updates.
335
336
337       --user=""      The name of the kubeconfig user to use
338
339
340       --username=""      Username for basic authentication to the API server
341
342
343       -v, --v=0      number for the log level verbosity
344
345
346       --version=false      Print version information and quit
347
348
349       --vmodule=       comma-separated  list  of   pattern=N   settings   for
350       file-filtered logging
351
352
353       --warnings-as-errors=false      Treat warnings received from the server
354       as errors and exit with a non-zero exit code
355
356
357

EXAMPLE

359                # Create a single ingress called 'simple' that directs requests to foo.com/bar to svc
360                # svc1:8080 with a tls secret "my-cert"
361                kubectl create ingress simple --rule="foo.com/bar=svc1:8080,tls=my-cert"
362
363                # Create a catch all ingress of "/path" pointing to service svc:port and Ingress Class as "otheringress"
364                kubectl create ingress catch-all --class=otheringress --rule="/path=svc:port"
365
366                # Create an ingress with two annotations: ingress.annotation1 and ingress.annotations2
367                kubectl create ingress annotated --class=default --rule="foo.com/bar=svc:port" \
368                --annotation ingress.annotation1=foo \
369                --annotation ingress.annotation2=bla
370
371                # Create an ingress with the same host and multiple paths
372                kubectl create ingress multipath --class=default \
373                --rule="foo.com/=svc:port" \
374                --rule="foo.com/admin/=svcadmin:portadmin"
375
376                # Create an ingress with multiple hosts and the pathType as Prefix
377                kubectl create ingress ingress1 --class=default \
378                --rule="foo.com/path*=svc:8080" \
379                --rule="bar.com/admin*=svc2:http"
380
381                # Create an ingress with TLS enabled using the default ingress certificate and different path types
382                kubectl create ingress ingtls --class=default \
383                --rule="foo.com/=svc:https,tls" \
384                --rule="foo.com/path/subpath*=othersvc:8080"
385
386                # Create an ingress with TLS enabled using a specific secret and pathType as Prefix
387                kubectl create ingress ingsecret --class=default \
388                --rule="foo.com/*=svc:8080,tls=secret1"
389
390                # Create an ingress with a default backend
391                kubectl create ingress ingdefault --class=default \
392                --default-backend=defaultsvc:http \
393                --rule="foo.com/*=svc:8080,tls=secret1"
394
395
396
397

SEE ALSO

399       kubectl-create(1),
400
401
402

HISTORY

404       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
405       com)  based  on the kubernetes source material, but hopefully they have
406       been automatically generated since!
407
408
409
410Manuals                              User            KUBERNETES(1)(kubernetes)
Impressum