1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl create ingress - Create an ingress with the specified name
10
11
12
14 kubectl create ingress [OPTIONS]
15
16
17
19 Create an ingress 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 --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, jsonpath-as-
52 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="strict" Must be one of: strict (or true), warn, ignore
76 (or false). "true" or "strict" will use a schema to validate
77 the input and fail the request if invalid. It will perform server side
78 validation if ServerSideFieldValidation is enabled on the api-server,
79 but will fall back to less reliable client-side validation if not.
80 "warn" will warn about unknown or duplicate fields without
81 blocking the request if server-side field validation is enabled on the
82 API server, and behave as "ignore" otherwise. "false" or
83 "ignore" will not perform any schema validation, silently dropping any
84 unknown or duplicate fields.
85
86
87
89 --as="" Username to impersonate for the operation. User could be a
90 regular user or a service account in a namespace.
91
92
93 --as-group=[] Group to impersonate for the operation, this flag
94 can be repeated to specify multiple groups.
95
96
97 --as-uid="" UID to impersonate for the operation.
98
99
100 --azure-container-registry-config="" Path to the file containing
101 Azure container registry configuration information.
102
103
104 --cache-dir="/builddir/.kube/cache" Default cache directory
105
106
107 --certificate-authority="" Path to a cert file for the certificate
108 authority
109
110
111 --client-certificate="" Path to a client certificate file for TLS
112
113
114 --client-key="" Path to a client key file for TLS
115
116
117 --cluster="" The name of the kubeconfig cluster to use
118
119
120 --context="" The name of the kubeconfig context to use
121
122
123 --insecure-skip-tls-verify=false If true, the server's certificate
124 will not be checked for validity. This will make your HTTPS connections
125 insecure
126
127
128 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
129 quests.
130
131
132 --match-server-version=false Require server version to match
133 client version
134
135
136 -n, --namespace="" If present, the namespace scope for this CLI
137 request
138
139
140 --password="" Password for basic authentication to the API server
141
142
143 --profile="none" Name of profile to capture. One of
144 (none|cpu|heap|goroutine|threadcreate|block|mutex)
145
146
147 --profile-output="profile.pprof" Name of the file to write the
148 profile to
149
150
151 --request-timeout="0" The length of time to wait before giving up
152 on a single server request. Non-zero values should contain a corre‐
153 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
154 out requests.
155
156
157 -s, --server="" The address and port of the Kubernetes API server
158
159
160 --tls-server-name="" Server name to use for server certificate
161 validation. If it is not provided, the hostname used to contact the
162 server is used
163
164
165 --token="" Bearer token for authentication to the API server
166
167
168 --user="" The name of the kubeconfig user to use
169
170
171 --username="" Username for basic authentication to the API server
172
173
174 --version=false Print version information and quit
175
176
177 --warnings-as-errors=false Treat warnings received from the server
178 as errors and exit with a non-zero exit code
179
180
181
183 # Create a single ingress called 'simple' that directs requests to foo.com/bar to svc
184 # svc1:8080 with a tls secret "my-cert"
185 kubectl create ingress simple --rule="foo.com/bar=svc1:8080,tls=my-cert"
186
187 # Create a catch all ingress of "/path" pointing to service svc:port and Ingress Class as "otheringress"
188 kubectl create ingress catch-all --class=otheringress --rule="/path=svc:port"
189
190 # Create an ingress with two annotations: ingress.annotation1 and ingress.annotations2
191 kubectl create ingress annotated --class=default --rule="foo.com/bar=svc:port" \
192 --annotation ingress.annotation1=foo \
193 --annotation ingress.annotation2=bla
194
195 # Create an ingress with the same host and multiple paths
196 kubectl create ingress multipath --class=default \
197 --rule="foo.com/=svc:port" \
198 --rule="foo.com/admin/=svcadmin:portadmin"
199
200 # Create an ingress with multiple hosts and the pathType as Prefix
201 kubectl create ingress ingress1 --class=default \
202 --rule="foo.com/path*=svc:8080" \
203 --rule="bar.com/admin*=svc2:http"
204
205 # Create an ingress with TLS enabled using the default ingress certificate and different path types
206 kubectl create ingress ingtls --class=default \
207 --rule="foo.com/=svc:https,tls" \
208 --rule="foo.com/path/subpath*=othersvc:8080"
209
210 # Create an ingress with TLS enabled using a specific secret and pathType as Prefix
211 kubectl create ingress ingsecret --class=default \
212 --rule="foo.com/*=svc:8080,tls=secret1"
213
214 # Create an ingress with a default backend
215 kubectl create ingress ingdefault --class=default \
216 --default-backend=defaultsvc:http \
217 --rule="foo.com/*=svc:8080,tls=secret1"
218
219
220
221
223 kubectl-create(1),
224
225
226
228 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
229 com) based on the kubernetes source material, but hopefully they have
230 been automatically generated since!
231
232
233
234Manuals User KUBERNETES(1)(kubernetes)