MAQPNADocs

maqpna port-forward

Forward local ports to a session's sandbox, the gateway or the console (kubectl port-forward)

Run agents

Synopsis#

maqpna port-forward SESSION | sess/NAME [LOCAL:]REMOTE... [-n NS] [--address 127.0.0.1]
maqpna port-forward gateway|console [LOCAL:]REMOTE... [--operator-namespace NS]

Description#

gateway forwards to the gateway Service (label app.kubernetes.io/component=gateway) in the control-plane namespace; console to the console Service. A session target needs pods/portforward (checked, and recorded as a PrivilegedAccess event).

Flags#

FlagTypeDescriptionDefault
--addressstringlocal addresses to listen on (comma-separated)127.0.0.1
-n, --namespacestringnamespacedefault
--operator-namespacestringnamespace of the gateway and console Servicesmaqpna-system

The global flags (--context, -o, --no-color, ...) work with every command.

Examples#

maqpna port-forward gateway 8080:8080
maqpna port-forward sess/coder-x1 -n team-a 6080:6080

Exit codes#

CodeMeaning
0success
1error (the message says what failed, with a hint when there is one)
2usage error: unknown flag, missing argument or bad value; the synopsis is printed
3a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command)