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

NAME

6       oc port-forward - Forward one or more local ports to a pod
7
8
9

SYNOPSIS

11       oc port-forward [OPTIONS]
12
13
14

DESCRIPTION

16       Forward 1 or more local ports to a pod
17
18
19

OPTIONS

21       --pod-running-timeout=0
22           The  length  of time (like 5s, 2m, or 3h, higher than zero) to wait
23       until at least one pod is running
24
25
26

OPTIONS INHERITED FROM PARENT COMMANDS

28       --allow_verification_with_non_compliant_keys=false
29           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
30       non-compliant with RFC6962.
31
32
33       --alsologtostderr=false
34           log to standard error as well as files
35
36
37       --application_metrics_count_limit=100
38           Max number of application metrics to store (per container)
39
40
41       --as=""
42           Username to impersonate for the operation
43
44
45       --as-group=[]
46           Group  to  impersonate for the operation, this flag can be repeated
47       to specify multiple groups.
48
49
50       --azure-container-registry-config=""
51           Path to the file containing Azure container registry  configuration
52       information.
53
54
55       --boot_id_file="/proc/sys/kernel/random/boot_id"
56           Comma-separated  list  of files to check for boot-id. Use the first
57       one that exists.
58
59
60       --cache-dir="/builddir/.kube/http-cache"
61           Default HTTP cache directory
62
63
64       --certificate-authority=""
65           Path to a cert file for the certificate authority
66
67
68       --client-certificate=""
69           Path to a client certificate file for TLS
70
71
72       --client-key=""
73           Path to a client key file for TLS
74
75
76       --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
77           CIDRs opened in GCE firewall for LB traffic proxy  health checks
78
79
80       --cluster=""
81           The name of the kubeconfig cluster to use
82
83
84       --container_hints="/etc/cadvisor/container_hints.json"
85           location of the container hints file
86
87
88       --containerd="unix:///var/run/containerd.sock"
89           containerd endpoint
90
91
92       --context=""
93           The name of the kubeconfig context to use
94
95
96       --default-not-ready-toleration-seconds=300
97           Indicates    the    tolerationSeconds   of   the   toleration   for
98       notReady:NoExecute that is added by default to every pod that does  not
99       already have such a toleration.
100
101
102       --default-unreachable-toleration-seconds=300
103           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
104       able:NoExecute that is added by default to  every  pod  that  does  not
105       already have such a toleration.
106
107
108       --docker="unix:///var/run/docker.sock"
109           docker endpoint
110
111
112       --docker-tls=false
113           use TLS to connect to docker
114
115
116       --docker-tls-ca="ca.pem"
117           path to trusted CA
118
119
120       --docker-tls-cert="cert.pem"
121           path to client certificate
122
123
124       --docker-tls-key="key.pem"
125           path to private key
126
127
128       --docker_env_metadata_whitelist=""
129           a  comma-separated  list of environment variable keys that needs to
130       be collected for docker containers
131
132
133       --docker_only=false
134           Only report docker containers in addition to root stats
135
136
137       --docker_root="/var/lib/docker"
138           DEPRECATED: docker root is read from docker info (this is  a  fall‐
139       back, default: /var/lib/docker)
140
141
142       --enable_load_reader=false
143           Whether to enable cpu load reader
144
145
146       --event_storage_age_limit="default=24h"
147           Max length of time for which to store events (per type). Value is a
148       comma separated list of key values, where  the  keys  are  event  types
149       (e.g.: creation, oom) or "default" and the value is a duration. Default
150       is applied to all non-specified event types
151
152
153       --event_storage_event_limit="default=100000"
154           Max number of events to store (per type). Value is  a  comma  sepa‐
155       rated  list  of  key values, where the keys are event types (e.g.: cre‐
156       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
157       applied to all non-specified event types
158
159
160       --global_housekeeping_interval=0
161           Interval between global housekeepings
162
163
164       --housekeeping_interval=0
165           Interval between container housekeepings
166
167
168       --httptest.serve=""
169           if non-empty, httptest.NewServer serves on this address and blocks
170
171
172       --insecure-skip-tls-verify=false
173           If true, the server's certificate will not be checked for validity.
174       This will make your HTTPS connections insecure
175
176
177       --kubeconfig=""
178           Path to the kubeconfig file to use for CLI requests.
179
180
181       --log-flush-frequency=0
182           Maximum number of seconds between log flushes
183
184
185       --log_backtrace_at=:0
186           when logging hits line file:N, emit a stack trace
187
188
189       --log_cadvisor_usage=false
190           Whether to log the usage of the cAdvisor container
191
192
193       --log_dir=""
194           If non-empty, write log files in this directory
195
196
197       --logtostderr=true
198           log to standard error instead of files
199
200
201       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
202           Comma-separated list of files to  check  for  machine-id.  Use  the
203       first one that exists.
204
205
206       --match-server-version=false
207           Require server version to match client version
208
209
210       -n, --namespace=""
211           If present, the namespace scope for this CLI request
212
213
214       --request-timeout="0"
215           The  length  of  time  to  wait before giving up on a single server
216       request. Non-zero values should contain a corresponding time unit (e.g.
217       1s, 2m, 3h). A value of zero means don't timeout requests.
218
219
220       -s, --server=""
221           The address and port of the Kubernetes API server
222
223
224       --stderrthreshold=2
225           logs at or above this threshold go to stderr
226
227
228       --storage_driver_buffer_duration=0
229           Writes  in  the  storage driver will be buffered for this duration,
230       and committed to the non memory backends as a single transaction
231
232
233       --storage_driver_db="cadvisor"
234           database name
235
236
237       --storage_driver_host="localhost:8086"
238           database host:port
239
240
241       --storage_driver_password="root"
242           database password
243
244
245       --storage_driver_secure=false
246           use secure connection with database
247
248
249       --storage_driver_table="stats"
250           table name
251
252
253       --storage_driver_user="root"
254           database username
255
256
257       --token=""
258           Bearer token for authentication to the API server
259
260
261       --user=""
262           The name of the kubeconfig user to use
263
264
265       -v, --v=0
266           log level for V logs
267
268
269       --version=false
270           Print version information and quit
271
272
273       --vmodule=
274           comma-separated list of pattern=N settings for  file-filtered  log‐
275       ging
276
277
278

EXAMPLE

280                # Listens on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
281                oc port-forward mypod 5000 6000
282
283                # Listens on port 8888 locally, forwarding to 5000 in the pod
284                oc port-forward mypod 8888:5000
285
286                # Listens on a random port locally, forwarding to 5000 in the pod
287                oc port-forward mypod :5000
288
289                # Listens on a random port locally, forwarding to 5000 in the pod
290                oc port-forward mypod 0:5000
291
292
293
294

SEE ALSO

296       oc(1),
297
298
299

HISTORY

301       June 2016, Ported from the Kubernetes man-doc generator
302
303
304
305Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum