1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl proxy - Run a proxy to the Kubernetes API server
10
11
12
14 kubectl proxy [OPTIONS]
15
16
17
19 Creates a proxy server or application-level gateway between localhost
20 and the Kubernetes API server. It also allows serving static content
21 over specified HTTP path. All incoming data enters through one port and
22 gets forwarded to the remote Kubernetes API server port, except for the
23 path matching the static content path.
24
25
26
28 --accept-hosts="^localhost$,^127\.0\.0\.1$,^\[::1\]$" Regular ex‐
29 pression for hosts that the proxy should accept.
30
31
32 --accept-paths="^.*" Regular expression for paths that the proxy
33 should accept.
34
35
36 --address="127.0.0.1" The IP address on which to serve on.
37
38
39 --api-prefix="/" Prefix to serve the proxied API under.
40
41
42 --append-server-path=false If true, enables automatic path append‐
43 ing of the kube context server path to each request.
44
45
46 --disable-filter=false If true, disable request filtering in the
47 proxy. This is dangerous, and can leave you vulnerable to XSRF attacks,
48 when used with an accessible port.
49
50
51 --keepalive=0s keepalive specifies the keep-alive period for an
52 active network connection. Set to 0 to disable keepalive.
53
54
55 -p, --port=8001 The port on which to run the proxy. Set to 0 to
56 pick a random port.
57
58
59 --reject-methods="^$" Regular expression for HTTP methods that the
60 proxy should reject (example --reject-methods='POST,PUT,PATCH').
61
62
63 --reject-paths="^/api/./pods/./exec,^/api/./pods/./attach" Regular
64 expression for paths that the proxy should reject. Paths specified here
65 will be rejected even accepted by --accept-paths.
66
67
68 -u, --unix-socket="" Unix socket on which to run the proxy.
69
70
71 -w, --www="" Also serve static files from the given directory un‐
72 der the specified prefix.
73
74
75 -P, --www-prefix="/static/" Prefix to serve static files under, if
76 static file directory is specified.
77
78
79
81 --as="" Username to impersonate for the operation. User could be a
82 regular user or a service account in a namespace.
83
84
85 --as-group=[] Group to impersonate for the operation, this flag
86 can be repeated to specify multiple groups.
87
88
89 --as-uid="" UID to impersonate for the operation.
90
91
92 --azure-container-registry-config="" Path to the file containing
93 Azure container registry configuration information.
94
95
96 --cache-dir="/builddir/.kube/cache" Default cache directory
97
98
99 --certificate-authority="" Path to a cert file for the certificate
100 authority
101
102
103 --client-certificate="" Path to a client certificate file for TLS
104
105
106 --client-key="" Path to a client key file for TLS
107
108
109 --cluster="" The name of the kubeconfig cluster to use
110
111
112 --context="" The name of the kubeconfig context to use
113
114
115 --insecure-skip-tls-verify=false If true, the server's certificate
116 will not be checked for validity. This will make your HTTPS connections
117 insecure
118
119
120 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
121 quests.
122
123
124 --match-server-version=false Require server version to match
125 client version
126
127
128 -n, --namespace="" If present, the namespace scope for this CLI
129 request
130
131
132 --password="" Password for basic authentication to the API server
133
134
135 --profile="none" Name of profile to capture. One of
136 (none|cpu|heap|goroutine|threadcreate|block|mutex)
137
138
139 --profile-output="profile.pprof" Name of the file to write the
140 profile to
141
142
143 --request-timeout="0" The length of time to wait before giving up
144 on a single server request. Non-zero values should contain a corre‐
145 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
146 out requests.
147
148
149 -s, --server="" The address and port of the Kubernetes API server
150
151
152 --tls-server-name="" Server name to use for server certificate
153 validation. If it is not provided, the hostname used to contact the
154 server is used
155
156
157 --token="" Bearer token for authentication to the API server
158
159
160 --user="" The name of the kubeconfig user to use
161
162
163 --username="" Username for basic authentication to the API server
164
165
166 --version=false Print version information and quit
167
168
169 --warnings-as-errors=false Treat warnings received from the server
170 as errors and exit with a non-zero exit code
171
172
173
175 # To proxy all of the Kubernetes API and nothing else
176 kubectl proxy --api-prefix=/
177
178 # To proxy only part of the Kubernetes API and also some static files
179 # You can get pods info with 'curl localhost:8001/api/v1/pods'
180 kubectl proxy --www=/my/files --www-prefix=/static/ --api-prefix=/api/
181
182 # To proxy the entire Kubernetes API at a different root
183 # You can get pods info with 'curl localhost:8001/custom/api/v1/pods'
184 kubectl proxy --api-prefix=/custom/
185
186 # Run a proxy to the Kubernetes API server on port 8011, serving static content from ./local/www/
187 kubectl proxy --port=8011 --www=./local/www/
188
189 # Run a proxy to the Kubernetes API server on an arbitrary local port
190 # The chosen port for the server will be output to stdout
191 kubectl proxy --port=0
192
193 # Run a proxy to the Kubernetes API server, changing the API prefix to k8s-api
194 # This makes e.g. the pods API available at localhost:8001/k8s-api/v1/pods/
195 kubectl proxy --api-prefix=/k8s-api
196
197
198
199
201 kubectl(1),
202
203
204
206 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
207 com) based on the kubernetes source material, but hopefully they have
208 been automatically generated since!
209
210
211
212Manuals User KUBERNETES(1)(kubernetes)